r58927 - 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/Method/ lib/Class/MOP/Mixin/ t/

ansgar-guest at users.alioth.debian.org ansgar-guest at users.alioth.debian.org
Sun Jun 6 04:45:49 UTC 2010


Author: ansgar-guest
Date: Sun Jun  6 04:45:27 2010
New Revision: 58927

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

Modified:
    branches/upstream/libclass-mop-perl/current/Changes
    branches/upstream/libclass-mop-perl/current/META.yml
    branches/upstream/libclass-mop-perl/current/Makefile.PL
    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/Trait.pm
    branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Deprecated.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/Mixin.pm
    branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Mixin/AttributeCore.pm
    branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Mixin/HasAttributes.pm
    branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Mixin/HasMethods.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/010_self_introspection.t
    branches/upstream/libclass-mop-perl/current/t/012_package_variables.t
    branches/upstream/libclass-mop-perl/current/t/080_meta_package.t
    branches/upstream/libclass-mop-perl/current/t/081_meta_package_extension.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=58927&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/Changes (original)
+++ branches/upstream/libclass-mop-perl/current/Changes Sun Jun  6 04:45:27 2010
@@ -1,6 +1,12 @@
 Revision history for Perl extension Class-MOP.
 
-1.02 Thu, May, 2010
+1.03 Sat, Jun 5, 2010
+
+  [ENHANCEMENTS]
+
+  * Make CMOP::Package a thin wrapper around Package::Stash (doy).
+
+1.02 Thu, May 20, 2010
 
   [API CHANGES]
 

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=58927&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/META.yml (original)
+++ branches/upstream/libclass-mop-perl/current/META.yml Sun Jun  6 04:45:27 2010
@@ -10,7 +10,7 @@
 configure_requires:
   ExtUtils::MakeMaker: 6.42
 distribution_type: module
-generated_by: 'Module::Install version 0.97'
+generated_by: 'Module::Install version 0.99'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -28,6 +28,7 @@
   Devel::GlobalDestruction: 0
   List::MoreUtils: 0.12
   MRO::Compat: 0.05
+  Package::Stash: 0
   Scalar::Util: 1.18
   Sub::Name: 0.04
   Task::Weaken: 0
@@ -36,4 +37,4 @@
 resources:
   license: http://dev.perl.org/licenses/
   repository: git://git.moose.perl.org/Class-MOP.git
-version: 1.02
+version: 1.03

Modified: branches/upstream/libclass-mop-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/Makefile.PL?rev=58927&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/Makefile.PL (original)
+++ branches/upstream/libclass-mop-perl/current/Makefile.PL Sun Jun  6 04:45:27 2010
@@ -22,6 +22,7 @@
 requires 'Devel::GlobalDestruction';
 requires 'List::MoreUtils' => '0.12';
 requires 'MRO::Compat'  => '0.05';
+requires 'Package::Stash';
 requires 'Scalar::Util' => '1.18';
 requires 'Sub::Name'    => '0.04';
 requires 'Try::Tiny'    => '0.02';

Modified: branches/upstream/libclass-mop-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/README?rev=58927&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/README (original)
+++ branches/upstream/libclass-mop-perl/current/README Sun Jun  6 04:45:27 2010
@@ -1,4 +1,4 @@
-Class::MOP version 1.02
+Class::MOP version 1.03
 ===========================
 
 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=58927&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/inc/Module/Install.pm (original)
+++ branches/upstream/libclass-mop-perl/current/inc/Module/Install.pm Sun Jun  6 04:45:27 2010
@@ -22,7 +22,6 @@
 use Cwd        ();
 use File::Find ();
 use File::Path ();
