use B 'perlstring';
use Sub::Defer ();
-our $VERSION = '0.091007'; # 0.91.7
+our $VERSION = '0.091009'; # 0.91.9
$VERSION = eval $VERSION;
require Moo::sification;
Moo->_constructor_maker_for($target)
->register_attribute_specs(%{$old->all_attribute_specs});
}
+ no warnings 'once'; # piss off. -- mst
$Moo::HandleMoose::MOUSE{$target} = [
grep defined, map Mouse::Util::find_meta($_), @_
] if $INC{"Mouse.pm"};
};
_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} = {};
' if ($Moo::MAKERS{$class}) {'."\n"
.' '.$class.'->_constructor_maker_for($class,'.perlstring($target).');'."\n"
.' return $class->new(@_)'.";\n"
+ .' } elsif ($INC{"Moose.pm"} and my $meta = Class::MOP::get_metaclass_by_name($class)) {'."\n"
+ .' return $meta->new_object(@_);'."\n"
.' }'."\n"
),
)
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