r47476 - in /trunk/libclass-mop-perl: ./ debian/ lib/ lib/Class/ lib/Class/MOP/ lib/Class/MOP/Class/Immutable/ lib/Class/MOP/Method/ t/ xs/ xt/author/

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Thu Nov 19 16:25:16 UTC 2009


Author: jawnsy-guest
Date: Thu Nov 19 16:25:11 2009
New Revision: 47476

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=47476
Log:
New upstream release

Modified:
    trunk/libclass-mop-perl/Changes
    trunk/libclass-mop-perl/META.yml
    trunk/libclass-mop-perl/Makefile.PL
    trunk/libclass-mop-perl/README
    trunk/libclass-mop-perl/debian/changelog
    trunk/libclass-mop-perl/debian/control
    trunk/libclass-mop-perl/lib/Class/MOP.pm
    trunk/libclass-mop-perl/lib/Class/MOP/Attribute.pm
    trunk/libclass-mop-perl/lib/Class/MOP/Class.pm
    trunk/libclass-mop-perl/lib/Class/MOP/Class/Immutable/Trait.pm
    trunk/libclass-mop-perl/lib/Class/MOP/Deprecated.pm
    trunk/libclass-mop-perl/lib/Class/MOP/Instance.pm
    trunk/libclass-mop-perl/lib/Class/MOP/Method.pm
    trunk/libclass-mop-perl/lib/Class/MOP/Method/Accessor.pm
    trunk/libclass-mop-perl/lib/Class/MOP/Method/Constructor.pm
    trunk/libclass-mop-perl/lib/Class/MOP/Method/Generated.pm
    trunk/libclass-mop-perl/lib/Class/MOP/Method/Inlined.pm
    trunk/libclass-mop-perl/lib/Class/MOP/Method/Wrapped.pm
    trunk/libclass-mop-perl/lib/Class/MOP/Module.pm
    trunk/libclass-mop-perl/lib/Class/MOP/Object.pm
    trunk/libclass-mop-perl/lib/Class/MOP/Package.pm
    trunk/libclass-mop-perl/lib/metaclass.pm
    trunk/libclass-mop-perl/t/010_self_introspection.t
    trunk/libclass-mop-perl/t/049_metaclass_reinitialize.t
    trunk/libclass-mop-perl/t/083_load_class.t
    trunk/libclass-mop-perl/t/500_deprecated.t
    trunk/libclass-mop-perl/xs/MOP.xs
    trunk/libclass-mop-perl/xt/author/pod_coverage.t

Modified: trunk/libclass-mop-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/Changes?rev=47476&op=diff
==============================================================================
--- trunk/libclass-mop-perl/Changes (original)
+++ trunk/libclass-mop-perl/Changes Thu Nov 19 16:25:11 2009
@@ -1,11 +1,33 @@
 Revision history for Perl extension Class-MOP.
 
+0.95 Wed, Nov 19, 2009
+    * Class::MOP
+      - Make is_class_loaded without any arguments fail loudly
+        (Florian Ragwitz).
+      - Make load_class throw more standard error messages when loading single
+        modules (nothingmuch).
+
+    * Class::MOP::Package
+      - Stop add_method from behaving differently under the debugger
+        (Florian Ragwitz).
+
+    * Class::MOP::Class
+    * Class::MOP::Package
+      - Any method which takes a method name as an argument now allows names
+        which are false (like "0"), but the name must be defined and not be an
+        empty string. (Dave Rolsky)
+
+    * Class::MOP::Class
+      - Deprecated get_attribute_map as a public method. You can use a
+        combination of get_attribute_list and get_attribute instead. (Dave
+        Rolsky)
+
 0.94 Tue, Sep 22, 2009
     * Class::MOP::Attribute
-        - Introduce set_raw_value and get_raw_value, side effect free variants
-          of {get,set}_value. These don't do anything useful in Class::MOP but
-          have different behavior that set_value and get_value for Moose
-          attributes. (nothingmuch)
+      - Introduce set_raw_value and get_raw_value, side effect free variants
+        of {get,set}_value. These don't do anything useful in Class::MOP but
+        have different behavior that set_value and get_value for Moose
+        attributes. (nothingmuch)
 
 0.93 Tue, Sep 15, 2009
     * Class::MOP
@@ -241,7 +263,7 @@
 
     * Many methods have been renamed with a leading underscore, and a
       few have been deprecated entirely. The methods with a leading
-      underscore are consider "internals only". People writing
+      underscore are considered "internals only". People writing
       subclasses or extensions to Class::MOP should feel free to
       override them, but they are not for "public" use.
 

Modified: trunk/libclass-mop-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/META.yml?rev=47476&op=diff
==============================================================================
--- trunk/libclass-mop-perl/META.yml (original)
+++ trunk/libclass-mop-perl/META.yml Thu Nov 19 16:25:11 2009
@@ -29,7 +29,8 @@
   Scalar::Util: 1.18
   Sub::Name: 0.04
   Task::Weaken: 0