-use FindBin;
 
 use vars qw{$VERSION $MAIN};
 BEGIN {
@@ -32,7 +31,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.97';
+	$VERSION = '0.99';
 
 	# Storage for the pseudo-singleton
 	$MAIN    = undef;
@@ -231,7 +230,8 @@
 sub new {
 	my ($class, %args) = @_;
 
-	FindBin->again;
+    delete $INC{'FindBin.pm'};
+    require FindBin;
 
 	# ignore the prefix on extension modules built from top level.
 	my $base_path = Cwd::abs_path($FindBin::Bin);

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=58927&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 Sun Jun  6 04:45:27 2010
@@ -4,7 +4,7 @@
 use strict 'vars';
 use vars qw{$VERSION};
 BEGIN {
-	$VERSION = '0.97';
+	$VERSION = '0.99';
 }
 
 # Suspend handler for "redefined" warnings

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=58927&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 Sun Jun  6 04:45:27 2010
@@ -9,7 +9,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.97';
+	$VERSION = '0.99';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }

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=58927&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 Sun Jun  6 04:45:27 2010
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.97';
+	$VERSION = '0.99';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }

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=58927&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 Sun Jun  6 04:45:27 2010
@@ -4,10 +4,11 @@
 use strict 'vars';
 use ExtUtils::MakeMaker   ();
 use Module::Install::Base ();
+use Fcntl qw/:flock :seek/;
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.97';
+	$VERSION = '0.99';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -364,9 +365,9 @@
 		. ($self->postamble || '');
 
 	local *MAKEFILE;
-	open MAKEFILE, "< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
+	open MAKEFILE, "+< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
+	eval { flock MAKEFILE, LOCK_EX };
 	my $makefile = do { local $/; <MAKEFILE> };
-	close MAKEFILE or die $!;
 
 	$makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /;
 	$makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g;
@@ -386,7 +387,8 @@
 	# XXX - This is currently unused; not sure if it breaks other MM-users
 	# $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg;
 
-	open  MAKEFILE, "> $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
+	seek MAKEFILE, 0, SEEK_SET;
+	truncate MAKEFILE, 0;
 	print MAKEFILE  "$preamble$makefile$postamble" or die $!;
 	close MAKEFILE  or die $!;
 
@@ -410,4 +412,4 @@
 
 __END__
 
-#line 539
+#line 541

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=58927&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 Sun Jun  6 04:45:27 2010
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.97';
+	$VERSION = '0.99';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -616,8 +616,15 @@
 	return $v;
 }
 
-
-
+sub add_metadata {
+    my $self = shift;
+    my %hash = @_;
+    for my $key (keys %hash) {
+        warn "add_metadata: $key is not prefixed with 'x_'.\n" .
+             "Use appopriate function to add non-private metadata.\n" unless $key =~ /^x_/;
+        $self->{values}->{$key} = $hash{$key};
+    }
+}
 
 
 ######################################################################

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=58927&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 Sun Jun  6 04:45:27 2010
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.97';
+	$VERSION = '0.99';
 	@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=58927&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 Sun Jun  6 04:45:27 2010
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.97';;
+	$VERSION = '0.99';
 	@ISA     = qw{Module::Install::Base};
 	$ISCORE  = 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=58927&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/lib/Class/MOP.pm (original)
+++ branches/upstream/libclass-mop-perl/current/lib/Class/MOP.pm Sun Jun  6 04:45:27 2010
@@ -29,7 +29,7 @@
     *check_package_cache_flag = \&mro::get_pkg_gen;
 }
 
-our $VERSION   = '1.02';
+our $VERSION   = '1.03';
 our $XS_VERSION = $VERSION;
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';

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=58927&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 Sun Jun  6 04:45:27 2010
@@ -10,7 +10,7 @@
 use Scalar::Util 'blessed', 'weaken';
 use Try::Tiny;
 
-our $VERSION   = '1.02';
+our $VERSION   = '1.03';
 $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=58927&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 Sun Jun  6 04:45:27 2010
@@ -16,7 +16,7 @@
 use Try::Tiny;
 use List::MoreUtils 'all';
 
-our $VERSION   = '1.02';
+our $VERSION   = '1.03';
 $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=58927&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 Sun Jun  6 04:45:27 2010
@@ -8,7 +8,7 @@
 use Carp 'confess';
 use Scalar::Util 'blessed', 'weaken';
 
-our $VERSION   = '1.02';
+our $VERSION   = '1.03';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Deprecated.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Deprecated.pm?rev=58927&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Deprecated.pm (original)
+++ branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Deprecated.pm Sun Jun  6 04:45:27 2010
@@ -6,7 +6,7 @@
 use Carp qw( cluck );
 use Scalar::Util qw( blessed );
 
