r5852 - in /packages/libclass-mop-perl/branches/upstream/current: Changes META.yml README lib/Class/MOP.pm lib/Class/MOP/Package.pm t/003_methods.t

eloy at users.alioth.debian.org eloy at users.alioth.debian.org
Wed Jul 18 11:45:44 UTC 2007


Author: eloy
Date: Wed Jul 18 11:45:44 2007
New Revision: 5852

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

Modified:
    packages/libclass-mop-perl/branches/upstream/current/Changes
    packages/libclass-mop-perl/branches/upstream/current/META.yml
    packages/libclass-mop-perl/branches/upstream/current/README
    packages/libclass-mop-perl/branches/upstream/current/lib/Class/MOP.pm
    packages/libclass-mop-perl/branches/upstream/current/lib/Class/MOP/Package.pm
    packages/libclass-mop-perl/branches/upstream/current/t/003_methods.t

Modified: packages/libclass-mop-perl/branches/upstream/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-mop-perl/branches/upstream/current/Changes?rev=5852&op=diff
==============================================================================
--- packages/libclass-mop-perl/branches/upstream/current/Changes (original)
+++ packages/libclass-mop-perl/branches/upstream/current/Changes Wed Jul 18 11:45:44 2007
@@ -1,4 +1,19 @@
 Revision history for Perl extension Class-MOP.
+
+0.42 Mon. July 16, 2007
+    !!! Horray for mst, he fixed it !!!
+
+    * Class::MOP::Package
+      - alter symbol table handling to deal with 5.8.x and 5.9.x
+      
+    * t/
+      - Get rid of the crappy workaround from 0.40/41
+
+0.41 Sun. July 15, 2007
+    * t/
+        Arghh!!! My TODO test didn't work, so I handle
+        it manually now so that people can use this 
+        with 5.9.5/bleadperl without issue.
 
 0.40 Tues, July 3, 2007
     * t/
@@ -562,4 +577,4 @@
         - adding POD documentation to the examples
 
 0.01 Thurs Feb. 2, 2006
-    - Initial release
+    - Initial release

Modified: packages/libclass-mop-perl/branches/upstream/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-mop-perl/branches/upstream/current/META.yml?rev=5852&op=diff
==============================================================================
--- packages/libclass-mop-perl/branches/upstream/current/META.yml (original)
+++ packages/libclass-mop-perl/branches/upstream/current/META.yml Wed Jul 18 11:45:44 2007
@@ -1,6 +1,6 @@
 ---
 name: Class-MOP
-version: 0.40
+version: 0.42
 author:
   - 'Stevan Little E<lt>stevan at iinteractive.comE<gt>'
 abstract: A Meta Object Protocol for Perl 5
@@ -19,7 +19,7 @@
 provides:
   Class::MOP:
     file: lib/Class/MOP.pm
-    version: 0.40
+    version: 0.42
   Class::MOP::Attribute:
     file: lib/Class/MOP/Attribute.pm
     version: 0.15
@@ -52,7 +52,7 @@
     version: 0.02
   Class::MOP::Package:
     file: lib/Class/MOP/Package.pm
-    version: 0.06
+    version: 0.07
   metaclass:
     file: lib/metaclass.pm
     version: 0.04

Modified: packages/libclass-mop-perl/branches/upstream/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-mop-perl/branches/upstream/current/README?rev=5852&op=diff
==============================================================================
--- packages/libclass-mop-perl/branches/upstream/current/README (original)
+++ packages/libclass-mop-perl/branches/upstream/current/README Wed Jul 18 11:45:44 2007
@@ -1,4 +1,4 @@
-Class::MOP version 0.40
+Class::MOP version 0.42
 ===========================
 
 See the individual module documentation for more information

Modified: packages/libclass-mop-perl/branches/upstream/current/lib/Class/MOP.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-mop-perl/branches/upstream/current/lib/Class/MOP.pm?rev=5852&op=diff
==============================================================================
--- packages/libclass-mop-perl/branches/upstream/current/lib/Class/MOP.pm (original)
+++ packages/libclass-mop-perl/branches/upstream/current/lib/Class/MOP.pm Wed Jul 18 11:45:44 2007
@@ -13,7 +13,7 @@
 
 use Class::MOP::Immutable;
 
