r38172 - in /branches/upstream/libclass-mop-perl/current: ./ inc/Module/ inc/Module/Install/ lib/ lib/Class/ lib/Class/MOP/ lib/Class/MOP/Class/Immutable/ lib/Class/MOP/Class/Immutable/Class/MOP/ lib/Class/MOP/Method/ t/ xt/author/

carnil-guest at users.alioth.debian.org carnil-guest at users.alioth.debian.org
Tue Jun 16 17:27:24 UTC 2009


Author: carnil-guest
Date: Tue Jun 16 17:27:01 2009
New Revision: 38172

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=38172
Log:
[svn-upgrade] Integrating new upstream version, libclass-mop-perl (0.86)

Added:
    branches/upstream/libclass-mop-perl/current/t/310_immutable_destroy.t
Modified:
    branches/upstream/libclass-mop-perl/current/Changes
    branches/upstream/libclass-mop-perl/current/MANIFEST
    branches/upstream/libclass-mop-perl/current/META.yml
    branches/upstream/libclass-mop-perl/current/README
    branches/upstream/libclass-mop-perl/current/inc/Module/Install.pm
    branches/upstream/libclass-mop-perl/current/inc/Module/Install/Base.pm
    branches/upstream/libclass-mop-perl/current/inc/Module/Install/Can.pm
    branches/upstream/libclass-mop-perl/current/inc/Module/Install/Fetch.pm
    branches/upstream/libclass-mop-perl/current/inc/Module/Install/Makefile.pm
    branches/upstream/libclass-mop-perl/current/inc/Module/Install/Metadata.pm
    branches/upstream/libclass-mop-perl/current/inc/Module/Install/Win32.pm
    branches/upstream/libclass-mop-perl/current/inc/Module/Install/WriteAll.pm
    branches/upstream/libclass-mop-perl/current/lib/Class/MOP.pm
    branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Attribute.pm
    branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Class.pm
    branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Class/Immutable/Class/MOP/Class.pm
    branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Class/Immutable/Trait.pm
    branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Instance.pm
    branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Method.pm
    branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Method/Accessor.pm
    branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Method/Constructor.pm
    branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Method/Generated.pm
    branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Method/Inlined.pm
    branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Method/Wrapped.pm
    branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Module.pm
    branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Object.pm
    branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Package.pm
    branches/upstream/libclass-mop-perl/current/lib/metaclass.pm
    branches/upstream/libclass-mop-perl/current/t/003_methods.t
    branches/upstream/libclass-mop-perl/current/xt/author/pod_spell.t

Modified: branches/upstream/libclass-mop-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/Changes?rev=38172&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/Changes (original)
+++ branches/upstream/libclass-mop-perl/current/Changes Tue Jun 16 17:27:01 2009
@@ -1,4 +1,14 @@
 Revision history for Perl extension Class-MOP.
+
+0.86 Tue, Jun 16, 2009
+    * Class::MOP::Class
+      - If you redefined a subroutine at runtime and then wrapped it
+        with a method modifier, the modifier could in some cases wrap
+        the original version of the subroutine
+
+    * Class::MOP::Class
+      - make_immutable issues a warning instead of overriding an
+        existing DESTROY method (Dylan William Hardison)
 
 0.85 Sat, Jun 6, 2009
     * Class::MOP::Attribute

Modified: branches/upstream/libclass-mop-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/MANIFEST?rev=38172&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/MANIFEST (original)
+++ branches/upstream/libclass-mop-perl/current/MANIFEST Tue Jun 16 17:27:01 2009
@@ -110,6 +110,7 @@
 t/307_null_stash.t
 t/308_insertion_order.t
 t/309_subname.t
+t/310_immutable_destroy.t
 t/lib/BinaryTree.pm
 t/lib/MyMetaClass.pm
 t/lib/MyMetaClass/Attribute.pm