-our $VERSION = '1.02';
+our $VERSION = '1.03';
 $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=58927&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 Sun Jun  6 04:45:27 2010
@@ -6,7 +6,7 @@
 
 use Scalar::Util 'weaken', 'blessed';
 
-our $VERSION   = '1.02';
+our $VERSION   = '1.03';
 $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=58927&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 Sun Jun  6 04:45:27 2010
@@ -7,7 +7,7 @@
 use Carp         'confess';
 use Scalar::Util 'weaken', 'reftype', 'blessed';
 
-our $VERSION   = '1.02';
+our $VERSION   = '1.03';
 $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=58927&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 Sun Jun  6 04:45:27 2010
@@ -7,7 +7,7 @@
 use Carp         'confess';
 use Scalar::Util 'blessed', 'weaken';
 
-our $VERSION   = '1.02';
+our $VERSION   = '1.03';
 $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=58927&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 Sun Jun  6 04:45:27 2010
@@ -7,7 +7,7 @@
 use Carp         'confess';
 use Scalar::Util 'blessed', 'weaken', 'looks_like_number';
 
-our $VERSION   = '1.02';
+our $VERSION   = '1.03';
 $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=58927&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 Sun Jun  6 04:45:27 2010
@@ -6,7 +6,7 @@
 
 use Carp 'confess';
 
-our $VERSION   = '1.02';
+our $VERSION   = '1.03';
 $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=58927&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 Sun Jun  6 04:45:27 2010
@@ -6,7 +6,7 @@
 use Carp         'confess';
 use Scalar::Util 'blessed', 'weaken', 'looks_like_number', 'refaddr';
 
-our $VERSION   = '1.02';
+our $VERSION   = '1.03';
 $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=58927&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 Sun Jun  6 04:45:27 2010
@@ -7,7 +7,7 @@
 use Carp         'confess';
 use Scalar::Util 'blessed';
 
-our $VERSION   = '1.02';
+our $VERSION   = '1.03';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Mixin.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Mixin.pm?rev=58927&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Mixin.pm (original)
+++ branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Mixin.pm Sun Jun  6 04:45:27 2010
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-our $VERSION   = '1.02';
+our $VERSION   = '1.03';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Mixin/AttributeCore.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Mixin/AttributeCore.pm?rev=58927&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Mixin/AttributeCore.pm (original)
+++ branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Mixin/AttributeCore.pm Sun Jun  6 04:45:27 2010
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-our $VERSION   = '1.02';
+our $VERSION   = '1.03';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Mixin/HasAttributes.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Mixin/HasAttributes.pm?rev=58927&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Mixin/HasAttributes.pm (original)
+++ branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Mixin/HasAttributes.pm Sun Jun  6 04:45:27 2010
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-our $VERSION   = '1.02';
+our $VERSION   = '1.03';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Mixin/HasMethods.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Mixin/HasMethods.pm?rev=58927&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Mixin/HasMethods.pm (original)
+++ branches/upstream/libclass-mop-perl/current/lib/Class/MOP/Mixin/HasMethods.pm Sun Jun  6 04:45:27 2010
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-our $VERSION   = '1.02';
+our $VERSION   = '1.03';
 $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=58927&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 Sun Jun  6 04:45:27 2010
@@ -7,7 +7,7 @@
 use Carp         'confess';
 use Scalar::Util 'blessed';
 
-our $VERSION   = '1.02';
+our $VERSION   = '1.03';
 $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=58927&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 Sun Jun  6 04:45:27 2010
@@ -6,7 +6,7 @@
 
 use Scalar::Util 'blessed';
 
-our $VERSION   = '1.02';
+our $VERSION   = '1.03';
 $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=58927&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 Sun Jun  6 04:45:27 2010
@@ -6,8 +6,9 @@
 
 use Scalar::Util 'blessed', 'reftype';
 use Carp         'confess';
-
-our $VERSION   = '1.02';
+use Package::Stash;
+
+our $VERSION   = '1.03';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 
@@ -89,44 +90,11 @@
 # all these attribute readers will be bootstrapped 
 # away in the Class::MOP bootstrap section
 
