r20839 - in /branches/upstream/libmoose-perl/current: ./ lib/ lib/Moose/Meta/ lib/Moose/Meta/Method/ t/000_recipes/ t/030_roles/

dmn at users.alioth.debian.org dmn at users.alioth.debian.org
Sat Jun 7 19:25:01 UTC 2008


Author: dmn
Date: Sat Jun  7 19:25:00 2008
New Revision: 20839

URL: http://svn.debian.org/wsvn/?sc=1&rev=20839
Log:
[svn-upgrade] Integrating new upstream version, libmoose-perl (0.48)

Modified:
    branches/upstream/libmoose-perl/current/Changes
    branches/upstream/libmoose-perl/current/META.yml
    branches/upstream/libmoose-perl/current/Makefile.PL
    branches/upstream/libmoose-perl/current/README
    branches/upstream/libmoose-perl/current/lib/Moose.pm
    branches/upstream/libmoose-perl/current/lib/Moose/Meta/Class.pm
    branches/upstream/libmoose-perl/current/lib/Moose/Meta/Method/Constructor.pm
    branches/upstream/libmoose-perl/current/lib/Moose/Meta/Method/Destructor.pm
    branches/upstream/libmoose-perl/current/lib/Moose/Meta/Role.pm
    branches/upstream/libmoose-perl/current/lib/oose.pm
    branches/upstream/libmoose-perl/current/t/000_recipes/001_point.t
    branches/upstream/libmoose-perl/current/t/030_roles/026_role_composition_method_mods.t

Modified: branches/upstream/libmoose-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libmoose-perl/current/Changes?rev=20839&op=diff
==============================================================================
--- branches/upstream/libmoose-perl/current/Changes (original)
+++ branches/upstream/libmoose-perl/current/Changes Sat Jun  7 19:25:00 2008
@@ -1,4 +1,42 @@
 Revision history for Perl extension Moose
+
+0.48 Thurs. May 29, 2008
+    (early morning release engineering)--
+
+    - fixing the version in Moose::Meta::Method::Destructor
+      which was causing the indexer to choke
+
+0.47 Thurs. May 29, 2008
+    (late night release engineering)--
+
+    - fixing the version is META.yml, no functional 
+      changes in this release
+
+0.46 Wed. May 28, 2008
+    !! This version now approx. 20-25% !!
+    !! faster with new Class::MOP 0.57 !!
+
+    * Moose::Meta::Class
+      - some optimizations of the &initialize method
+        since it is called so often by &meta    
+        
+    * Moose::Meta::Class
+      Moose::Meta::Role
+      - now use the get_all_package_symbols from the 
+        updated Class::MOP, test suite is now 10 seconds 
+        faster
+    
+    * Moose::Meta::Method::Destructor
+      - is_needed can now also be called as a class 
+        method for immutablization to check if the 
+        destructor object even needs to be created 
+        at all
+    
+    * Moose::Meta::Method::Destructor
+      Moose::Meta::Method::Constructor
+      - added more descriptive error message to help 
+        keep people from wasting time tracking an error
+        that is easily fixed by upgrading.
 
 0.45 Saturday, May 24, 2008
     * Moose

Modified: branches/upstream/libmoose-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/libmoose-perl/current/META.yml?rev=20839&op=diff
==============================================================================
--- branches/upstream/libmoose-perl/current/META.yml (original)
+++ branches/upstream/libmoose-perl/current/META.yml Sat Jun  7 19:25:00 2008
@@ -1,27 +1,27 @@
---- 
-abstract: A postmodern object system for Perl 5
-author: 
-  - Stevan Little <stevan at iinteractive.com>
-build_requires: 
+---
+abstract: 'A postmodern object system for Perl 5'
+author:
+  - 'Stevan Little <stevan at iinteractive.com>'
+build_requires:
   Test::Exception: 0.21
   Test::LongString: 0
   Test::More: 0.62
 distribution_type: module
-generated_by: Module::Install version 0.68
+generated_by: 'Module::Install version 0.73'
 license: perl
-meta-spec: 
+meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.3.html
   version: 1.3
 name: Moose
-no_index: 
-  directory: 
+no_index:
+  directory:
     - inc
     - t
-requires: 
+requires:
   Carp: 0
-  Class::MOP: 0.56
+  Class::MOP: 0.57
   Filter::Simple: 0
   Scalar::Util: 1.18
   Sub::Exporter: 0.972
