fix for compat with Moose 1.25
Dave Rolsky [Wed, 13 Apr 2011 19:14:15 +0000 (14:14 -0500)]
lib/MooseX/StrictConstructor.pm
lib/MooseX/StrictConstructor/Trait/Class.pm

index e7cfda2..c68d279 100644 (file)
@@ -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(
index c6865c6..579b6c2 100644 (file)
@@ -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.