+  Try::Tiny: 0.02
   perl: 5.8.1
 resources:
   license: http://dev.perl.org/licenses/
-version: 0.94
+version: 0.95

Modified: trunk/libclass-mop-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/Makefile.PL?rev=47476&op=diff
==============================================================================
--- trunk/libclass-mop-perl/Makefile.PL (original)
+++ trunk/libclass-mop-perl/Makefile.PL Thu Nov 19 16:25:11 2009
@@ -22,6 +22,7 @@
 requires 'MRO::Compat'  => '0.05';
 requires 'Scalar::Util' => '1.18';
 requires 'Sub::Name'    => '0.04';
+requires 'Try::Tiny'    => '0.02';
 requires 'Task::Weaken';
 
 test_requires 'File::Spec';

Modified: trunk/libclass-mop-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/README?rev=47476&op=diff
==============================================================================
--- trunk/libclass-mop-perl/README (original)
+++ trunk/libclass-mop-perl/README Thu Nov 19 16:25:11 2009
@@ -1,4 +1,4 @@
-Class::MOP version 0.94
+Class::MOP version 0.95
 ===========================
 
 See the individual module documentation for more information

Modified: trunk/libclass-mop-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/debian/changelog?rev=47476&op=diff
==============================================================================
--- trunk/libclass-mop-perl/debian/changelog (original)
+++ trunk/libclass-mop-perl/debian/changelog Thu Nov 19 16:25:11 2009
@@ -1,3 +1,9 @@
+libclass-mop-perl (0.95-1) UNRELEASED; urgency=low
+
+  * New upstream release
+
+ -- Jonathan Yu <jawnsy at cpan.org>  Thu, 19 Nov 2009 08:02:32 -0500
+
 libclass-mop-perl (0.94-1) unstable; urgency=low
 
   [ Jonathan Yu ]

Modified: trunk/libclass-mop-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/debian/control?rev=47476&op=diff
==============================================================================
--- trunk/libclass-mop-perl/debian/control (original)
+++ trunk/libclass-mop-perl/debian/control Thu Nov 19 16:25:11 2009
@@ -6,7 +6,7 @@
  libtest-exception-perl (>= 0.27), libtest-pod-perl, libtest-pod-coverage-perl,
  libdevel-globaldestruction-perl, libsuper-perl,
  libalgorithm-c3-perl, libmro-compat-perl, libtest-output-perl,
- libclass-c3-perl, libtest-leaktrace-perl
+ libclass-c3-perl, libtest-leaktrace-perl, libtry-tiny-perl
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
 Uploaders: Krzysztof Krzyżaniak (eloy) <eloy at debian.org>,
  Damyan Ivanov <dmn at debian.org>, Russ Allbery <rra at debian.org>,
@@ -23,7 +23,7 @@
 Architecture: any
 Depends: ${perl:Depends}, ${misc:Depends}, ${shlibs:Depends},
  libdevel-globaldestruction-perl, libsub-name-perl (>= 0.04),
- libmro-compat-perl
+ libmro-compat-perl, libtry-tiny-perl
 Suggests: libmoose-perl
 Breaks: libmoose-perl (<< 0.90)
 Description: Perl module implementing a Meta Object Protocol (MOP)

Modified: trunk/libclass-mop-perl/lib/Class/MOP.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/lib/Class/MOP.pm?rev=47476&op=diff
==============================================================================
--- trunk/libclass-mop-perl/lib/Class/MOP.pm (original)
+++ trunk/libclass-mop-perl/lib/Class/MOP.pm Thu Nov 19 16:25:11 2009
@@ -10,6 +10,7 @@
 
 use Carp          'confess';
 use Scalar::Util  'weaken', 'reftype', 'blessed';
+use Try::Tiny;
 
 use Class::MOP::Class;
 use Class::MOP::Attribute;
@@ -24,7 +25,7 @@
     *check_package_cache_flag = \&mro::get_pkg_gen;
 }
 