-tests: t/*.t t/000_recipes/*.t t/010_basics/*.t t/020_attributes/*.t t/030_roles/*.t t/040_type_constraints/*.t t/050_metaclasses/*.t t/060_compat/*.t t/100_bugs/*.t t/200_examples/*.t t/300_immutable/*.t t/400_moose_util/*.t t/500_test_moose/*.t
-version: 0.45
+tests: 't/*.t t/000_recipes/*.t t/010_basics/*.t t/020_attributes/*.t t/030_roles/*.t t/040_type_constraints/*.t t/050_metaclasses/*.t t/060_compat/*.t t/100_bugs/*.t t/200_examples/*.t t/300_immutable/*.t t/400_moose_util/*.t t/500_test_moose/*.t'
+version: 0.48

Modified: branches/upstream/libmoose-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/branches/upstream/libmoose-perl/current/Makefile.PL?rev=20839&op=diff
==============================================================================
--- branches/upstream/libmoose-perl/current/Makefile.PL (original)
+++ branches/upstream/libmoose-perl/current/Makefile.PL Sat Jun  7 19:25:00 2008
@@ -12,7 +12,7 @@
 # prereqs
 requires 'Scalar::Util' => $win32 ? '1.17' : '1.18';
 requires 'Carp';
-requires 'Class::MOP'    => '0.56';
+requires 'Class::MOP'    => '0.57';
 requires 'Sub::Exporter' => '0.972';
 
 # only used by oose.pm, not Moose.pm :P

Modified: branches/upstream/libmoose-perl/current/README
URL: http://svn.debian.org/wsvn/branches/upstream/libmoose-perl/current/README?rev=20839&op=diff
==============================================================================
--- branches/upstream/libmoose-perl/current/README (original)
+++ branches/upstream/libmoose-perl/current/README Sat Jun  7 19:25:00 2008
@@ -1,4 +1,4 @@
-Moose version 0.44
+Moose version 0.48
 ===========================
 
 See the individual module documentation for more information
@@ -20,7 +20,6 @@
 	Scalar::Util
 	Carp
 	Sub::Exporter
-	B
 
 COPYRIGHT AND LICENCE
 

Modified: branches/upstream/libmoose-perl/current/lib/Moose.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libmoose-perl/current/lib/Moose.pm?rev=20839&op=diff
==============================================================================
--- branches/upstream/libmoose-perl/current/lib/Moose.pm (original)
+++ branches/upstream/libmoose-perl/current/lib/Moose.pm Sat Jun  7 19:25:00 2008
@@ -4,7 +4,7 @@
 use strict;
 use warnings;
 
-our $VERSION   = '0.45';
+our $VERSION   = '0.48';
 our $AUTHORITY = 'cpan:STEVAN';
 
 use Scalar::Util 'blessed', 'reftype';
@@ -12,7 +12,7 @@
 
 use Sub::Exporter;
 
-use Class::MOP 0.56;
+use Class::MOP;
 
 use Moose::Meta::Class;
 use Moose::Meta::TypeConstraint;

Modified: branches/upstream/libmoose-perl/current/lib/Moose/Meta/Class.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libmoose-perl/current/lib/Moose/Meta/Class.pm?rev=20839&op=diff
==============================================================================
--- branches/upstream/libmoose-perl/current/lib/Moose/Meta/Class.pm (original)
+++ branches/upstream/libmoose-perl/current/lib/Moose/Meta/Class.pm Sat Jun  7 19:25:00 2008
@@ -4,12 +4,12 @@
 use strict;
 use warnings;
 
-use Class::MOP 0.56;
+use Class::MOP;
 
 use Carp         'confess';
 use Scalar::Util 'weaken', 'blessed', 'reftype';
 
-our $VERSION   = '0.22';
+our $VERSION   = '0.23';
 our $AUTHORITY = 'cpan:STEVAN';
 
 use Moose::Meta::Method::Overriden;
@@ -25,11 +25,13 @@
 sub initialize {
     my $class = shift;
     my $pkg   = shift;
-    $class->SUPER::initialize($pkg,
-        'attribute_metaclass' => 'Moose::Meta::Attribute',
-        'method_metaclass'    => 'Moose::Meta::Method',
-        'instance_metaclass'  => 'Moose::Meta::Instance',
-        @_);
+    return Class::MOP::get_metaclass_by_name($pkg) 
+        || $class->SUPER::initialize($pkg,
+                'attribute_metaclass' => 'Moose::Meta::Attribute',
+                'method_metaclass'    => 'Moose::Meta::Method',
+                'instance_metaclass'  => 'Moose::Meta::Instance',
+                @_
+            );    
 }
 
 sub create {
@@ -177,9 +179,10 @@
     my $class_name       = $self->name;
     my $method_metaclass = $self->method_metaclass;
 
-    foreach my $symbol ($self->list_all_package_symbols('CODE')) {
-
-        my $code = $self->get_package_symbol('&' . $symbol);
+    my %all_code = $self->get_all_package_symbols('CODE');
+
+    foreach my $symbol (keys %all_code) {
+        my $code = $all_code{$symbol};
 
         next if exists  $map->{$symbol} &&
                 defined $map->{$symbol} &&

Modified: branches/upstream/libmoose-perl/current/lib/Moose/Meta/Method/Constructor.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libmoose-perl/current/lib/Moose/Meta/Method/Constructor.pm?rev=20839&op=diff
==============================================================================
--- branches/upstream/libmoose-perl/current/lib/Moose/Meta/Method/Constructor.pm (original)
+++ branches/upstream/libmoose-perl/current/lib/Moose/Meta/Method/Constructor.pm Sat Jun  7 19:25:00 2008
@@ -7,7 +7,7 @@
 use Carp         'confess';
 use Scalar::Util 'blessed', 'weaken', 'looks_like_number';
 
-our $VERSION   = '0.10';
+our $VERSION   = '0.11';
 our $AUTHORITY = 'cpan:STEVAN';
 
 use base 'Moose::Meta::Method',
@@ -21,7 +21,7 @@
         || confess "You must pass a hash of options";
 
     ($options{package_name} && $options{name})
-        || confess "You must supply the package_name and name parameters";
+        || confess "You must supply the package_name and name parameters $Class::MOP::Method::UPGRADE_ERROR_TEXT";
 
     my $self = bless {
         # from our superclass

Modified: branches/upstream/libmoose-perl/current/lib/Moose/Meta/Method/Destructor.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libmoose-perl/current/lib/Moose/Meta/Method/Destructor.pm?rev=20839&op=diff
==============================================================================
--- branches/upstream/libmoose-perl/current/lib/Moose/Meta/Method/Destructor.pm (original)
+++ branches/upstream/libmoose-perl/current/lib/Moose/Meta/Method/Destructor.pm Sat Jun  7 19:25:00 2008
@@ -7,7 +7,7 @@
 use Carp         'confess';
 use Scalar::Util 'blessed', 'weaken';
 
-our $VERSION   = '0.03';
+our $VERSION   = '0.04';
 our $AUTHORITY = 'cpan:STEVAN';
 
 use base 'Moose::Meta::Method',
@@ -21,7 +21,7 @@
         || confess "You must pass a hash of options";    
         
     ($options{package_name} && $options{name})
-        || confess "You must supply the package_name and name parameters";        
+        || confess "You must supply the package_name and name parameters $Class::MOP::Method::UPGRADE_ERROR_TEXT";        
     
     my $self = bless {
         # from our superclass
@@ -50,7 +50,17 @@
 
 ## method
 
-sub is_needed { defined $_[0]->{'&!body'} ? 1 : 0 }
+sub is_needed { 
+    my $self = shift;
+    # if called as a class method
+    # then must pass in a class name
+    unless (blessed $self) {
+        (blessed $_[0] && $_[0]->isa('Class::MOP::Class')) 
+            || confess "When calling is_needed as a class method you must pass a class name";
+        return $_[0]->meta->can('DEMOLISH');
+    }
+    defined $self->{'&!body'} ? 1 : 0 
+}
 
 sub initialize_body {
     my $self = shift;
@@ -61,10 +71,15 @@
     # of the possible use cases (even if it 
     # requires some adaption on the part of 
     # the author, after all, nothing is free)
+    
+    my @DEMOLISH_methods = $self->associated_metaclass->find_all_methods_by_name('DEMOLISH');
+    
+    return unless @DEMOLISH_methods;
+    
     my $source = 'sub {';
 
     my @DEMOLISH_calls;
-    foreach my $method ($self->associated_metaclass->find_all_methods_by_name('DEMOLISH')) {
+    foreach my $method (@DEMOLISH_methods) {
         push @DEMOLISH_calls => '$_[0]->' . $method->{class} . '::DEMOLISH()';    
     }
     

Modified: branches/upstream/libmoose-perl/current/lib/Moose/Meta/Role.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libmoose-perl/current/lib/Moose/Meta/Role.pm?rev=20839&op=diff
==============================================================================
--- branches/upstream/libmoose-perl/current/lib/Moose/Meta/Role.pm (original)
+++ branches/upstream/libmoose-perl/current/lib/Moose/Meta/Role.pm Sat Jun  7 19:25:00 2008
@@ -8,7 +8,7 @@
 use Carp         'confess';
 use Scalar::Util 'blessed', 'reftype';
 
-our $VERSION   = '0.13';
+our $VERSION   = '0.14';
 our $AUTHORITY = 'cpan:STEVAN';
 
 use Moose::Meta::Class;
@@ -290,9 +290,10 @@
     my $role_name        = $self->name;
     my $method_metaclass = $self->method_metaclass;
 
-    foreach my $symbol ($self->list_all_package_symbols('CODE')) {
-
-        my $code = $self->get_package_symbol('&' . $symbol);
+    my %all_code = $self->get_all_package_symbols('CODE');
+
+    foreach my $symbol (keys %all_code) {
+        my $code = $all_code{$symbol};
 
         my ($pkg, $name) = Class::MOP::get_code_info($code);
 

Modified: branches/upstream/libmoose-perl/current/lib/oose.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libmoose-perl/current/lib/oose.pm?rev=20839&op=diff
==============================================================================
--- branches/upstream/libmoose-perl/current/lib/oose.pm (original)
+++ branches/upstream/libmoose-perl/current/lib/oose.pm Sat Jun  7 19:25:00 2008
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Class::MOP 0.56;
+use Class::MOP;
 
 our $VERSION   = '0.04';
 our $AUTHORITY = 'cpan:STEVAN';

Modified: branches/upstream/libmoose-perl/current/t/000_recipes/001_point.t
URL: http://svn.debian.org/wsvn/branches/upstream/libmoose-perl/current/t/000_recipes/001_point.t?rev=20839&op=diff
==============================================================================
--- branches/upstream/libmoose-perl/current/t/000_recipes/001_point.t (original)
+++ branches/upstream/libmoose-perl/current/t/000_recipes/001_point.t Sat Jun  7 19:25:00 2008
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 60;
+use Test::More tests => 58;
 use Test::Exception;
 
 BEGIN {
@@ -128,7 +128,7 @@
 	[ 'Moose::Object' ],
 	'... Point got the automagic base class');
 
-my @Point_methods = qw(meta new x y clear DESTROY);
+my @Point_methods = qw(meta new x y clear);
 my @Point_attrs   = ('x', 'y');
 
 is_deeply(
@@ -160,7 +160,7 @@
 	[ 'Point' ],
 	'... Point3D gets the parent given to it');
 
-my @Point3D_methods = qw(new meta clear DESTROY);
+my @Point3D_methods = qw(new meta clear);
 my @Point3D_attrs   = ('z');
 
 is_deeply(

Modified: branches/upstream/libmoose-perl/current/t/030_roles/026_role_composition_method_mods.t
URL: http://svn.debian.org/wsvn/branches/upstream/libmoose-perl/current/t/030_roles/026_role_composition_method_mods.t?rev=20839&op=diff
==============================================================================
--- branches/upstream/libmoose-perl/current/t/030_roles/026_role_composition_method_mods.t (original)
+++ branches/upstream/libmoose-perl/current/t/030_roles/026_role_composition_method_mods.t Sat Jun  7 19:25:00 2008
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 9;
+use Test::More tests => 10;
 use Test::Exception;
 
 BEGIN {
@@ -15,17 +15,42 @@
 {
     package Role::Foo;
     use Moose::Role;
-    
+
     before foo => sub { 'Role::Foo::foo' };
     around foo => sub { 'Role::Foo::foo' };    
     after  foo => sub { 'Role::Foo::foo' };        
-    
+    around baz => sub { [ 'Role::Foo', @{shift->(@_)} ] };
+
     package Role::Bar;
     use Moose::Role;
 
     before bar => sub { 'Role::Bar::bar' };
     around bar => sub { 'Role::Bar::bar' };    
     after  bar => sub { 'Role::Bar::bar' };    
+
+    package Role::Baz;
+    use Moose::Role;
+
+    with 'Role::Foo';
+    around baz => sub { [ 'Role::Baz', @{shift->(@_)} ] };
+
+}
+
+{
+  package Class::FooBar;
+  use Moose;
+
+  with 'Role::Baz';
+  sub foo { 'placeholder' }
+  sub baz { ['Class::FooBar'] }
+}
+
+#test modifier call order
+{
+    is_deeply(
+        Class::FooBar->baz,
+        ['Role::Baz','Role::Foo','Class::FooBar']
+    );
 }
 
 # test simple overrides
@@ -39,26 +64,26 @@
     isa_ok($c, 'Moose::Meta::Role::Composite');
 
     is($c->name, 'Role::Foo|Role::Bar', '... got the composite role name');    
-    
+
     lives_ok {
         Moose::Meta::Role::Application::RoleSummation->new->apply($c);
     } '... this succeeds as expected';    
-    
+
     is_deeply(
         [ sort $c->get_method_modifier_list('before') ],
         [ 'bar', 'foo' ],
         '... got the right list of methods'
     );
-    
+
     is_deeply(
         [ sort $c->get_method_modifier_list('after') ],
         [ 'bar', 'foo' ],
         '... got the right list of methods'
     );    
-    
+
     is_deeply(
         [ sort $c->get_method_modifier_list('around') ],
-        [ 'bar', 'foo' ],
+        [ 'bar', 'baz', 'foo' ],
         '... got the right list of methods'
     );    
-}
+}




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