Modified: branches/upstream/libclass-mop-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/META.yml?rev=38172&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/META.yml (original)
+++ branches/upstream/libclass-mop-perl/current/META.yml Tue Jun 16 17:27:01 2009
@@ -10,7 +10,7 @@
 configure_requires:
   ExtUtils::MakeMaker: 6.42
 distribution_type: module
-generated_by: 'Module::Install version 0.87'
+generated_by: 'Module::Install version 0.91'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -32,4 +32,4 @@
   perl: 5.8.1
 resources:
   license: http://dev.perl.org/licenses/
-version: 0.85
+version: 0.86

Modified: branches/upstream/libclass-mop-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/README?rev=38172&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/README (original)
+++ branches/upstream/libclass-mop-perl/current/README Tue Jun 16 17:27:01 2009
@@ -1,4 +1,4 @@
-Class::MOP version 0.85
+Class::MOP version 0.86
 ===========================
 
 See the individual module documentation for more information

Modified: branches/upstream/libclass-mop-perl/current/inc/Module/Install.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/inc/Module/Install.pm?rev=38172&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/inc/Module/Install.pm (original)
+++ branches/upstream/libclass-mop-perl/current/inc/Module/Install.pm Tue Jun 16 17:27:01 2009
@@ -28,7 +28,7 @@
 	# This is not enforced yet, but will be some time in the next few
 	# releases once we can make sure it won't clash with custom
 	# Module::Install extensions.
-	$VERSION = '0.87';
+	$VERSION = '0.91';
 
 	# Storage for the pseudo-singleton
 	$MAIN    = undef;
@@ -353,7 +353,7 @@
 	if ( $] >= 5.006 ) {
 		open( FH, '<', $_[0] ) or die "open($_[0]): $!";
 	} else {
-		open( FH, "< $_[0]"  ) or die "open($_[0]): $!";	
+		open( FH, "< $_[0]"  ) or die "open($_[0]): $!";
 	}
 	my $string = do { local $/; <FH> };
 	close FH or die "close($_[0]): $!";
@@ -384,7 +384,7 @@
 	if ( $] >= 5.006 ) {
 		open( FH, '>', $_[0] ) or die "open($_[0]): $!";
 	} else {
-		open( FH, "> $_[0]"  ) or die "open($_[0]): $!";	
+		open( FH, "> $_[0]"  ) or die "open($_[0]): $!";
 	}
 	foreach ( 1 .. $#_ ) {
 		print FH $_[$_] or die "print($_[0]): $!";

Modified: branches/upstream/libclass-mop-perl/current/inc/Module/Install/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/inc/Module/Install/Base.pm?rev=38172&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/inc/Module/Install/Base.pm (original)
+++ branches/upstream/libclass-mop-perl/current/inc/Module/Install/Base.pm Tue Jun 16 17:27:01 2009
@@ -4,7 +4,7 @@
 use strict 'vars';
 use vars qw{$VERSION};
 BEGIN {
-	$VERSION = '0.87';
+	$VERSION = '0.91';
 }
 
 # Suspend handler for "redefined" warnings
@@ -13,42 +13,34 @@
 	$SIG{__WARN__} = sub { $w };
 }
 
