bump version for another devrel
[gitmo/Moo.git] / lib / Moo.pm
index eeee9e9..34be24e 100644 (file)
@@ -4,20 +4,10 @@ use strictures 1;
 use Moo::_Utils;
 use B 'perlstring';
 
-our $VERSION = '0.009014'; # 0.9.13
+our $VERSION = '0.009_017'; # 0.9.17
 $VERSION = eval $VERSION;
 
-sub Moo::HandleMoose::AuthorityHack::DESTROY {
-  require Moo::HandleMoose;
-  Moo::HandleMoose->import;
-}
-
-if ($INC{"Moose.pm"}) {
-  require Moo::HandleMoose;
-  Moo::HandleMoose->import;
-} else {
-  $Moose::AUTHORITY = bless({}, 'Moo::HandleMoose::AuthorityHack');
-}
+require Moo::sification;
 
 our %MAKERS;
 
@@ -33,8 +23,7 @@ sub import {
   };
   *{_getglob("${target}::with")} = sub {
     require Moo::Role;
-    die "Only one role supported at a time by with" if @_ > 1;
-    Moo::Role->apply_role_to_package($target, $_[0]);
+    Moo::Role->apply_roles_to_package($target, $_[0]);
   };
   $MAKERS{$target} = {};
   *{_getglob("${target}::has")} = sub {
@@ -102,8 +91,11 @@ sub _constructor_maker_for {
             ? ($con ? $con->construction_string : undef)
             : ('$class->'.$target.'::SUPER::new(@_)')
         ),
-        subconstructor_generator => (
-          $class.'->_constructor_maker_for($class,'.perlstring($target).')'
+        subconstructor_handler => (
+          '      if ($Moo::MAKERS{$class}) {'."\n"
+          .'        '.$class.'->_constructor_maker_for($class,'.perlstring($target).');'."\n"
+          .'        return $class->new(@_)'.";\n"
+          .'      }'."\n"
         ),
       )
       ->install_delayed
@@ -336,8 +328,9 @@ Takes a hashref
 
 =item * trigger
 
-Takes a coderef which will get called any time the attribute is set. Coderef
-will be invoked against the object with the new value as an argument.
+Takes a coderef which will get called any time the attribute is set. This
+includes the constructor. Coderef will be invoked against the object with the
+new value as an argument.
 
 Note that Moose also passes the old value, if any; this feature is not yet
 supported.
@@ -469,7 +462,8 @@ API will encourage the use of other type systems as well, since it's
 probably the weakest part of Moose design-wise.
 
 C<initializer> is not supported in core since the author considers it to be a
-bad idea but may be supported by an extension in future.
+bad idea but may be supported by an extension in future. Meanwhile C<trigger> or
+C<coerce> are more likely to be able to fulfill your needs.
 
 There is no meta object.  If you need this level of complexity you wanted
 L<Moose> - Moo succeeds at being small because it explicitly does not