X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse.pm;h=68808b8ed1f68ae757ed0c2e96ab0fde64ddcb1e;hb=78dc5ed14c0d04c8b73dc8ec701704d72b68e32c;hp=d4ab925003487d20d34020a62914806ff9f44bf7;hpb=d2bd2119402d2d8d1909c71a7dee07772e094db9;p=gitmo%2FMouse.git diff --git a/lib/Mouse.pm b/lib/Mouse.pm index d4ab925..68808b8 100644 --- a/lib/Mouse.pm +++ b/lib/Mouse.pm @@ -4,14 +4,14 @@ use 5.006_002; use strict; use warnings; -our $VERSION = '0.34'; +our $VERSION = '0.37_02'; use Exporter; use Carp 'confess'; use Scalar::Util 'blessed'; -use Mouse::Util qw(load_class is_class_loaded not_supported); +use Mouse::Util qw(load_class is_class_loaded get_code_package not_supported); use Mouse::Meta::Module; use Mouse::Meta::Class; @@ -86,27 +86,14 @@ our @SUPER_ARGS; sub super { # This check avoids a recursion loop - see # t/100_bugs/020_super_recursion.t - return if defined $SUPER_PACKAGE && $SUPER_PACKAGE ne caller(); - return unless $SUPER_BODY; $SUPER_BODY->(@SUPER_ARGS); + return if defined $SUPER_PACKAGE && $SUPER_PACKAGE ne caller(); + return if !defined $SUPER_BODY; + $SUPER_BODY->(@SUPER_ARGS); } sub override { - my $meta = Mouse::Meta::Class->initialize(caller); - my $pkg = $meta->name; - - my $name = shift; - my $code = shift; - - my $body = $pkg->can($name) - or confess "You cannot override '$name' because it has no super method"; - - $meta->add_method($name => sub { - local $SUPER_PACKAGE = $pkg; - local @SUPER_ARGS = @_; - local $SUPER_BODY = $body; - - $code->(@_); - }); + # my($name, $method) = @_; + Mouse::Meta::Class->initialize(scalar caller)->add_override_method_modifier(@_); } sub inner { not_supported } @@ -190,7 +177,7 @@ sub unimport { my $code; if(exists $is_removable{$keyword} && ($code = $caller->can($keyword)) - && (Mouse::Util::get_code_info($code))[0] eq __PACKAGE__){ + && get_code_package($code) eq __PACKAGE__){ delete $stash->{$keyword}; } @@ -275,12 +262,6 @@ should upgrade to Moose. We don't need two parallel sets of extensions! If you really must write a Mouse extension, please contact the Moose mailing list or #moose on IRC beforehand. -=head2 Maintenance - -The original author of this module has mostly stepped down from maintaining -Mouse. See L. -If you would like to help maintain this module, please get in touch with us. - =head1 KEYWORDS =head2 C<< $object->meta -> Mouse::Meta::Class >> @@ -454,9 +435,9 @@ L =head1 AUTHORS -Shawn M Moore, C<< >> +Shawn M Moore, Esartak at gmail.comE -Yuval Kogman, C<< >> +Yuval Kogman, Enothingmuch at woobling.orgE tokuhirom @@ -464,7 +445,7 @@ Yappo wu-lee -Goro Fuji (gfx) C<< >> +Goro Fuji (gfx) Egfuji at cpan.orgE with plenty of code borrowed from L and L