-### This is the ONLY module that shouldn't have strict on
-# use strict;
-
-#line 45
+#line 42
 
 sub new {
-	my ($class, %args) = @_;
-
-	foreach my $method ( qw(call load) ) {
-		next if defined &{"$class\::$method"};
-		*{"$class\::$method"} = sub {
-			shift()->_top->$method(@_);
-		};
+	my $class = shift;
+	unless ( defined &{"${class}::call"} ) {
+		*{"${class}::call"} = sub { shift->_top->call(@_) };
 	}
-
-	bless( \%args, $class );
+	unless ( defined &{"${class}::load"} ) {
+		*{"${class}::load"} = sub { shift->_top->load(@_) };
+	}
+	bless { @_ }, $class;
 }
 
-#line 66
+#line 61
 
 sub AUTOLOAD {
-	my $self = shift;
 	local $@;
-	my $autoload = eval {
-		$self->_top->autoload
-	} or return;
-	goto &$autoload;
+	my $func = eval { shift->_top->autoload } or return;
+	goto &$func;
 }
 
-#line 83
+#line 75
 
 sub _top {
 	$_[0]->{_top};
 }
 
-#line 98
+#line 90
 
 sub admin {
 	$_[0]->_top->{admin}
@@ -56,7 +48,7 @@
 	Module::Install::Base::FakeAdmin->new;
 }
 
-#line 114
+#line 106
 
 sub is_admin {
 	$_[0]->admin->VERSION;
@@ -83,4 +75,4 @@
 
 1;
 
-#line 162
+#line 154

Modified: branches/upstream/libclass-mop-perl/current/inc/Module/Install/Can.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/inc/Module/Install/Can.pm?rev=38172&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/inc/Module/Install/Can.pm (original)
+++ branches/upstream/libclass-mop-perl/current/inc/Module/Install/Can.pm Tue Jun 16 17:27:01 2009
@@ -2,16 +2,16 @@
 package Module::Install::Can;
 
 use strict;
-use Module::Install::Base;
-use Config              ();
-use File::Spec          ();
-use ExtUtils::MakeMaker ();
+use Config                ();
+use File::Spec            ();
+use ExtUtils::MakeMaker   ();
+use Module::Install::Base ();
 
-use vars qw{$VERSION $ISCORE @ISA};
+use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.87';
+	$VERSION = '0.91';
+	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
-	@ISA     = qw{Module::Install::Base};
 }
 
 # check if we can load some module

Modified: branches/upstream/libclass-mop-perl/current/inc/Module/Install/Fetch.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/inc/Module/Install/Fetch.pm?rev=38172&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/inc/Module/Install/Fetch.pm (original)
+++ branches/upstream/libclass-mop-perl/current/inc/Module/Install/Fetch.pm Tue Jun 16 17:27:01 2009
@@ -2,13 +2,13 @@
 package Module::Install::Fetch;
 
 use strict;
-use Module::Install::Base;
+use Module::Install::Base ();
 
-use vars qw{$VERSION $ISCORE @ISA};
+use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.87';
+	$VERSION = '0.91';
+	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
-	@ISA     = qw{Module::Install::Base};
 }
 
 sub get_file {

Modified: branches/upstream/libclass-mop-perl/current/inc/Module/Install/Makefile.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/inc/Module/Install/Makefile.pm?rev=38172&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/inc/Module/Install/Makefile.pm (original)
+++ branches/upstream/libclass-mop-perl/current/inc/Module/Install/Makefile.pm Tue Jun 16 17:27:01 2009
@@ -2,14 +2,14 @@
 package Module::Install::Makefile;
 
 use strict 'vars';
-use Module::Install::Base;
-use ExtUtils::MakeMaker ();
-
-use vars qw{$VERSION $ISCORE @ISA};
+use ExtUtils::MakeMaker   ();
+use Module::Install::Base ();
+
+use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.87';
+	$VERSION = '0.91';
+	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
-	@ISA     = qw{Module::Install::Base};
 }
 
 sub Makefile { $_[0] }

Modified: branches/upstream/libclass-mop-perl/current/inc/Module/Install/Metadata.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/inc/Module/Install/Metadata.pm?rev=38172&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/inc/Module/Install/Metadata.pm (original)
+++ branches/upstream/libclass-mop-perl/current/inc/Module/Install/Metadata.pm Tue Jun 16 17:27:01 2009
@@ -2,18 +2,17 @@
 package Module::Install::Metadata;
 
 use strict 'vars';