-sub namespace { 
-    # NOTE:
-    # because of issues with the Perl API 
-    # to the typeglob in some versions, we 
-    # need to just always grab a new 
-    # reference to the hash here. Ideally 
-    # we could just store a ref and it would
-    # Just Work, but oh well :\    
-    no strict 'refs';    
-    \%{$_[0]->{'package'} . '::'} 
-}
-
-# utility methods
-
-{
-    my %SIGIL_MAP = (
-        '$' => 'SCALAR',
-        '@' => 'ARRAY',
-        '%' => 'HASH',
-        '&' => 'CODE',
-    );
-    
-    sub _deconstruct_variable_name {
-        my ($self, $variable) = @_;
-
-        (defined $variable)
-            || confess "You must pass a variable name";    
-
-        my $sigil = substr($variable, 0, 1, '');
-
-        (defined $sigil)
-            || confess "The variable name must include a sigil";    
-
-        (exists $SIGIL_MAP{$sigil})
-            || confess "I do not recognize that sigil '$sigil'";    
-        
-        return ($variable, $sigil, $SIGIL_MAP{$sigil});
-    }
+sub _package_stash {
+    $_[0]->{_package_stash} ||= Package::Stash->new($_[0]->name)
+}
+sub namespace {
+    $_[0]->_package_stash->namespace
 }
 
 # Class attributes
@@ -134,155 +102,35 @@
 # ... these functions have to touch the symbol table itself,.. yuk
 
 sub add_package_symbol {
-    my ($self, $variable, $initial_value) = @_;
-
-    my ($name, $sigil, $type) = ref $variable eq 'HASH'
-        ? @{$variable}{qw[name sigil type]}
-        : $self->_deconstruct_variable_name($variable);
-
-    my $pkg = $self->{'package'};
-
-    no strict 'refs';
-    no warnings 'redefine', 'misc', 'prototype';
-    *{$pkg . '::' . $name} = ref $initial_value ? $initial_value : \$initial_value;
+    my $self = shift;
+    $self->_package_stash->add_package_symbol(@_);
 }
 
 sub remove_package_glob {
-    my ($self, $name) = @_;
-    no strict 'refs';        
-    delete ${$self->name . '::'}{$name};     
+    my $self = shift;
+    $self->_package_stash->remove_package_glob(@_);
 }
 
 # ... these functions deal with stuff on the namespace level
 
 sub has_package_symbol {
-    my ( $self, $variable ) = @_;
-
-    my ( $name, $sigil, $type )
-        = ref $variable eq 'HASH'
-        ? @{$variable}{qw[name sigil type]}
-        : $self->_deconstruct_variable_name($variable);
-
-    my $namespace = $self->namespace;
-
-    return 0 unless exists $namespace->{$name};
-
-    my $entry_ref = \$namespace->{$name};
-    if ( reftype($entry_ref) eq 'GLOB' ) {
-        if ( $type eq 'SCALAR' ) {
-            return defined( ${ *{$entry_ref}{SCALAR} } );
-        }
-        else {
-            return defined( *{$entry_ref}{$type} );
-        }
-    }
-    else {
-
-        # a symbol table entry can be -1 (stub), string (stub with prototype),
-        # or reference (constant)
-        return $type eq 'CODE';
-    }
+    my $self = shift;
+    $self->_package_stash->has_package_symbol(@_);
 }
 
 sub get_package_symbol {
-    my ($self, $variable) = @_;    
-
-    my ($name, $sigil, $type) = ref $variable eq 'HASH'
-        ? @{$variable}{qw[name sigil type]}
-        : $self->_deconstruct_variable_name($variable);
-
-    my $namespace = $self->namespace;
-
-    # FIXME
-    $self->add_package_symbol($variable)
-        unless exists $namespace->{$name};
-
-    my $entry_ref = \$namespace->{$name};
-
-    if ( ref($entry_ref) eq 'GLOB' ) {
-        return *{$entry_ref}{$type};
-    }
-    else {
-        if ( $type eq 'CODE' ) {
-            no strict 'refs';
-            return \&{ $self->name . '::' . $name };
-        }
-        else {
-            return undef;
-        }
-    }
+    my $self = shift;
+    $self->_package_stash->get_package_symbol(@_);
 }
 
 sub remove_package_symbol {
-    my ($self, $variable) = @_;
-
-    my ($name, $sigil, $type) = ref $variable eq 'HASH'
-        ? @{$variable}{qw[name sigil type]}
-        : $self->_deconstruct_variable_name($variable);
-
-    # FIXME:
-    # no doubt this is grossly inefficient and 
-    # could be done much easier and faster in XS
-
-    my ($scalar_desc, $array_desc, $hash_desc, $code_desc) = (
-        { sigil => '$', type => 'SCALAR', name => $name },
-        { sigil => '@', type => 'ARRAY',  name => $name },
-        { sigil => '%', type => 'HASH',   name => $name },
-        { sigil => '&', type => 'CODE',   name => $name },
-    );
-
-    my ($scalar, $array, $hash, $code);
-    if ($type eq 'SCALAR') {
-        $array  = $self->get_package_symbol($array_desc)  if $self->has_package_symbol($array_desc);
-        $hash   = $self->get_package_symbol($hash_desc)   if $self->has_package_symbol($hash_desc);     
-        $code   = $self->get_package_symbol($code_desc)   if $self->has_package_symbol($code_desc);     
-    }
-    elsif ($type eq 'ARRAY') {
-        $scalar = $self->get_package_symbol($scalar_desc) if $self->has_package_symbol($scalar_desc);
-        $hash   = $self->get_package_symbol($hash_desc)   if $self->has_package_symbol($hash_desc);     
-        $code   = $self->get_package_symbol($code_desc)   if $self->has_package_symbol($code_desc);
-    }
-    elsif ($type eq 'HASH') {
-        $scalar = $self->get_package_symbol($scalar_desc) if $self->has_package_symbol($scalar_desc);
-        $array  = $self->get_package_symbol($array_desc)  if $self->has_package_symbol($array_desc);        
-        $code   = $self->get_package_symbol($code_desc)   if $self->has_package_symbol($code_desc);      
-    }
-    elsif ($type eq 'CODE') {
-        $scalar = $self->get_package_symbol($scalar_desc) if $self->has_package_symbol($scalar_desc);
-        $array  = $self->get_package_symbol($array_desc)  if $self->has_package_symbol($array_desc);        
-        $hash   = $self->get_package_symbol($hash_desc)   if $self->has_package_symbol($hash_desc);        
-    }    
-    else {
-        confess "This should never ever ever happen";
-    }
-        
-    $self->remove_package_glob($name);
-    
-    $self->add_package_symbol($scalar_desc => $scalar) if defined $scalar;      
-    $self->add_package_symbol($array_desc  => $array)  if defined $array;    
-    $self->add_package_symbol($hash_desc   => $hash)   if defined $hash;
-    $self->add_package_symbol($code_desc   => $code)   if defined $code;            
+    my $self = shift;
+    $self->_package_stash->remove_package_symbol(@_);
 }
 
 sub list_all_package_symbols {
-    my ($self, $type_filter) = @_;
-
-    my $namespace = $self->namespace;
-    return keys %{$namespace} unless defined $type_filter;
-    
-    # NOTE:
-    # or we can filter based on 
-    # type (SCALAR|ARRAY|HASH|CODE)
-    if ( $type_filter eq 'CODE' ) {
-        return grep { 
-        (ref($namespace->{$_})
-                ? (ref($namespace->{$_}) eq 'SCALAR')
-                : (ref(\$namespace->{$_}) eq 'GLOB'
-                   && defined(*{$namespace->{$_}}{CODE})));
-        } keys %{$namespace};
-    } else {
-        return grep { *{$namespace->{$_}}{$type_filter} } keys %{$namespace};
-    }
+    my $self = shift;
+    $self->_package_stash->list_all_package_symbols(@_);
 }
 
 1;

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=58927&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/lib/metaclass.pm (original)
+++ branches/upstream/libclass-mop-perl/current/lib/metaclass.pm Sun Jun  6 04:45:27 2010
@@ -7,7 +7,7 @@
 use Carp         'confess';
 use Scalar::Util 'blessed';
 
-our $VERSION   = '1.02';
+our $VERSION   = '1.03';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: branches/upstream/libclass-mop-perl/current/t/010_self_introspection.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/t/010_self_introspection.t?rev=58927&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/t/010_self_introspection.t (original)
+++ branches/upstream/libclass-mop-perl/current/t/010_self_introspection.t Sun Jun  6 04:45:27 2010
@@ -34,7 +34,7 @@
     add_package_symbol get_package_symbol has_package_symbol remove_package_symbol
     list_all_package_symbols get_all_package_symbols remove_package_glob
 
-    _deconstruct_variable_name
+    _package_stash
 
     get_method_map
 );