-our $VERSION   = '0.40';
+our $VERSION   = '0.42';
 our $AUTHORITY = 'cpan:STEVAN';
 
 {
@@ -855,6 +855,8 @@
 
 Guillermo (groditi) Roditi
 
+Matt (mst) Trout
+
 Rob (robkinyon) Kinyon
 
 Yuval (nothingmuch) Kogman

Modified: packages/libclass-mop-perl/branches/upstream/current/lib/Class/MOP/Package.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-mop-perl/branches/upstream/current/lib/Class/MOP/Package.pm?rev=5852&op=diff
==============================================================================
--- packages/libclass-mop-perl/branches/upstream/current/lib/Class/MOP/Package.pm (original)
+++ packages/libclass-mop-perl/branches/upstream/current/lib/Class/MOP/Package.pm Wed Jul 18 11:45:44 2007
@@ -7,7 +7,7 @@
 use Scalar::Util 'blessed';
 use Carp         'confess';
 
-our $VERSION   = '0.06';
+our $VERSION   = '0.07';
 our $AUTHORITY = 'cpan:STEVAN';
 
 use base 'Class::MOP::Object';
@@ -124,10 +124,13 @@
     # this. Which of course means that 
     # if you put \undef in your scalar
     # then this is broken.
-    
-    if ($type eq 'SCALAR') {    
+
+    if (ref($self->namespace->{$name}) eq 'SCALAR') {
+        return ($type eq 'CODE' ? 1 : 0);
+    }
+    elsif ($type eq 'SCALAR') {    
         my $val = *{$self->namespace->{$name}}{$type};
-        defined(${$val}) ? 1 : 0;        
+        return defined(${$val}) ? 1 : 0;        
     }
     else {
         defined(*{$self->namespace->{$name}}{$type}) ? 1 : 0;
@@ -141,7 +144,19 @@
 
     $self->add_package_symbol($variable)
         unless exists $self->namespace->{$name};
-    return *{$self->namespace->{$name}}{$type};
+
+    if (ref($self->namespace->{$name}) eq 'SCALAR') {
+        if ($type eq 'CODE') {
+            no strict 'refs';
+            return \&{$self->name.'::'.$name};
+        }
+        else {
+            return undef;
+        }
+    }
+    else {
+        return *{$self->namespace->{$name}}{$type};
+    }
 }
 
 sub remove_package_symbol {
@@ -194,9 +209,10 @@
     # type (SCALAR|ARRAY|HASH|CODE)
     my $namespace = $self->namespace;
     return grep { 
-        defined(*{$namespace->{$_}}{$type_filter}) 
-    } grep {
-        ref(\$namespace->{$_}) eq 'GLOB'   
+        (ref($namespace->{$_})
+            ? (ref($namespace->{$_}) eq 'SCALAR' && $type_filter eq 'CODE')
+            : (ref(\$namespace->{$_}) eq 'GLOB'
+               && defined(*{$namespace->{$_}}{$type_filter})));
     } keys %{$namespace};
 }
 
@@ -283,4 +299,4 @@
 This library is free software; you can redistribute it and/or modify
 it under the same terms as Perl itself.
 
-=cut
+=cut

Modified: packages/libclass-mop-perl/branches/upstream/current/t/003_methods.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-mop-perl/branches/upstream/current/t/003_methods.t?rev=5852&op=diff
==============================================================================
--- packages/libclass-mop-perl/branches/upstream/current/t/003_methods.t (original)
+++ packages/libclass-mop-perl/branches/upstream/current/t/003_methods.t Wed Jul 18 11:45:44 2007
@@ -84,10 +84,7 @@
 
 # now check all our other items ...
 
-TODO: {
-    local $TODO = "\$] > 5.9.5" if $] > 5.009005;
-    ok($Foo->has_method('FOO_CONSTANT'), '... Foo->has_method(FOO_CONSTANT) (defined w/ use constant)');
-}
+ok($Foo->has_method('FOO_CONSTANT'), '... Foo->has_method(FOO_CONSTANT) (defined w/ use constant)');
 ok($Foo->has_method('bar'), '... Foo->has_method(bar) (defined in Foo)');
 ok($Foo->has_method('baz'), '... Foo->has_method(baz) (typeglob aliased within Foo)');
 ok($Foo->has_method('floob'), '... Foo->has_method(floob) (defined in Foo:: using symbol tables and Sub::Name w/out package name)');




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