X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=lib%2FMouse.pm;h=a170114960b4b8e2d0bbbc6ff5aae5a73eb49f78;hp=b8b4565397fa210b8746a0987dc0be43e7340fc6;hb=b0b9f25a58185affc1f7a005929bf6b3f8770160;hpb=5f69227097e1e60f2bd31a9f5d71f5a344e6cbc5 diff --git a/lib/Mouse.pm b/lib/Mouse.pm index b8b4565..a170114 100644 --- a/lib/Mouse.pm +++ b/lib/Mouse.pm @@ -3,7 +3,7 @@ use 5.006_002; use Mouse::Exporter; # enables strict and warnings -our $VERSION = '0.46'; +our $VERSION = '0.50'; use Carp qw(confess); use Scalar::Util qw(blessed); @@ -61,33 +61,27 @@ sub has { sub before { my $meta = Mouse::Meta::Class->initialize(scalar caller); - my $code = pop; - - for (@_) { - $meta->add_before_method_modifier($_ => $code); + for my $name($meta->_collect_methods(@_)) { + $meta->add_before_method_modifier($name => $code); } return; } sub after { my $meta = Mouse::Meta::Class->initialize(scalar caller); - my $code = pop; - - for (@_) { - $meta->add_after_method_modifier($_ => $code); + for my $name($meta->_collect_methods(@_)) { + $meta->add_after_method_modifier($name => $code); } return; } sub around { my $meta = Mouse::Meta::Class->initialize(scalar caller); - my $code = pop; - - for (@_) { - $meta->add_around_method_modifier($_ => $code); + for my $name($meta->_collect_methods(@_)) { + $meta->add_around_method_modifier($name => $code); } return; } @@ -166,7 +160,7 @@ Mouse - Moose minus the antlers =head1 VERSION -This document describes Mouse version 0.46 +This document describes Mouse version 0.50 =head1 SYNOPSIS @@ -249,15 +243,15 @@ Returns this class' metaclass instance. Sets this class' superclasses. -=head2 C<< before (method|methods) => CodeRef >> +=head2 C<< before (method|methods|regexp) => CodeRef >> Installs a "before" method modifier. See L. -=head2 C<< after (method|methods) => CodeRef >> +=head2 C<< after (method|methods|regexp) => CodeRef >> Installs an "after" method modifier. See L. -=head2 C<< around (method|methods) => CodeRef >> +=head2 C<< around (method|methods|regexp) => CodeRef >> Installs an "around" method modifier. See L. @@ -405,8 +399,8 @@ keywords (such as L) it will break loudly instead breaking subtly. =head1 CAVEATS If you use Mouse::XS you might see a fatal error on callbacks -which include C, which typically occurs in sutch code -like C. This is not +which include C, which typically occurs in such code +as C. This is not a bug in Mouse. In fact, it is a bug in Perl (RT #69939). To work around this problem, surround C with C: