Use inline_as instead of the deprecated optimize_as
Dagfinn Ilmari Mannsåker [Tue, 22 Nov 2011 14:45:15 +0000 (14:45 +0000)]
Changes
Makefile.PL
lib/MooseX/Types/DateTime.pm

diff --git a/Changes b/Changes
index c302398..bf14899 100755 (executable)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,6 @@
+
+        - Use inline_as instead of the deprecated optimize_as
+
 0.05
                - Merged the two 0.04 releases
 
index a6818d6..19377cc 100644 (file)
@@ -11,7 +11,7 @@ WriteMakefile(
     SIGN         => 1,
     PL_FILES     => { },
     PREREQ_PM => {
-        'Moose'              => '0.41', # class_type
+        'Moose'              => '2.0100', # inline_as
         'DateTime'           => '0.4302',
         'DateTime::Locale'   => '0.4001',
         'DateTime::TimeZone' => '0.95',
index f2fc626..756dab9 100644 (file)
@@ -30,9 +30,9 @@ subtype Locale,   as 'DateTime::Locale';
 subtype( Now,
     as Str,
     where { $_ eq 'now' },
-    Moose::Util::TypeConstraints::optimize_as {
-        no warnings 'uninitialized';
-        !ref($_[0]) and $_[0] eq 'now';
+    Moose::Util::TypeConstraints::inline_as {
+        'no warnings "uninitialized";'.
+        '!ref(' . $_[1] . ') and '. $_[1] .' eq "now"';
     },
 );