From: Dave Rolsky Date: Wed, 23 Feb 2011 03:47:51 +0000 (-0600) Subject: style tweaking X-Git-Tag: v0.13~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7815dbf469598fee15cf3e076b0de4e4eca15311;p=gitmo%2FMooseX-StrictConstructor.git style tweaking --- diff --git a/lib/MooseX/StrictConstructor.pm b/lib/MooseX/StrictConstructor.pm index e024686..75d6eb3 100644 --- a/lib/MooseX/StrictConstructor.pm +++ b/lib/MooseX/StrictConstructor.pm @@ -7,17 +7,28 @@ use Moose 0.94 (); use Moose::Exporter; use Moose::Util::MetaRole; use MooseX::StrictConstructor::Role::Object; -use MooseX::StrictConstructor::Role::Meta::Class; -use MooseX::StrictConstructor::Role::Meta::Method::Constructor; - -Moose::Exporter->setup_import_methods( - class_metaroles => { - ($Moose::VERSION >= 1.9900 - ? (class => ['MooseX::StrictConstructor::Role::Meta::Class']) - : (constructor => ['MooseX::StrictConstructor::Role::Meta::Method::Constructor'])), - }, - base_class_roles => ['MooseX::StrictConstructor::Role::Object'], -); + +{ + my %class_meta; + + if ( $Moose::VERSION < 1.9900 ) { + require MooseX::StrictConstructor::Role::Meta::Method::Constructor; + %class_meta = ( + constructor => [ + 'MooseX::StrictConstructor::Role::Meta::Method::Constructor'] + ); + } + else { + require MooseX::StrictConstructor::Role::Meta::Class; + %class_meta + = ( class => ['MooseX::StrictConstructor::Role::Meta::Class'] ); + } + + Moose::Exporter->setup_import_methods( + class_metaroles => \%class_meta, + base_class_roles => ['MooseX::StrictConstructor::Role::Object'], + ); +} 1;