X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FRole%2FApplication%2FRoleSummation.pm;h=7487d82df4adbc58465f690a5fdcb281a1cbf0c9;hb=87e636262bb48cefaaa4f30504deec928fd38513;hp=ee4c1c1369ca518bc9b93fd3fb3948fba7f90cf5;hpb=c7d8fe950098e91780355ed7a91f066e682eb4a3;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/Role/Application/RoleSummation.pm b/lib/Moose/Meta/Role/Application/RoleSummation.pm index ee4c1c1..7487d82 100644 --- a/lib/Moose/Meta/Role/Application/RoleSummation.pm +++ b/lib/Moose/Meta/Role/Application/RoleSummation.pm @@ -4,13 +4,11 @@ use strict; use warnings; use metaclass; -use Carp 'confess'; use Scalar::Util 'blessed'; -use Data::Dumper; use Moose::Meta::Role::Composite; -our $VERSION = '0.55_02'; +our $VERSION = '0.57'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; @@ -73,7 +71,7 @@ sub check_role_exclusions { foreach my $role (@{$c->get_roles}) { foreach my $excluded (@all_excluded_roles) { - confess "Conflict detected: " . $role->name . " excludes role '" . $excluded . "'" + Moose->throw_error("Conflict detected: " . $role->name . " excludes role '" . $excluded . "'") if $role->does_role($excluded); } } @@ -120,8 +118,8 @@ sub apply_attributes { my %seen; foreach my $attr (@all_attributes) { if (exists $seen{$attr->{name}}) { - confess "We have encountered an attribute conflict with '" . $attr->{name} . "' " - . "during composition. This is fatal error and cannot be disambiguated." + Moose->throw_error("We have encountered an attribute conflict with '" . $attr->{name} . "' " + . "during composition. This is fatal error and cannot be disambiguated.") if $seen{$attr->{name}} != $attr->{attr}; } $seen{$attr->{name}} = $attr->{attr}; @@ -172,7 +170,7 @@ sub apply_methods { $method_map{$method->{name}} = $method->{method}; } - $c->alias_method($_ => $method_map{$_}) for keys %method_map; + $c->add_method($_ => $method_map{$_}) for keys %method_map; } sub apply_override_method_modifiers { @@ -190,14 +188,14 @@ sub apply_override_method_modifiers { my %seen; foreach my $override (@all_overrides) { - confess "Role '" . $c->name . "' has encountered an 'override' method conflict " . + Moose->throw_error( "Role '" . $c->name . "' has encountered an 'override' method conflict " . "during composition (A local method of the same name as been found). This " . - "is fatal error." + "is fatal error." ) if $c->has_method($override->{name}); if (exists $seen{$override->{name}}) { - confess "We have encountered an 'override' method conflict during " . + Moose->throw_error( "We have encountered an 'override' method conflict during " . "composition (Two 'override' methods of the same name encountered). " . - "This is fatal error." + "This is fatal error.") if $seen{$override->{name}} != $override->{method}; } $seen{$override->{name}} = $override->{method};