-our $VERSION   = '0.94';
+our $VERSION   = '0.95';
 our $XS_VERSION = $VERSION;
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
@@ -75,7 +76,7 @@
 
 sub load_first_existing_class {
     my @classes = @_
-        or return;
+      or return;
 
     foreach my $class (@classes) {
         unless ( _is_valid_class_name($class) ) {
@@ -86,49 +87,31 @@
 
     my $found;
     my %exceptions;
+
     for my $class (@classes) {
-        my $e = _try_load_one_class($class);
-
-        if ($e) {
-            my $pmfile = _class_to_pmfile($class);
-            $exceptions{$class} = $e;
-            last if $e !~ /^Can't locate \Q$pmfile\E in \@INC/;
+        my $file = _class_to_pmfile($class);
+
+        return $class if is_class_loaded($class);;
+
+        return $class if try {
+            local $SIG{__DIE__};
+            require $file;
+            return 1;
         }
-        else {
-            $found = $class;
-            last;
-        }
+        catch {
+            unless (/^Can't locate \Q$file\E in \@INC/) {
+                confess "Couldn't load class ($class) because: $_";
+            }
+
+            return;
+        };
     }
 
-    return $found if $found;
-
-    confess join(
-        "\n",
-        map {
-            sprintf(
-                "Could not load class (%s) because : %s", $_,
-                $exceptions{$_}
-                )
-            }
-        grep {
-            exists $exceptions{$_}
-            } @classes
-    );
-}
-
-sub _try_load_one_class {
-    my $class = shift;
-
-    return if is_class_loaded($class);
-
-    my $file = _class_to_pmfile($class);
-
-    return do {
-        local $@;
-        local $SIG{__DIE__};
-        eval { require($file) };
-        $@;
-    };
+    if ( @classes > 1 ) {
+        confess "Can't locate any of @classes in \@INC (\@INC contains: @INC).";
+    } else {
+        confess "Can't locate " . _class_to_pmfile($classes[0]) . " in \@INC (\@INC contains: @INC).";
+    }
 }
 
 sub load_class {
@@ -299,7 +282,7 @@
             #
             # we just alias the original method
             # rather than re-produce it here
-            'get_attribute_map' => \&Class::MOP::Class::get_attribute_map
+            '_attribute_map' => \&Class::MOP::Class::_attribute_map
         },
         default  => sub { {} }
     ))
@@ -919,7 +902,7 @@
 
 If the module cannot be loaded, an exception is thrown.
 
-For historical reasons, this function returns explicitly returns a true value.
+For historical reasons, this function explicitly returns a true value.
 
 =item B<Class::MOP::is_class_loaded($class_name)>
 

Modified: trunk/libclass-mop-perl/lib/Class/MOP/Attribute.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/lib/Class/MOP/Attribute.pm?rev=47476&op=diff
==============================================================================
--- trunk/libclass-mop-perl/lib/Class/MOP/Attribute.pm (original)
+++ trunk/libclass-mop-perl/lib/Class/MOP/Attribute.pm Thu Nov 19 16:25:11 2009
@@ -8,8 +8,9 @@
 
 use Carp         'confess';
 use Scalar::Util 'blessed', 'weaken';
-
-our $VERSION   = '0.94';
+use Try::Tiny;
+
+our $VERSION   = '0.95';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 
@@ -369,7 +370,7 @@
     else {
         my $inline_me = ($generate_as_inline_methods && $self->associated_class->instance_metaclass->is_inlinable);
         my $method;
-        eval {
+        try {
             if ( $method_ctx ) {
                 my $desc = "accessor $accessor";
                 if ( $accessor ne $self->name ) {
@@ -387,8 +388,10 @@
                 name          => $accessor,
                 definition_context => $method_ctx,
             );
+        }
+        catch {
+            confess "Could not create the '$type' method for " . $self->name . " because : $_";
         };
-        confess "Could not create the '$type' method for " . $self->name . " because : $@" if $@;
         $self->associate_method($method);
         return ($accessor, $method);
     }

Modified: trunk/libclass-mop-perl/lib/Class/MOP/Class.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/lib/Class/MOP/Class.pm?rev=47476&op=diff
==============================================================================
--- trunk/libclass-mop-perl/lib/Class/MOP/Class.pm (original)
+++ trunk/libclass-mop-perl/lib/Class/MOP/Class.pm Thu Nov 19 16:25:11 2009
@@ -13,8 +13,9 @@
 use Scalar::Util 'blessed', 'reftype', 'weaken';
 use Sub::Name    'subname';
 use Devel::GlobalDestruction 'in_global_destruction';
-
-our $VERSION   = '0.94';
+use Try::Tiny;
+
+our $VERSION   = '0.95';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 
@@ -328,7 +329,7 @@
 # all these attribute readers will be bootstrapped
 # away in the Class::MOP bootstrap section
 
-sub get_attribute_map        { $_[0]->{'attributes'}                  }
+sub _attribute_map           { $_[0]->{'attributes'}                  }
 sub attribute_metaclass      { $_[0]->{'attribute_metaclass'}         }
 sub instance_metaclass       { $_[0]->{'instance_metaclass'}          }
 sub immutable_trait          { $_[0]->{'immutable_trait'}             }
@@ -595,7 +596,7 @@
 
     sub add_before_method_modifier {
         my ($self, $method_name, $method_modifier) = @_;
-        (defined $method_name && $method_name)
+        (defined $method_name && length $method_name)
             || confess "You must pass in a method name";
         my $method = $fetch_and_prepare_method->($self, $method_name);
         $method->add_before_modifier(
@@ -605,7 +606,7 @@
 
     sub add_after_method_modifier {
         my ($self, $method_name, $method_modifier) = @_;
-        (defined $method_name && $method_name)
+        (defined $method_name && length $method_name)
             || confess "You must pass in a method name";
         my $method = $fetch_and_prepare_method->($self, $method_name);
         $method->add_after_modifier(
@@ -615,7 +616,7 @@
 
     sub add_around_method_modifier {
         my ($self, $method_name, $method_modifier) = @_;
-        (defined $method_name && $method_name)
+        (defined $method_name && length $method_name)
             || confess "You must pass in a method name";
         my $method = $fetch_and_prepare_method->($self, $method_name);
         $method->add_around_modifier(
@@ -639,7 +640,7 @@
 
 sub find_method_by_name {
     my ($self, $method_name) = @_;
-    (defined $method_name && $method_name)
+    (defined $method_name && length $method_name)
         || confess "You must define a method name to find";
     foreach my $class ($self->linearized_isa) {
         my $method = $self->initialize($class)->get_method($method_name);
@@ -670,7 +671,7 @@
 
 sub find_all_methods_by_name {
     my ($self, $method_name) = @_;
-    (defined $method_name && $method_name)
+    (defined $method_name && length $method_name)
         || confess "You must define a method name to find";
     my @methods;
     foreach my $class ($self->linearized_isa) {
@@ -687,7 +688,7 @@
 
 sub find_next_method_by_name {
     my ($self, $method_name) = @_;
-    (defined $method_name && $method_name)
+    (defined $method_name && length $method_name)
         || confess "You must define a method name to find";
     my @cpl = $self->linearized_isa;
     shift @cpl; # discard ourselves
@@ -728,23 +729,21 @@
     
     # get our count of previously inserted attributes and
     # increment by one so this attribute knows its order
-    my $order = (scalar keys %{$self->get_attribute_map});
+    my $order = (scalar keys %{$self->_attribute_map});
     $attribute->_set_insertion_order($order);
 
     # then onto installing the new accessors
-    $self->get_attribute_map->{$attr_name} = $attribute;
+    $self->_attribute_map->{$attr_name} = $attribute;
 
     # invalidate package flag here
-    my $e = do {
-        local $@;
+    try {
         local $SIG{__DIE__};
-        eval { $attribute->install_accessors() };
-        $@;
+        $attribute->install_accessors();
+    }
+    catch {
+        $self->remove_attribute($attr_name);
+        die $_;
     };
-    if ( $e ) {
-        $self->remove_attribute($attr_name);
-        die $e;
-    }
 
     return $attribute;
 }
@@ -814,14 +813,14 @@
     my ($self, $attribute_name) = @_;
     (defined $attribute_name)
         || confess "You must define an attribute name";
-    exists $self->get_attribute_map->{$attribute_name};
+    exists $self->_attribute_map->{$attribute_name};
 }
 
 sub get_attribute {
     my ($self, $attribute_name) = @_;
     (defined $attribute_name)
         || confess "You must define an attribute name";
-    return $self->get_attribute_map->{$attribute_name}
+    return $self->_attribute_map->{$attribute_name}
     # NOTE:
     # this will return undef anyway, so no need ...
     #    if $self->has_attribute($attribute_name);
@@ -832,9 +831,9 @@
     my ($self, $attribute_name) = @_;
     (defined $attribute_name)
         || confess "You must define an attribute name";
-    my $removed_attribute = $self->get_attribute_map->{$attribute_name};
+    my $removed_attribute = $self->_attribute_map->{$attribute_name};
     return unless defined $removed_attribute;
-    delete $self->get_attribute_map->{$attribute_name};
+    delete $self->_attribute_map->{$attribute_name};
     $self->invalidate_meta_instances();
     $removed_attribute->remove_accessors();
     $removed_attribute->detach_from_class();
@@ -843,12 +842,12 @@
 
 sub get_attribute_list {
     my $self = shift;
-    keys %{$self->get_attribute_map};
+    keys %{$self->_attribute_map};
 }
 
 sub get_all_attributes {
     my $self = shift;
-    my %attrs = map { %{ $self->initialize($_)->get_attribute_map } } reverse $self->linearized_isa;
+    my %attrs = map { %{ $self->initialize($_)->_attribute_map } } reverse $self->linearized_isa;
     return values %attrs;
 }
 
@@ -1447,12 +1446,6 @@
 named attribute. It does not include attributes inherited from parent
 classes.
 
-=item B<< $metaclass->get_attribute_map >>
-
-Returns a hash reference representing the attributes defined in this
-class. The keys are attribute names and the values are
-L<Class::MOP::Attribute> objects.
-
 =item B<< $metaclass->get_attribute_list >>
 
 This will return a list of attributes I<names> for all attributes

Modified: trunk/libclass-mop-perl/lib/Class/MOP/Class/Immutable/Trait.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/lib/Class/MOP/Class/Immutable/Trait.pm?rev=47476&op=diff
==============================================================================
--- trunk/libclass-mop-perl/lib/Class/MOP/Class/Immutable/Trait.pm (original)
+++ trunk/libclass-mop-perl/lib/Class/MOP/Class/Immutable/Trait.pm Thu Nov 19 16:25:11 2009
@@ -8,7 +8,7 @@
 use Carp 'confess';
 use Scalar::Util 'blessed', 'weaken';
 
-our $VERSION   = '0.94';
+our $VERSION   = '0.95';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: trunk/libclass-mop-perl/lib/Class/MOP/Deprecated.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/lib/Class/MOP/Deprecated.pm?rev=47476&op=diff
==============================================================================
--- trunk/libclass-mop-perl/lib/Class/MOP/Deprecated.pm (original)
+++ trunk/libclass-mop-perl/lib/Class/MOP/Deprecated.pm Thu Nov 19 16:25:11 2009
@@ -6,7 +6,7 @@
 use Carp qw( cluck );
 use Scalar::Util qw( blessed );
 
-our $VERSION = '0.94';
+our $VERSION = '0.95';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 
@@ -26,6 +26,7 @@
     'Class::MOP::Class::alias_method'                      => 0.93,
     'Class::MOP::Class::compute_all_applicable_methods'    => 0.93,
     'Class::MOP::Class::compute_all_applicable_attributes' => 0.93,
+    'Class::MOP::Class::get_attribute_map' => 0.95,
 
     'Class::MOP::Instance::bless_instance_structure' => 0.93,
 
@@ -205,6 +206,13 @@
     shift->get_all_attributes(@_);
 }
 
+sub get_attribute_map {
+    Class::MOP::Deprecated::warn(
+        "The get_attribute_map method has been deprecated.\n");
+
+    shift->_attribute_map(@_);
+}
+
 package
     Class::MOP::Instance;
 

Modified: trunk/libclass-mop-perl/lib/Class/MOP/Instance.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/lib/Class/MOP/Instance.pm?rev=47476&op=diff
==============================================================================
--- trunk/libclass-mop-perl/lib/Class/MOP/Instance.pm (original)
+++ trunk/libclass-mop-perl/lib/Class/MOP/Instance.pm Thu Nov 19 16:25:11 2009
@@ -6,7 +6,7 @@
 
 use Scalar::Util 'weaken', 'blessed';
 
-our $VERSION   = '0.94';
+our $VERSION   = '0.95';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: trunk/libclass-mop-perl/lib/Class/MOP/Method.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/lib/Class/MOP/Method.pm?rev=47476&op=diff
==============================================================================
--- trunk/libclass-mop-perl/lib/Class/MOP/Method.pm (original)
+++ trunk/libclass-mop-perl/lib/Class/MOP/Method.pm Thu Nov 19 16:25:11 2009
@@ -7,7 +7,7 @@
 use Carp         'confess';
 use Scalar::Util 'weaken', 'reftype', 'blessed';
 
-our $VERSION   = '0.94';
+our $VERSION   = '0.95';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: trunk/libclass-mop-perl/lib/Class/MOP/Method/Accessor.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/lib/Class/MOP/Method/Accessor.pm?rev=47476&op=diff
==============================================================================
--- trunk/libclass-mop-perl/lib/Class/MOP/Method/Accessor.pm (original)
+++ trunk/libclass-mop-perl/lib/Class/MOP/Method/Accessor.pm Thu Nov 19 16:25:11 2009
@@ -7,7 +7,7 @@
 use Carp         'confess';
 use Scalar::Util 'blessed', 'weaken';
 
-our $VERSION   = '0.94';
+our $VERSION   = '0.95';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: trunk/libclass-mop-perl/lib/Class/MOP/Method/Constructor.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/lib/Class/MOP/Method/Constructor.pm?rev=47476&op=diff
==============================================================================
--- trunk/libclass-mop-perl/lib/Class/MOP/Method/Constructor.pm (original)
+++ trunk/libclass-mop-perl/lib/Class/MOP/Method/Constructor.pm Thu Nov 19 16:25:11 2009
@@ -7,7 +7,7 @@
 use Carp         'confess';
 use Scalar::Util 'blessed', 'weaken', 'looks_like_number';
 
-our $VERSION   = '0.94';
+our $VERSION   = '0.95';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: trunk/libclass-mop-perl/lib/Class/MOP/Method/Generated.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/lib/Class/MOP/Method/Generated.pm?rev=47476&op=diff
==============================================================================
--- trunk/libclass-mop-perl/lib/Class/MOP/Method/Generated.pm (original)
+++ trunk/libclass-mop-perl/lib/Class/MOP/Method/Generated.pm Thu Nov 19 16:25:11 2009
@@ -6,7 +6,7 @@
 
 use Carp 'confess';
 
-our $VERSION   = '0.94';
+our $VERSION   = '0.95';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: trunk/libclass-mop-perl/lib/Class/MOP/Method/Inlined.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/lib/Class/MOP/Method/Inlined.pm?rev=47476&op=diff
==============================================================================
--- trunk/libclass-mop-perl/lib/Class/MOP/Method/Inlined.pm (original)
+++ trunk/libclass-mop-perl/lib/Class/MOP/Method/Inlined.pm Thu Nov 19 16:25:11 2009
@@ -6,7 +6,7 @@
 use Carp         'confess';
 use Scalar::Util 'blessed', 'weaken', 'looks_like_number', 'refaddr';
 
-our $VERSION   = '0.94';
+our $VERSION   = '0.95';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: trunk/libclass-mop-perl/lib/Class/MOP/Method/Wrapped.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/lib/Class/MOP/Method/Wrapped.pm?rev=47476&op=diff
==============================================================================
--- trunk/libclass-mop-perl/lib/Class/MOP/Method/Wrapped.pm (original)
+++ trunk/libclass-mop-perl/lib/Class/MOP/Method/Wrapped.pm Thu Nov 19 16:25:11 2009
@@ -7,7 +7,7 @@
 use Carp         'confess';
 use Scalar::Util 'blessed';
 
-our $VERSION   = '0.94';
+our $VERSION   = '0.95';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: trunk/libclass-mop-perl/lib/Class/MOP/Module.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/lib/Class/MOP/Module.pm?rev=47476&op=diff
==============================================================================
--- trunk/libclass-mop-perl/lib/Class/MOP/Module.pm (original)
+++ trunk/libclass-mop-perl/lib/Class/MOP/Module.pm Thu Nov 19 16:25:11 2009
@@ -7,7 +7,7 @@
 use Carp         'confess';
 use Scalar::Util 'blessed';
 
-our $VERSION   = '0.94';
+our $VERSION   = '0.95';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: trunk/libclass-mop-perl/lib/Class/MOP/Object.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/lib/Class/MOP/Object.pm?rev=47476&op=diff
==============================================================================
--- trunk/libclass-mop-perl/lib/Class/MOP/Object.pm (original)
+++ trunk/libclass-mop-perl/lib/Class/MOP/Object.pm Thu Nov 19 16:25:11 2009
@@ -6,7 +6,7 @@
 
 use Scalar::Util 'blessed';
 
-our $VERSION   = '0.94';
+our $VERSION   = '0.95';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: trunk/libclass-mop-perl/lib/Class/MOP/Package.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/lib/Class/MOP/Package.pm?rev=47476&op=diff
==============================================================================
--- trunk/libclass-mop-perl/lib/Class/MOP/Package.pm (original)
+++ trunk/libclass-mop-perl/lib/Class/MOP/Package.pm Thu Nov 19 16:25:11 2009
@@ -8,7 +8,7 @@
 use Carp         'confess';
 use Sub::Name    'subname';
 
-our $VERSION   = '0.94';
+our $VERSION   = '0.95';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 
@@ -311,7 +311,7 @@
 
 sub add_method {
     my ($self, $method_name, $method) = @_;
-    (defined $method_name && $method_name)
+    (defined $method_name && length $method_name)
         || confess "You must define a method name";
 
     my $body;
@@ -320,7 +320,7 @@
         if ($method->package_name ne $self->name) {
             $method = $method->clone(
                 package_name => $self->name,
-                name         => $method_name            
+                name         => $method_name,
             ) if $method->can('clone');
         }
 
@@ -336,7 +336,7 @@
 
     my ( $current_package, $current_name ) = Class::MOP::get_code_info($body);
 
-    if ( !defined $current_name || $current_name eq '__ANON__' ) {
+    if ( !defined $current_name || $current_name =~ /^__ANON__/ ) {
         my $full_method_name = ($self->name . '::' . $method_name);
         subname($full_method_name => $body);
     }
@@ -358,7 +358,8 @@
 
 sub has_method {
     my ($self, $method_name) = @_;
-    (defined $method_name && $method_name)
+
+    (defined $method_name && length $method_name)
         || confess "You must define a method name";
 
     return defined($self->get_method($method_name));
@@ -366,7 +367,8 @@
 
 sub get_method {
     my ( $self, $method_name ) = @_;
-    ( defined $method_name && $method_name )
+
+    (defined $method_name && length $method_name)
         || confess "You must define a method name";
 
     my $method_map = $self->_method_map;
@@ -402,7 +404,7 @@
 
 sub remove_method {
     my ($self, $method_name) = @_;
-    (defined $method_name && $method_name)
+    (defined $method_name && length $method_name)
         || confess "You must define a method name";
 
     my $removed_method = delete $self->_full_method_map->{$method_name};

Modified: trunk/libclass-mop-perl/lib/metaclass.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/lib/metaclass.pm?rev=47476&op=diff
==============================================================================
--- trunk/libclass-mop-perl/lib/metaclass.pm (original)
+++ trunk/libclass-mop-perl/lib/metaclass.pm Thu Nov 19 16:25:11 2009
@@ -7,7 +7,7 @@
 use Carp         'confess';
 use Scalar::Util 'blessed';
 
-our $VERSION   = '0.94';
+our $VERSION   = '0.95';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: trunk/libclass-mop-perl/t/010_self_introspection.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/t/010_self_introspection.t?rev=47476&op=diff
==============================================================================
--- trunk/libclass-mop-perl/t/010_self_introspection.t (original)
+++ trunk/libclass-mop-perl/t/010_self_introspection.t Thu Nov 19 16:25:11 2009
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 304;
+use Test::More tests => 306;
 use Test::Exception;
 
 use Class::MOP;
@@ -90,7 +90,9 @@
         add_before_method_modifier add_after_method_modifier add_around_method_modifier
 
     has_attribute get_attribute add_attribute remove_attribute
-    get_attribute_list get_attribute_map get_all_attributes compute_all_applicable_attributes find_attribute_by_name
+    get_attribute_list _attribute_map get_all_attributes compute_all_applicable_attributes find_attribute_by_name
+
+    get_attribute_map
 
     is_mutable is_immutable make_mutable make_immutable
     _initialize_immutable _install_inlined_code _inlined_methods
@@ -194,7 +196,7 @@
 );
 
 is_deeply(
-    [ sort keys %{$class_mop_class_meta->get_attribute_map} ],
+    [ sort keys %{$class_mop_class_meta->_attribute_map} ],
     [ sort @class_mop_class_attributes ],
     '... got the right list of attributes');
 
@@ -211,7 +213,7 @@
     '... got the right list of attributes');
 
 is_deeply(
-    [ sort keys %{$class_mop_package_meta->get_attribute_map} ],
+    [ sort keys %{$class_mop_package_meta->_attribute_map} ],
     [ sort @class_mop_package_attributes ],
     '... got the right list of attributes');
 
@@ -228,7 +230,7 @@
     '... got the right list of attributes');
 
 is_deeply(
-    [ sort keys %{$class_mop_module_meta->get_attribute_map} ],
+    [ sort keys %{$class_mop_module_meta->_attribute_map} ],
     [ sort @class_mop_module_attributes ],
     '... got the right list of attributes');
 
@@ -282,8 +284,8 @@
 
 ok($class_mop_class_meta->get_attribute('attributes')->has_reader, '... Class::MOP::Class attributes has a reader');
 is_deeply($class_mop_class_meta->get_attribute('attributes')->reader,
-   { 'get_attribute_map' => \&Class::MOP::Class::get_attribute_map },
-   '... Class::MOP::Class attributes\'s a reader is &get_attribute_map');
+   { '_attribute_map' => \&Class::MOP::Class::_attribute_map },
+   '... Class::MOP::Class attributes\'s a reader is &_attribute_map');
 
 ok($class_mop_class_meta->get_attribute('attributes')->has_init_arg, '... Class::MOP::Class attributes has a init_arg');
 is($class_mop_class_meta->get_attribute('attributes')->init_arg,

Modified: trunk/libclass-mop-perl/t/049_metaclass_reinitialize.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/t/049_metaclass_reinitialize.t?rev=47476&op=diff
==============================================================================
--- trunk/libclass-mop-perl/t/049_metaclass_reinitialize.t (original)
+++ trunk/libclass-mop-perl/t/049_metaclass_reinitialize.t Thu Nov 19 16:25:11 2009
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 
-use Test::More;
+use Test::More tests => 14;
 use Test::Exception;
 
 {
@@ -39,5 +39,3 @@
 throws_ok {
     $meta->reinitialize($meta->new_object);
 } qr/You must pass a package name or an existing Class::MOP::Package instance/;
-
-done_testing;

Modified: trunk/libclass-mop-perl/t/083_load_class.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/t/083_load_class.t?rev=47476&op=diff
==============================================================================
--- trunk/libclass-mop-perl/t/083_load_class.t (original)
+++ trunk/libclass-mop-perl/t/083_load_class.t Thu Nov 19 16:25:11 2009
@@ -6,7 +6,10 @@
 require Class::MOP;
 use lib 't/lib';
 
-ok(!Class::MOP::is_class_loaded(), "is_class_loaded with no argument returns false");
+dies_ok {
+    Class::MOP::is_class_loaded()
+} "is_class_loaded with no argument dies";
+
 ok(!Class::MOP::is_class_loaded(''), "can't load the empty class");
 ok(!Class::MOP::is_class_loaded(\"foo"), "can't load a class name reference??");
 
@@ -62,8 +65,8 @@
 throws_ok {
     Class::MOP::load_class('This::Does::Not::Exist');
 }
-qr/Could not load class \(This::Does::Not::Exist\) because :/,
-    'Many Moose tests rely on the exact formatting of this error';
+qr{Can't locate This/Does/Not/Exist\.pm in \@INC},
+    'load_first_existing_class throws a familiar error for a single module';
 
 {
     package Other;
@@ -87,7 +90,7 @@
 
 throws_ok {
     Class::MOP::load_first_existing_class("Does::Not::Exist", "Also::Does::Not::Exist")
-} qr/Could not load class \(Does::Not::Exist.*Could not load class \(Also::Does::Not::Exist/s, 'Multiple non-existant classes cause exception';
+} qr/Does::Not::Exist.*Also::Does::Not::Exist/s, 'Multiple non-existant classes cause exception';
 
 {
     sub whatever {

Modified: trunk/libclass-mop-perl/t/500_deprecated.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/t/500_deprecated.t?rev=47476&op=diff
==============================================================================
--- trunk/libclass-mop-perl/t/500_deprecated.t (original)
+++ trunk/libclass-mop-perl/t/500_deprecated.t Thu Nov 19 16:25:11 2009
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 6;
+use Test::More tests => 7;
 use Test::Exception;
 
 use Carp;
@@ -10,47 +10,51 @@
 
 {
     package Foo;
-    use Test::More;
-    use Test::Exception;
 
-    throws_ok {
+    ::throws_ok{
         Class::MOP::in_global_destruction();
-    } qr/\b deprecated \b/xmsi, 'complained';
+        } qr/\b deprecated \b/xmsi,
+        'Class::MOP::in_global_destruction is deprecated';
 }
 
 {
     package Bar;
-    use Test::More;
-    use Test::Exception;
 
     use Class::MOP::Deprecated -compatible => 0.93;
 
-    throws_ok {
+    ::throws_ok{
         Class::MOP::in_global_destruction();
-    } qr/\b deprecated \b/xmsi, 'complained';
+        } qr/\b deprecated \b/xmsi,
+        'Class::MOP::in_global_destruction is deprecated with 0.93 compatibility';
 }
 
 {
     package Baz;
-    use Test::More;
-    use Test::Exception;
 
     use Class::MOP::Deprecated -compatible => 0.92;
 
-    lives_ok {
+    ::lives_ok{
         Class::MOP::in_global_destruction();
-    } 'safe';
+        }
+        'Class::MOP::in_global_destruction is not deprecated with 0.92 compatibility';
 }
-
 
 {
     package Baz::Inner;
-    use Test::More;
-    use Test::Exception;
 
-    lives_ok {
+    ::lives_ok{
         Class::MOP::in_global_destruction();
-    } 'safe in an inner class';
+        } 'safe in an inner class';
+}
+
+{
+    package Foo2;
+
+    use metaclass;
+
+    ::throws_ok{ Foo2->meta->get_attribute_map }
+        qr/\Qget_attribute_map method has been deprecated/,
+        'get_attribute_map is deprecated';
 }
 
 {
@@ -68,9 +72,13 @@
     my $map = Quux->meta->get_method_map;
     my @method_objects = grep { blessed($_) } values %{$map};
 
-    ::is( scalar @method_objects, 3,
-          'get_method_map still returns all values as method object' );
-    ::is_deeply( [ sort keys %{$map} ],
-                 [ qw( bar foo meta ) ],
-                 'get_method_map returns expected methods' );
+    ::is(
+        scalar @method_objects, 3,
+        'get_method_map still returns all values as method object'
+    );
+    ::is_deeply(
+        [ sort keys %{$map} ],
+        [qw( bar foo meta )],
+        'get_method_map returns expected methods'
+    );
 }

Modified: trunk/libclass-mop-perl/xs/MOP.xs
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/xs/MOP.xs?rev=47476&op=diff
==============================================================================
--- trunk/libclass-mop-perl/xs/MOP.xs (original)
+++ trunk/libclass-mop-perl/xs/MOP.xs Thu Nov 19 16:25:11 2009
@@ -50,11 +50,8 @@
             mPUSHs(newSVpv(name, 0));
         }
 
-# This is some pretty grotty logic. It _should_ be parallel to the
-# pure Perl version in lib/Class/MOP.pm, so if you want to understand
-# it we suggest you start there.
 void
-is_class_loaded(klass=&PL_sv_undef)
+is_class_loaded(klass)
     SV *klass
     PREINIT:
         HV *stash;

Modified: trunk/libclass-mop-perl/xt/author/pod_coverage.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/xt/author/pod_coverage.t?rev=47476&op=diff
==============================================================================
--- trunk/libclass-mop-perl/xt/author/pod_coverage.t (original)
+++ trunk/libclass-mop-perl/xt/author/pod_coverage.t Thu Nov 19 16:25:11 2009
@@ -43,6 +43,9 @@
 
         # doc'd with rebless_instance
         'rebless_instance_away',
+
+        # deprecated
+        'get_attribute_map',
     ],
     'Class::MOP::Class::Immutable::Trait'             => ['.+'],
     'Class::MOP::Class::Immutable::Class::MOP::Class' => ['.+'],




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