X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FRole%2FApplication%2FRoleSummation.pm;h=d7afd4d4525eed7f3f008f40ba759c7205ecb32f;hb=74397c13ad55fc865db34721aed512d4f605fadf;hp=6842781439ae1f47afcdb98ae675b65f8d5feb32;hpb=df8260e9a27a9d7532a21525223975fcf8e26562;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/Role/Application/RoleSummation.pm b/lib/Moose/Meta/Role/Application/RoleSummation.pm index 6842781..d7afd4d 100644 --- a/lib/Moose/Meta/Role/Application/RoleSummation.pm +++ b/lib/Moose/Meta/Role/Application/RoleSummation.pm @@ -8,7 +8,7 @@ use Scalar::Util 'blessed'; use Moose::Meta::Role::Composite; -our $VERSION = '0.63'; +our $VERSION = '0.75_01'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; @@ -79,6 +79,8 @@ sub check_role_exclusions { next unless $role->does_role($excluded); my @excluding = @{ $excluded_roles{$excluded} }; + + require Moose; Moose->throw_error(sprintf "Conflict detected: Role%s %s exclude%s role '%s'", (@excluding == 1 ? '' : 's'), join(', ', @excluding), (@excluding == 1 ? 's' : ''), $excluded); } } @@ -125,9 +127,11 @@ sub apply_attributes { my %seen; foreach my $attr (@all_attributes) { if (exists $seen{$attr->{name}}) { - 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}; + if ( $seen{$attr->{name}} != $attr->{attr} ) { + require Moose; + Moose->throw_error("We have encountered an attribute conflict with '" . $attr->{name} . "' " + . "during composition. This is fatal error and cannot be disambiguated.") + } } $seen{$attr->{name}} = $attr->{attr}; } @@ -195,15 +199,19 @@ sub apply_override_method_modifiers { my %seen; foreach my $override (@all_overrides) { - 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." ) - if $c->has_method($override->{name}); + if ( $c->has_method($override->{name}) ){ + require Moose; + 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." ) + } if (exists $seen{$override->{name}}) { - Moose->throw_error( "We have encountered an 'override' method conflict during " . - "composition (Two 'override' methods of the same name encountered). " . - "This is fatal error.") - if $seen{$override->{name}} != $override->{method}; + if ( $seen{$override->{name}} != $override->{method} ) { + require Moose; + Moose->throw_error( "We have encountered an 'override' method conflict during " . + "composition (Two 'override' methods of the same name encountered). " . + "This is fatal error.") + } } $seen{$override->{name}} = $override->{method}; } @@ -293,7 +301,7 @@ Stevan Little Estevan@iinteractive.comE =head1 COPYRIGHT AND LICENSE -Copyright 2006-2008 by Infinity Interactive, Inc. +Copyright 2006-2009 by Infinity Interactive, Inc. L