bump version
[gitmo/Moo.git] / lib / Moo.pm
index cd65690..6aa9cd2 100644 (file)
@@ -5,7 +5,7 @@ use Moo::_Utils;
 use B 'perlstring';
 use Sub::Defer ();
 
-our $VERSION = '0.091003'; # 0.91.3
+our $VERSION = '0.091009'; # 0.91.9
 $VERSION = eval $VERSION;
 
 require Moo::sification;
@@ -30,10 +30,11 @@ sub import {
       grep defined, map Mouse::Util::find_meta($_), @_
     ] if $INC{"Mouse.pm"};
     $class->_maybe_reset_handlemoose($target);
+    return;
   };
   _install_coderef "${target}::with" => "Moo::with" => sub {
     require Moo::Role;
-    Moo::Role->apply_roles_to_package($target, $_[0]);
+    Moo::Role->apply_roles_to_package($target, @_);
     $class->_maybe_reset_handlemoose($target);
   };
   $MAKERS{$target} = {};
@@ -44,11 +45,13 @@ sub import {
     $class->_accessor_maker_for($target)
           ->generate_method($target, $name, \%spec);
     $class->_maybe_reset_handlemoose($target);
+    return;
   };
   foreach my $type (qw(before after around)) {
     _install_coderef "${target}::${type}" => "Moo::${type}" => sub {
       require Class::Method::Modifiers;
       _install_modifier($target, $type, @_);
+      return;
     };
   }
   {
@@ -348,14 +351,11 @@ The options for C<has> are as follows:
 
 =item * is
 
-B<required>, may be C<ro>, C<rw>, C<lazy> or C<rwp>.
+B<required>, may be C<ro>, C<lazy>, C<rwp> or C<rw>.
 
 C<ro> generates an accessor that dies if you attempt to write to it - i.e.
 a getter only - by defaulting C<reader> to the name of the attribute.
 
-C<rw> generates a normal getter/setter by defauting C<accessor> to the
-name of the attribute.
-
 C<lazy> generates a reader like C<ro>, but also sets C<lazy> to 1 and
 C<builder> to C<_build_${attribute_name}> to allow on-demand generated
 attributes.  This feature was my attempt to fix my incompetence when
@@ -367,6 +367,9 @@ C<_set_${attribute_name}> for attributes that are designed to be written
 from inside of the class, but read-only from outside.
 This feature comes from L<MooseX::AttributeShortcuts>.
 
+C<rw> generates a normal getter/setter by defaulting C<accessor> to the
+name of the attribute.
+
 =item * isa
 
 Takes a coderef which is meant to validate the attribute.  Unlike L<Moose> Moo
@@ -585,9 +588,21 @@ provide a metaprotocol. However, if you load L<Moose>, then
 
 will return an appropriate metaclass pre-populated by L<Moo>.
 
-No support for C<super>, C<override>, C<inner>, or C<augment> - override can
-be handled by around albeit with a little more typing, and the author considers
-augment to be a bad idea.
+No support for C<super>, C<override>, C<inner>, or C<augment> - the author
+considers augment to be a bad idea, and override can be translated:
+
+  override foo => sub {
+    ...
+    super();
+    ...
+  };
+
+  around foo => sub {
+    my ($orig, $self) = (shift, shift);
+    ...
+    $self->$orig(@_);
+    ...
+  };
 
 The C<dump> method is not provided by default. The author suggests loading
 L<Devel::Dwarn> into C<main::> (via C<perl -MDevel::Dwarn ...> for example) and