-use Module::Install::Base;
+use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.87';
-	@ISA     = qw{Module::Install::Base};
+	$VERSION = '0.91';
+	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
 
 my @boolean_keys = qw{
 	sign
-	mymeta
 };
 
 my @scalar_keys = qw{
@@ -440,21 +439,21 @@
 	/ixms ) {
 		my $license_text = $1;
 		my @phrases      = (
-			'under the same (?:terms|license) as perl itself' => 'perl',        1,
-			'GNU general public license'                      => 'gpl',         1,
-			'GNU public license'                              => 'gpl',         1,
-			'GNU lesser general public license'               => 'lgpl',        1,
-			'GNU lesser public license'                       => 'lgpl',        1,
-			'GNU library general public license'              => 'lgpl',        1,
-			'GNU library public license'                      => 'lgpl',        1,
-			'BSD license'                                     => 'bsd',         1,
-			'Artistic license'                                => 'artistic',    1,
-			'GPL'                                             => 'gpl',         1,
-			'LGPL'                                            => 'lgpl',        1,
-			'BSD'                                             => 'bsd',         1,
-			'Artistic'                                        => 'artistic',    1,
-			'MIT'                                             => 'mit',         1,
-			'proprietary'                                     => 'proprietary', 0,
+			'under the same (?:terms|license) as (?:perl|the perl programming language) itself' => 'perl', 1,
+			'GNU general public license'         => 'gpl',         1,
+			'GNU public license'                 => 'gpl',         1,
+			'GNU lesser general public license'  => 'lgpl',        1,
+			'GNU lesser public license'          => 'lgpl',        1,
+			'GNU library general public license' => 'lgpl',        1,
+			'GNU library public license'         => 'lgpl',        1,
+			'BSD license'                        => 'bsd',         1,
+			'Artistic license'                   => 'artistic',    1,
+			'GPL'                                => 'gpl',         1,
+			'LGPL'                               => 'lgpl',        1,
+			'BSD'                                => 'bsd',         1,
+			'Artistic'                           => 'artistic',    1,
+			'MIT'                                => 'mit',         1,
+			'proprietary'                        => 'proprietary', 0,
 		);
 		while ( my ($pattern, $license, $osi) = splice(@phrases, 0, 3) ) {
 			$pattern =~ s{\s+}{\\s+}g;
@@ -506,17 +505,29 @@
 	}
 }
 
+sub test_requires_from {
+	my $self     = shift;
+	my $content  = Module::Install::_readperl($_[0]);
+	my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+([\d\.]+)/mg;
+	while ( @requires ) {
+		my $module  = shift @requires;
+		my $version = shift @requires;
+		$self->test_requires( $module => $version );
+	}
+}
+
 # Convert triple-part versions (eg, 5.6.1 or 5.8.9) to
 # numbers (eg, 5.006001 or 5.008009).
 # Also, convert double-part versions (eg, 5.8)
 sub _perl_version {
 	my $v = $_[-1];
-	$v =~ s/^([1-9])\.([1-9]\d?\d?)$/sprintf("%d.%03d",$1,$2)/e;	
+	$v =~ s/^([1-9])\.([1-9]\d?\d?)$/sprintf("%d.%03d",$1,$2)/e;
 	$v =~ s/^([1-9])\.([1-9]\d?\d?)\.(0|[1-9]\d?\d?)$/sprintf("%d.%03d%03d",$1,$2,$3 || 0)/e;
 	$v =~ s/(\.\d\d\d)000$/$1/;
 	$v =~ s/_.+$//;
 	if ( ref($v) ) {
-		$v = $v + 0; # Numify
+		# Numify
+		$v = $v + 0;
 	}
 	return $v;
 }
@@ -526,21 +537,56 @@
 
 
 ######################################################################
-# MYMETA.yml Support
+# MYMETA Support
 
 sub WriteMyMeta {
 	die "WriteMyMeta has been deprecated";
 }
 
-sub write_mymeta {
-	my $self = shift;
-	
-	# If there's no existing META.yml there is nothing we can do
-	return unless -f 'META.yml';
+sub write_mymeta_yaml {
+	my $self = shift;
 
 	# We need YAML::Tiny to write the MYMETA.yml file
 	unless ( eval { require YAML::Tiny; 1; } ) {
 		return 1;
+	}
+
+	# Generate the data
+	my $meta = $self->_write_mymeta_data or return 1;
+
+	# Save as the MYMETA.yml file
+	print "Writing MYMETA.yml\n";
+	YAML::Tiny::DumpFile('MYMETA.yml', $meta);
+}
+
+sub write_mymeta_json {
+	my $self = shift;
+
+	# We need JSON to write the MYMETA.json file
+	unless ( eval { require JSON; 1; } ) {
+		return 1;
+	}
+
+	# Generate the data
+	my $meta = $self->_write_mymeta_data or return 1;
+
+	# Save as the MYMETA.yml file
+	print "Writing MYMETA.json\n";
+	Module::Install::_write(
+		'MYMETA.json',
+		JSON->new->pretty(1)->canonical->encode($meta),
+	);
+}
+
+sub _write_mymeta_data {
+	my $self = shift;
+
+	# If there's no existing META.yml there is nothing we can do
+	return undef unless -f 'META.yml';
+
+	# We need Parse::CPAN::Meta to load the file
+	unless ( eval { require Parse::CPAN::Meta; 1; } ) {
+		return undef;
 	}
 
 	# Merge the perl version into the dependencies
@@ -558,7 +604,7 @@
 	}
 
 	# Load the advisory META.yml file
-	my @yaml = YAML::Tiny::LoadFile('META.yml');
+	my @yaml = Parse::CPAN::Meta::LoadFile('META.yml');
 	my $meta = $yaml[0];
 
 	# Overwrite the non-configure dependency hashs
@@ -572,9 +618,7 @@
 		$meta->{build_requires} = { map { @$_ } @{ $val->{build_requires} } };
 	}
 
-	# Save as the MYMETA.yml file
-	print "Writing MYMETA.yml\n";
-	YAML::Tiny::DumpFile('MYMETA.yml', $meta);	
+	return $meta;
 }
 
 1;

Modified: branches/upstream/libclass-mop-perl/current/inc/Module/Install/Win32.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/inc/Module/Install/Win32.pm?rev=38172&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/inc/Module/Install/Win32.pm (original)
+++ branches/upstream/libclass-mop-perl/current/inc/Module/Install/Win32.pm Tue Jun 16 17:27:01 2009
@@ -2,12 +2,12 @@
 package Module::Install::Win32;
 
 use strict;
-use Module::Install::Base;
+use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.87';
-	@ISA     = qw{Module::Install::Base};
+	$VERSION = '0.91';
+	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
 

Modified: branches/upstream/libclass-mop-perl/current/inc/Module/Install/WriteAll.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/inc/Module/Install/WriteAll.pm?rev=38172&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/inc/Module/Install/WriteAll.pm (original)
+++ branches/upstream/libclass-mop-perl/current/inc/Module/Install/WriteAll.pm Tue Jun 16 17:27:01 2009
@@ -2,11 +2,11 @@
 package Module::Install::WriteAll;
 
 use strict;
-use Module::Install::Base;
+use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.87';
+	$VERSION = '0.91';;
 	@ISA     = qw{Module::Install::Base};
 	$ISCORE  = 1;
 }
@@ -41,8 +41,18 @@
 
 	# The Makefile write process adds a couple of dependencies,
 	# so write the META.yml files after the Makefile.
-	$self->Meta->write        if $args{meta};
-	$self->Meta->write_mymeta if $self->mymeta;
+	if ( $args{meta} ) {
+		$self->Meta->write;
+	}
+
+	# Experimental support for MYMETA
+	if ( $ENV{X_MYMETA} ) {
+		if ( $ENV{X_MYMETA} eq 'JSON' ) {
+			$self->Meta->write_mymeta_json;
+		} else {
+			$self->Meta->write_mymeta_yaml;
+		}
+	}
 
 	return 1;
 }

Modified: branches/upstream/libclass-mop-perl/current/lib/Class/MOP.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/lib/Class/MOP.pm?rev=38172&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/lib/Class/MOP.pm (original)
+++ branches/upstream/libclass-mop-perl/current/lib/Class/MOP.pm Tue Jun 16 17:27:01 2009
@@ -29,7 +29,7 @@
     *check_package_cache_flag = \&mro::get_pkg_gen;
 }
 
-our $VERSION   = '0.85';
+our $VERSION   = '0.86';
 our $XS_VERSION = $VERSION;
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
@@ -1160,6 +1160,8 @@
 
 Scott (konobi) McWhirter
 
+Dylan Hardison
+
 =head1 COPYRIGHT AND LICENSE
 
 Copyright 2006-2009 by Infinity Interactive, Inc.

Modified: branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Attribute.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Attribute.pm?rev=38172&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Attribute.pm (original)
+++ branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Attribute.pm Tue Jun 16 17:27:01 2009
@@ -9,7 +9,7 @@
 use Carp         'confess';
 use Scalar::Util 'blessed', 'weaken';
 
-our $VERSION   = '0.85';
+our $VERSION   = '0.86';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Class.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Class.pm?rev=38172&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Class.pm (original)
+++ branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Class.pm Tue Jun 16 17:27:01 2009
@@ -15,7 +15,7 @@
 use Sub::Name 'subname';
 use Devel::GlobalDestruction 'in_global_destruction';
 
-our $VERSION   = '0.85';
+our $VERSION   = '0.86';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 
@@ -619,11 +619,8 @@
 
     $method->attach_to_class($self);
 
-    # This used to call get_method_map, which meant we would build all
-    # the method objects for the class just because we added one
-    # method. This is hackier, but quicker too.
-    $self->{methods}{$method_name} = $method;
-    
+    $self->get_method_map->{$method_name} = $method;
+
     my ( $current_package, $current_name ) = Class::MOP::get_code_info($body);
 
     if ( $current_name eq '__ANON__' ) {
@@ -719,7 +716,7 @@
     (defined $method_name && $method_name)
         || confess "You must define a method name";
 
-    exists $self->{methods}{$method_name} || exists $self->get_method_map->{$method_name};
+    exists $self->get_method_map->{$method_name};
 }
 
 sub get_method {
@@ -727,7 +724,7 @@
     (defined $method_name && $method_name)
         || confess "You must define a method name";
 
-    return $self->{methods}{$method_name} || $self->get_method_map->{$method_name};
+    return $self->get_method_map->{$method_name};
 }
 
 sub remove_method {
@@ -1165,11 +1162,7 @@
 
     my $name = $args{constructor_name};
 
-    #if ( my $existing = $self->name->can($args{constructor_name}) ) {
-    #    if ( refaddr($existing) == refaddr(\&Moose::Object::new) ) {
-
-    unless ( $args{replace_constructor}
-        or !$self->has_method($name) ) {
+    if ( $self->has_method($name) && !$args{replace_constructor} ) {
         my $class = $self->name;
         warn "Not inlining a constructor for $class since it defines"
             . " its own constructor.\n"
@@ -1203,6 +1196,13 @@
     ( exists $args{destructor_class} )
         || confess "The 'inline_destructor' option is present, but "
         . "no destructor class was specified";
+
+    if ( $self->has_method('DESTROY') ) {
+        my $class = $self->name;
+        warn "Not inlining a destructor for $class since it defines"
+            . " its own destructor.\n";
+        return;
+    }
 
     my $destructor_class = $args{destructor_class};
 
@@ -1613,7 +1613,10 @@
 
 This will return a L<Class::MOP::Attribute> for the specified
 C<$attribute_name>. If the class does not have the specified
-attribute, it returns C<undef>
+attribute, it returns C<undef>.  
+
+NOTE that get_attribute does not search superclasses, for 
+that you need to use C<find_attribute_by_name>.
 
 =item B<< $metaclass->has_attribute($attribute_name) >>
 

Modified: branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Class/Immutable/Class/MOP/Class.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Class/Immutable/Class/MOP/Class.pm?rev=38172&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Class/Immutable/Class/MOP/Class.pm (original)
+++ branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Class/Immutable/Class/MOP/Class.pm Tue Jun 16 17:27:01 2009
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-our $VERSION   = '0.85';
+our $VERSION   = '0.86';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Class/Immutable/Trait.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Class/Immutable/Trait.pm?rev=38172&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Class/Immutable/Trait.pm (original)
+++ branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Class/Immutable/Trait.pm Tue Jun 16 17:27:01 2009
@@ -8,7 +8,7 @@
 use Carp 'confess';
 use Scalar::Util 'blessed', 'weaken';
 
-our $VERSION   = '0.85';
+our $VERSION   = '0.86';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Instance.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Instance.pm?rev=38172&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Instance.pm (original)
+++ branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Instance.pm Tue Jun 16 17:27:01 2009
@@ -6,7 +6,7 @@
 
 use Scalar::Util 'weaken', 'blessed';
 
-our $VERSION   = '0.85';
+our $VERSION   = '0.86';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Method.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Method.pm?rev=38172&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Method.pm (original)
+++ branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Method.pm Tue Jun 16 17:27:01 2009
@@ -7,7 +7,7 @@
 use Carp         'confess';
 use Scalar::Util 'weaken';
 
-our $VERSION   = '0.85';
+our $VERSION   = '0.86';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Method/Accessor.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Method/Accessor.pm?rev=38172&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Method/Accessor.pm (original)
+++ branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Method/Accessor.pm Tue Jun 16 17:27:01 2009
@@ -7,7 +7,7 @@
 use Carp         'confess';
 use Scalar::Util 'blessed', 'weaken';
 
-our $VERSION   = '0.85';
+our $VERSION   = '0.86';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Method/Constructor.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Method/Constructor.pm?rev=38172&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Method/Constructor.pm (original)
+++ branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Method/Constructor.pm Tue Jun 16 17:27:01 2009
@@ -7,7 +7,7 @@
 use Carp         'confess';
 use Scalar::Util 'blessed', 'weaken', 'looks_like_number';
 
-our $VERSION   = '0.85';
+our $VERSION   = '0.86';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Method/Generated.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Method/Generated.pm?rev=38172&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Method/Generated.pm (original)
+++ branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Method/Generated.pm Tue Jun 16 17:27:01 2009
@@ -6,7 +6,7 @@
 
 use Carp 'confess';
 
-our $VERSION   = '0.85';
+our $VERSION   = '0.86';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Method/Inlined.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Method/Inlined.pm?rev=38172&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Method/Inlined.pm (original)
+++ branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Method/Inlined.pm Tue Jun 16 17:27:01 2009
@@ -6,7 +6,7 @@
 use Carp         'confess';
 use Scalar::Util 'blessed', 'weaken', 'looks_like_number', 'refaddr';
 
-our $VERSION   = '0.85';
+our $VERSION   = '0.86';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Method/Wrapped.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Method/Wrapped.pm?rev=38172&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Method/Wrapped.pm (original)
+++ branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Method/Wrapped.pm Tue Jun 16 17:27:01 2009
@@ -7,7 +7,7 @@
 use Carp         'confess';
 use Scalar::Util 'blessed';
 
-our $VERSION   = '0.85';
+our $VERSION   = '0.86';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Module.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Module.pm?rev=38172&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Module.pm (original)
+++ branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Module.pm Tue Jun 16 17:27:01 2009
@@ -7,7 +7,7 @@
 use Carp         'confess';
 use Scalar::Util 'blessed';
 
-our $VERSION   = '0.85';
+our $VERSION   = '0.86';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Object.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Object.pm?rev=38172&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Object.pm (original)
+++ branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Object.pm Tue Jun 16 17:27:01 2009
@@ -6,7 +6,7 @@
 
 use Scalar::Util 'blessed';
 
-our $VERSION   = '0.85';
+our $VERSION   = '0.86';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Package.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Package.pm?rev=38172&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Package.pm (original)
+++ branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Package.pm Tue Jun 16 17:27:01 2009
@@ -8,7 +8,7 @@
 use Scalar::Util 'blessed';
 use Carp         'confess';
 
-our $VERSION   = '0.85';
+our $VERSION   = '0.86';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: branches/upstream/libclass-mop-perl/current/lib/metaclass.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/lib/metaclass.pm?rev=38172&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/lib/metaclass.pm (original)
+++ branches/upstream/libclass-mop-perl/current/lib/metaclass.pm Tue Jun 16 17:27:01 2009
@@ -7,7 +7,7 @@
 use Carp         'confess';
 use Scalar::Util 'blessed';
 
-our $VERSION   = '0.85';
+our $VERSION   = '0.86';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: branches/upstream/libclass-mop-perl/current/t/003_methods.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/t/003_methods.t?rev=38172&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/t/003_methods.t (original)
+++ branches/upstream/libclass-mop-perl/current/t/003_methods.t Tue Jun 16 17:27:01 2009
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 66;
+use Test::More tests => 67;
 use Test::Exception;
 
 use Scalar::Util qw/reftype/;
@@ -242,3 +242,46 @@
 
 isnt( $method, $new_method, 'add_method clones method objects as they are added' );
 is( $new_method->original_method, $method, '... the cloned method has the correct original method' );
+
+{
+
+    package CustomAccessor;
+
+    use Class::MOP;
+
+    my $meta = Class::MOP::Class->initialize(__PACKAGE__);
+
+    $meta->add_attribute(
+        foo => (
+            accessor => 'foo',
+        )
+    );
+
+    {
+        no warnings 'redefine', 'once';
+        *foo = sub {
+            my $self = shift;
+            $self->{custom_store} = $_[0];
+        };
+    }
+
+    $meta->add_around_method_modifier(
+        'foo',
+        sub {
+            my $orig = shift;
+            $orig->(@_);
+        }
+    );
+
+    $meta->add_method( 'new', sub { return bless {}, shift } );
+}
+
+{
+    my $o   = CustomAccessor->new;
+    my $str = 'string';
+
+    $o->foo($str);
+
+    is( $o->{custom_store}, $str,
+        'Custom glob-assignment-created accessor is still method modifier is added' );
+}

Added: branches/upstream/libclass-mop-perl/current/t/310_immutable_destroy.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/t/310_immutable_destroy.t?rev=38172&op=file
==============================================================================
--- branches/upstream/libclass-mop-perl/current/t/310_immutable_destroy.t (added)
+++ branches/upstream/libclass-mop-perl/current/t/310_immutable_destroy.t Tue Jun 16 17:27:01 2009
@@ -1,0 +1,30 @@
+use strict;
+use warnings;
+use Test::More tests => 1;
+use Class::MOP;
+
+SKIP: {
+    unless (eval { require Moose; 1 }) {
+        skip 'This test requires Moose', 1;
+        exit 0;
+    }
+
+    {
+        local $SIG{__WARN__} = sub {};
+        eval <<'EOF';
+    package FooBar;
+    use Moose;
+
+    has 'name' => ( is => 'ro' );
+
+    sub DESTROY { shift->name }
+
+    __PACKAGE__->meta->make_immutable;
+EOF
+    }
+
+    my $f = FooBar->new( name => 'SUSAN' );
+
+    is( $f->DESTROY, 'SUSAN',
+        'Class::MOP::Class should not override an existing DESTROY method' );
+}

Modified: branches/upstream/libclass-mop-perl/current/xt/author/pod_spell.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/xt/author/pod_spell.t?rev=38172&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/xt/author/pod_spell.t (original)
+++ branches/upstream/libclass-mop-perl/current/xt/author/pod_spell.t Tue Jun 16 17:27:01 2009
@@ -29,6 +29,7 @@
 Goulah
 gphat
 groditi
+Hardison
 jrockway
 Kinyon
 Kinyon's




More information about the Pkg-perl-cvs-commits mailing list