X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FRole%2FComposite.pm;h=146e5909a68e812092f61e3e69c1842a6af7cd53;hb=ae7820b1b884344a7ee90d94b484ca46459eb7b1;hp=e42d488d795a9228046ff0c66fc0b4f3e1f4c6ab;hpb=eaf5a43ef108f6a9dce74c84afc25a892cffdfb1;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/Role/Composite.pm b/lib/Moose/Meta/Role/Composite.pm index e42d488..146e590 100644 --- a/lib/Moose/Meta/Role/Composite.pm +++ b/lib/Moose/Meta/Role/Composite.pm @@ -6,7 +6,7 @@ use metaclass; use Scalar::Util 'blessed'; -our $VERSION = '0.90'; +our $VERSION = '1.06'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; @@ -48,9 +48,7 @@ sub new { } my @composition_roles = map { - $_->has_composition_class_roles - ? @{ $_->composition_class_roles } - : () + $_->composition_class_roles } @{ $params{roles} }; if (@composition_roles) { @@ -127,10 +125,19 @@ sub apply_params { } sub reinitialize { - my ($class, $old_meta, @args) = @_; - Moose->throw_error('Moose::Meta::Role::Composite instances can only be reinitialized from an existing metaclass instance') - if !blessed $old_meta || !$old_meta->isa('Moose::Meta::Role::Composite'); - return $old_meta->meta->clone_object($old_meta, @args); + my ( $class, $old_meta, @args ) = @_; + + Moose->throw_error( + 'Moose::Meta::Role::Composite instances can only be reinitialized from an existing metaclass instance' + ) + if !blessed $old_meta + || !$old_meta->isa('Moose::Meta::Role::Composite'); + + my %existing_classes = map { $_ => $old_meta->$_() } qw( + application_role_summation_class + ); + + return $old_meta->meta->clone_object( $old_meta, %existing_classes, @args ); } 1; @@ -192,9 +199,7 @@ string with the package name, as there is no real package for composite roles. =head1 BUGS -All complex software has bugs lurking in it, and this module is no -exception. If you find a bug please either email me, or add the bug -to cpan-RT. +See L for details on reporting bugs. =head1 AUTHOR @@ -202,7 +207,7 @@ Stevan Little Estevan@iinteractive.comE =head1 COPYRIGHT AND LICENSE -Copyright 2006-2009 by Infinity Interactive, Inc. +Copyright 2006-2010 by Infinity Interactive, Inc. L