bump version to 0.81
[gitmo/Moose.git] / lib / Moose / Meta / Role / Application / ToRole.pm
index f5bdb39..c0c8190 100644 (file)
@@ -6,16 +6,16 @@ use metaclass;
 
 use Scalar::Util    'blessed';
 
-our $VERSION   = '0.75_01';
+our $VERSION   = '0.81';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 
 use base 'Moose::Meta::Role::Application';
 
 sub apply {
-    my ($self, $role1, $role2) = @_;    
-    $self->SUPER::apply($role1, $role2);   
-    $role2->add_role($role1);     
+    my ($self, $role1, $role2) = @_;
+    $self->SUPER::apply($role1, $role2);
+    $role2->add_role($role1);
 }
 
 sub check_role_exclusions {
@@ -35,17 +35,18 @@ sub check_role_exclusions {
 
 sub check_required_methods {
     my ($self, $role1, $role2) = @_;
-    foreach my $required_method_name ($role1->get_required_method_list) {
-            
+    foreach my $required_method ($role1->get_required_method_list) {
+        my $required_method_name = $required_method->name;
+
         next if $self->is_aliased_method($required_method_name);
-                    
-        $role2->add_required_methods($required_method_name)
+
+        $role2->add_required_methods($required_method)
             unless $role2->find_method_by_name($required_method_name);
     }
 }
 
 sub check_required_attributes {
-    
+
 }
 
 sub apply_attributes {
@@ -95,17 +96,20 @@ sub apply_methods {
             }
 
             next;
-        }     
-        
-        next if $self->is_method_excluded($method_name);           
-        
+        }
+
+        next if $self->is_method_excluded($method_name);
+
         # it if it has one already
         if ($role2->has_method($method_name) &&
             # and if they are not the same thing ...
             $role2->get_method($method_name)->body != $role1->get_method($method_name)->body) {
             # method conflicts between roles result
             # in the method becoming a requirement
-            $role2->add_required_methods($method_name);
+            $role2->add_conflicting_method(
+                name  => $method_name,
+                roles => [$role1->name, $role2->name],
+            );
         }
         else {
             # add it, although it could be overridden
@@ -113,9 +117,9 @@ sub apply_methods {
                 $method_name,
                 $role1->get_method($method_name)
             );
-                        
+
         }
-        
+
     }
 }