Modified: branches/upstream/libclass-mop-perl/current/t/012_package_variables.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/t/012_package_variables.t?rev=58927&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/t/012_package_variables.t (original)
+++ branches/upstream/libclass-mop-perl/current/t/012_package_variables.t Sun Jun  6 04:45:27 2010
@@ -227,23 +227,4 @@
     ok(defined(*{"Foo::foo"}{ARRAY}), '... the @foo slot has NOT been removed');
 }
 
-
-# check some errors
-
-dies_ok {
-    Foo->meta->add_package_symbol('bar');
-} '... no sigil for bar';
-
-dies_ok {
-    Foo->meta->remove_package_symbol('bar');
-} '... no sigil for bar';
-
-dies_ok {
-    Foo->meta->get_package_symbol('bar');
-} '... no sigil for bar';
-
-dies_ok {
-    Foo->meta->has_package_symbol('bar');
-} '... no sigil for bar';
-
 done_testing;

Modified: branches/upstream/libclass-mop-perl/current/t/080_meta_package.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/t/080_meta_package.t?rev=58927&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/t/080_meta_package.t (original)
+++ branches/upstream/libclass-mop-perl/current/t/080_meta_package.t Sun Jun  6 04:45:27 2010
@@ -276,22 +276,5 @@
         "got the right ones",
     );
 }
