summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Etheridge <ether@cpan.org>2016-11-10 15:44:38 -0800
committerKaren Etheridge <ether@cpan.org>2016-11-10 17:00:21 -0800
commitc66014146e154391c5367a6e74838f59045020cb (patch)
treea7a50e724f4635de0e2ec5dd6775d8e6701b48d6
parentf13faa875d61f8128155afef8086bebeeec9b03d (diff)
downloadcarton-c66014146e154391c5367a6e74838f59045020cb.tar.gz
switch from JSON to JSON::PP
-rw-r--r--Changes1
-rw-r--r--META.json2
-rw-r--r--Makefile.PL4
-rw-r--r--cpanfile2
-rw-r--r--lib/Carton/Util.pm8
-rw-r--r--xt/cli/json_pp.t2
6 files changed, 10 insertions, 9 deletions
diff --git a/Changes b/Changes
index a0c0300..8c1c818 100644
--- a/Changes
+++ b/Changes
@@ -1,6 +1,7 @@
Revision history for carton
{{$NEXT}}
+ - switched from JSON to JSON::PP
v1.0.28 2016-05-23 22:30:48 PDT
- Emit the line when parser error happened
diff --git a/META.json b/META.json
index 9cfad88..f7b3da5 100644
--- a/META.json
+++ b/META.json
@@ -50,7 +50,7 @@
"CPAN::Meta::Requirements" : "2.121",
"Class::Tiny" : "1.001",
"Getopt::Long" : "2.39",
- "JSON" : "2.53",
+ "JSON::PP" : "2.27300",
"Module::CPANfile" : "0.9031",
"Module::CoreList" : "0",
"Module::Metadata" : "1.000003",
diff --git a/Makefile.PL b/Makefile.PL
index 560603f..945d98b 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -26,7 +26,7 @@ my %WriteMakefileArgs = (
"CPAN::Meta::Requirements" => "2.121",
"Class::Tiny" => "1.001",
"Getopt::Long" => "2.39",
- "JSON" => "2.53",
+ "JSON::PP" => "2.27300",
"Module::CPANfile" => "0.9031",
"Module::CoreList" => 0,
"Module::Metadata" => "1.000003",
@@ -48,7 +48,7 @@ my %FallbackPrereqs = (
"CPAN::Meta::Requirements" => "2.121",
"Class::Tiny" => "1.001",
"Getopt::Long" => "2.39",
- "JSON" => "2.53",
+ "JSON::PP" => "2.27300",
"Module::CPANfile" => "0.9031",
"Module::CoreList" => 0,
"Module::Metadata" => "1.000003",
diff --git a/cpanfile b/cpanfile
index bdaa6cd..d298f19 100644
--- a/cpanfile
+++ b/cpanfile
@@ -4,7 +4,7 @@ on configure => sub {
requires 'perl', '5.8.5';
-requires 'JSON', 2.53;
+requires 'JSON::PP', '2.27300';
requires 'Module::Metadata', 1.000003;
requires 'Module::CPANfile', 0.9031;
diff --git a/lib/Carton/Util.pm b/lib/Carton/Util.pm
index fb5b8cd..c196249 100644
--- a/lib/Carton/Util.pm
+++ b/lib/Carton/Util.pm
@@ -18,14 +18,14 @@ sub dump_json {
}
sub from_json {
- require JSON;
- JSON::decode_json($_[0]);
+ require JSON::PP;
+ JSON::PP->new->utf8->decode($_[0])
}
sub to_json {
my($data) = @_;
- require JSON;
- JSON->new->utf8->pretty->canonical->encode($data);
+ require JSON::PP;
+ JSON::PP->new->utf8->pretty->canonical->encode($data);
}
1;
diff --git a/xt/cli/json_pp.t b/xt/cli/json_pp.t
index 0c64395..5a5859e 100644
--- a/xt/cli/json_pp.t
+++ b/xt/cli/json_pp.t
@@ -8,7 +8,7 @@ plan skip_all => "perl <= 5.14" if $] >= 5.015;
my $app = cli();
$app->write_cpanfile(<<EOF);
-requires 'JSON';
+requires 'JSON::PP';
requires 'CPAN::Meta', '2.12';
EOF