Switch from JSON to JSON::MaybeXS to get a better choice of JSON parsers.
Matt S Trout [Wed, 10 Sep 2014 15:57:32 +0000 (15:57 +0000)]
Changes
cpanfile
lib/Catalyst/Action/Deserialize/JSON.pm
lib/Catalyst/Action/Serialize/JSON.pm
t/json.t
t/jsonp.t

diff --git a/Changes b/Changes
index 9b5529e..d102d0e 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,6 +1,7 @@
 Revision history for {{$dist->name}}
 
 {{$NEXT}}
+ * Switch from JSON to JSON::MaybeXS to get a better choice of JSON parsers.
 
 1.15      2014-05-07 09:02:44-05:00 CST6CDT
 
index fe61015..bb932cf 100644 (file)
--- a/cpanfile
+++ b/cpanfile
@@ -17,8 +17,8 @@ suggests 'Config::General';
 suggests 'Data::Taxi';
 suggests 'FreezeThaw';
 suggests 'HTML::Parser';
-suggests 'JSON';
-suggests 'JSON::XS';
+suggests 'JSON::MaybeXS';
+suggests 'Cpanel::JSON::XS';
 suggests 'PHP::Serialization';
 suggests 'XML::Simple';
 suggests 'YAML::Syck';
index c47d1b8..aab0af6 100644 (file)
@@ -5,7 +5,7 @@ use namespace::autoclean;
 use Scalar::Util qw(openhandle);
 
 extends 'Catalyst::Action';
-use JSON;
+use JSON::MaybeXS qw(JSON);
 
 # VERSION
 
index 7d29679..127014e 100644 (file)
@@ -4,7 +4,7 @@ use Moose;
 use namespace::autoclean;
 
 extends 'Catalyst::Action';
-use JSON ();
+use JSON::MaybeXS qw(JSON);
 
 # VERSION
 
index 6fb6046..7c8cc03 100644 (file)
--- a/t/json.t
+++ b/t/json.t
@@ -2,15 +2,12 @@ use strict;
 use warnings;
 use Test::More;
 use FindBin;
+use Test::Requires qw(JSON::MaybeXS);
 
 use lib ("$FindBin::Bin/lib", "$FindBin::Bin/../lib");
 use Test::Rest;
 use utf8;
 
-eval 'use JSON 2.12';
-plan skip_all => 'Install JSON 2.12 or later to run this test' if ($@);
-
-
 use_ok 'Catalyst::Test', 'Test::Serialize';
 
 my $json = JSON->new->utf8;
index f5b884a..015ee51 100644 (file)
--- a/t/jsonp.t
+++ b/t/jsonp.t
@@ -2,15 +2,12 @@ use strict;
 use warnings;
 use Test::More;
 use FindBin;
+use Test::Requires qw(JSON::MaybeXS);
 
 use lib ("$FindBin::Bin/lib", "$FindBin::Bin/../lib");
 use Test::Rest;
 use utf8;
 
-eval 'use JSON 2.12';
-plan skip_all => 'Install JSON 2.12 or later to run this test' if ($@);
-
-
 use_ok 'Catalyst::Test', 'Test::Serialize', 'Catalyst::Action::Serialize::JSON';
 
 my $json = JSON->new->utf8;