From: Guillermo Roditi Date: Tue, 22 Jan 2008 19:14:22 +0000 (+0000) Subject: 0.0007 changes X-Git-Tag: 0.0007^0 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0e16871fa8fd7fc06f35e6777d916bd101459606;p=gitmo%2FMooseX-Object-Pluggable.git 0.0007 changes --- diff --git a/Changes b/Changes index 93d335d..a6c8a7a 100644 --- a/Changes +++ b/Changes @@ -1,4 +1,7 @@ Revision history for MooseX-Object-Pluggable +0.0007 Jan 22, 2008 + Fix for Moose 0.34 + 0.0006 Jan 11, 2008 Deprecate the Extension mechanism Added load_plugins diff --git a/lib/MooseX/Object/Pluggable.pm b/lib/MooseX/Object/Pluggable.pm index 0927281..04d9eb5 100644 --- a/lib/MooseX/Object/Pluggable.pm +++ b/lib/MooseX/Object/Pluggable.pm @@ -5,7 +5,7 @@ use Moose::Role; use Class::MOP; use Module::Pluggable::Object; -our $VERSION = '0.0006'; +our $VERSION = '0.0007'; =head1 NAME @@ -281,16 +281,14 @@ sub _load_and_apply_role{ my ($self, $role) = @_; die("You must provide a role name") unless $role; - #don't re-require... - unless( Class::MOP::is_class_loaded($role) ){ - eval Class::MOP::load_class($role) || die("Failed to load role: $role"); - } + eval { Class::MOP::load_class($role) }; + confess("Failed to load role: ${role} $@") if $@; carp("Using 'override' is strongly discouraged and may not behave ". "as you expect it to. Please use 'around'") if scalar keys %{ $role->meta->get_override_method_modifiers_map }; - die("Failed to apply plugin: $role") unless $role->meta->apply( $self ); + $role->meta->apply( $self ); return 1; }