From: Stevan Little Date: Fri, 16 May 2008 21:10:57 +0000 (+0000) Subject: trunk working again X-Git-Tag: 0_55~169 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8453c358c7c9eedf0e2c1a46a546fd2bf2efee59;p=gitmo%2FMoose.git trunk working again --- diff --git a/Changes b/Changes index 2e77a67..ebceccf 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,15 @@ Revision history for Perl extension Moose 0.45 + * Moose::Meta::Class + - added same 'add_package_symbol' fix as in + Class::MOP 0.56 + + * Moose::Util + - does_role now handles non-Moose classes + more gracefully + - added tests for this + * Moose::Meta::Method::Constructor - fixed bug where trigger was not being called by the inlined immutable diff --git a/Makefile.PL b/Makefile.PL index 4beb478..27b778b 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -12,7 +12,7 @@ my $win32 = !! ( $^O eq 'Win32' or $^O eq 'cygwin' ); # prereqs requires 'Scalar::Util' => $win32 ? '1.17' : '1.18'; requires 'Carp'; -requires 'Class::MOP' => '0.55'; +requires 'Class::MOP' => '0.56'; requires 'Sub::Name' => '0.02'; requires 'Sub::Exporter' => '0.972'; diff --git a/lib/Moose/Meta/Class.pm b/lib/Moose/Meta/Class.pm index f113d88..2514d5b 100644 --- a/lib/Moose/Meta/Class.pm +++ b/lib/Moose/Meta/Class.pm @@ -9,7 +9,7 @@ use Class::MOP; use Carp 'confess'; use Scalar::Util 'weaken', 'blessed', 'reftype'; -our $VERSION = '0.21'; +our $VERSION = '0.22'; our $AUTHORITY = 'cpan:STEVAN'; use Moose::Meta::Method::Overriden; @@ -359,7 +359,6 @@ sub create_immutable_transformer { remove_method add_attribute remove_attribute - add_package_symbol remove_package_symbol add_role /], @@ -370,7 +369,19 @@ sub create_immutable_transformer { get_method_map => 'SCALAR', # maybe .... calculate_all_roles => 'ARRAY', - } + }, + # NOTE: + # this is ugly, but so are typeglobs, + # so whattayahgonnadoboutit + # - SL + wrapped => { + add_package_symbol => sub { + my $original = shift; + confess "Cannot add package symbols to an immutable metaclass" + unless (caller(2))[3] eq 'Class::MOP::Package::get_package_symbol'; + goto $original->body; + }, + }, }); return $class; } diff --git a/lib/Moose/Util.pm b/lib/Moose/Util.pm index 9a7be5a..b8c5f0f 100644 --- a/lib/Moose/Util.pm +++ b/lib/Moose/Util.pm @@ -8,7 +8,7 @@ use Scalar::Util 'blessed'; use Carp 'confess'; use Class::MOP (); -our $VERSION = '0.04'; +our $VERSION = '0.05'; our $AUTHORITY = 'cpan:STEVAN'; my @exports = qw[