From: Dave Rolsky Date: Wed, 13 Apr 2011 19:14:15 +0000 (-0500) Subject: fix for compat with Moose 1.25 X-Git-Tag: v0.15~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0dc0aea2e2ce6e27b488b6e6d304c5ab19649745;p=gitmo%2FMooseX-StrictConstructor.git fix for compat with Moose 1.25 --- diff --git a/lib/MooseX/StrictConstructor.pm b/lib/MooseX/StrictConstructor.pm index e7cfda2..c68d279 100644 --- a/lib/MooseX/StrictConstructor.pm +++ b/lib/MooseX/StrictConstructor.pm @@ -9,19 +9,13 @@ use Moose::Util::MetaRole; use MooseX::StrictConstructor::Role::Object; { - my %class_meta; + my %class_meta = ( class => ['MooseX::StrictConstructor::Trait::Class'] ); + if ( $Moose::VERSION < 1.9900 ) { require MooseX::StrictConstructor::Trait::Method::Constructor; - %class_meta = ( - constructor => [ - 'MooseX::StrictConstructor::Trait::Method::Constructor'] - ); - } - else { - require MooseX::StrictConstructor::Trait::Class; - %class_meta - = ( class => ['MooseX::StrictConstructor::Trait::Class'] ); + $class_meta{constructor} + = ['MooseX::StrictConstructor::Trait::Method::Constructor']; } Moose::Exporter->setup_import_methods( diff --git a/lib/MooseX/StrictConstructor/Trait/Class.pm b/lib/MooseX/StrictConstructor/Trait/Class.pm index c6865c6..579b6c2 100644 --- a/lib/MooseX/StrictConstructor/Trait/Class.pm +++ b/lib/MooseX/StrictConstructor/Trait/Class.pm @@ -27,7 +27,7 @@ around '_inline_BUILDALL' => sub { 'Moose->throw_error("Found unknown attribute(s) passed to the constructor: @bad");', '}', ); -}; +} if $Moose::VERSION >= 1.9900; # If the base class role is applied first, and then a superclass is added, we # lose the role.