-# check some errors
-
-dies_ok {
-    Foo->meta->add_package_symbol('bar');
-} '... no sigil for bar';
-
-dies_ok {
-    Foo->meta->remove_package_symbol('bar');
-} '... no sigil for bar';
-
-dies_ok {
-    Foo->meta->get_package_symbol('bar');
-} '... no sigil for bar';
-
-dies_ok {
-    Foo->meta->has_package_symbol('bar');
-} '... no sigil for bar';
 
 done_testing;

Modified: branches/upstream/libclass-mop-perl/current/t/081_meta_package_extension.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-mop-perl/current/t/081_meta_package_extension.t?rev=58927&op=diff
==============================================================================
--- branches/upstream/libclass-mop-perl/current/t/081_meta_package_extension.t (original)
+++ branches/upstream/libclass-mop-perl/current/t/081_meta_package_extension.t Sun Jun  6 04:45:27 2010
@@ -7,15 +7,15 @@
 use Class::MOP;
 
 {
-    package My::Meta::Package;
-
+    package My::Package::Stash;
     use strict;
     use warnings;
 
-    use Carp 'confess';
+    use base 'Package::Stash';
+
+    use metaclass;
+
     use Symbol 'gensym';
-
-    use base 'Class::MOP::Package';
 
     __PACKAGE__->meta->add_attribute(
         'namespace' => (
@@ -23,6 +23,11 @@
             default => sub { {} }
         )
     );
+
+    sub new {
+        my $class = shift;
+        $class->meta->new_object(__INSTANCE__ => $class->SUPER::new(@_));
+    }
 
     sub add_package_symbol {
         my ($self, $variable, $initial_value) = @_;
@@ -32,6 +37,19 @@
         my $glob = gensym();
         *{$glob} = $initial_value if defined $initial_value;
         $self->namespace->{$name} = *{$glob};
+    }
+}
+
+{
+    package My::Meta::Package;
+
+    use strict;
+    use warnings;
+
+    use base 'Class::MOP::Package';
+
+    sub _package_stash {
+        $_[0]->{_package_stash} ||= My::Package::Stash->new($_[0]->name);
     }
 }
 




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