version bump for 1.9903
[gitmo/Moose.git] / lib / Moose / Meta / Role / Composite.pm
index e42d488..e3a6d57 100644 (file)
@@ -6,10 +6,6 @@ use metaclass;
 
 use Scalar::Util 'blessed';
 
-our $VERSION   = '0.90';
-$VERSION = eval $VERSION;
-our $AUTHORITY = 'cpan:STEVAN';
-
 use base 'Moose::Meta::Role';
 
 # NOTE:
@@ -48,9 +44,7 @@ sub new {
     }
 
     my @composition_roles = map {
-        $_->has_composition_class_roles
-            ? @{ $_->composition_class_roles }
-            : ()
+        $_->composition_class_roles
     } @{ $params{roles} };
 
     if (@composition_roles) {
@@ -59,7 +53,6 @@ sub new {
             roles        => [ @composition_roles ],
             cache        => 1,
         );
-        $meta->add_method(meta => sub { $meta });
         $class = $meta->name;
     }
 
@@ -103,6 +96,11 @@ sub get_method_list {
     return keys %{ $self->_method_map };
 }
 
+sub _get_local_methods {
+    my $self = shift;
+    return values %{ $self->_method_map };
+}
+
 sub has_method {
     my ($self, $method_name) = @_;
 
@@ -127,22 +125,29 @@ 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;
 
+# ABSTRACT: An object to represent the set of roles
+
 __END__
 
 =pod
 
-=head1 NAME
-
-Moose::Meta::Role::Composite - An object to represent the set of roles
-
 =head1 DESCRIPTION
 
 A composite is a role that consists of a set of two or more roles.
@@ -192,21 +197,6 @@ 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.
-
-=head1 AUTHOR
-
-Stevan Little E<lt>stevan@iinteractive.comE<gt>
-
-=head1 COPYRIGHT AND LICENSE
-
-Copyright 2006-2009 by Infinity Interactive, Inc.
-
-L<http://www.iinteractive.com>
-
-This library is free software; you can redistribute it and/or modify
-it under the same terms as Perl itself.
+See L<Moose/BUGS> for details on reporting bugs.
 
 =cut