Changing from JSON::Syck to JSON and JSON::XS
jshirley [Wed, 9 Jul 2008 18:18:00 +0000 (18:18 +0000)]
Changelog
Makefile.PL
lib/Catalyst/Action/Deserialize/JSON.pm
lib/Catalyst/Action/REST.pm
lib/Catalyst/Action/Serialize/JSON.pm
lib/Catalyst/Controller/REST.pm

index 1e1efe9..8a025e9 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -1,3 +1,7 @@
+Wed Jul 09 11:16:00 PST 2008 (jshirley) - Release 0.63
+  Changing from JSON::Syck to JSON/JSON::XS
+  Refactored tests to be more applicable to current state of affairs
+
 Wed Jul 02 07:53:00 PST 2008 (jshirley) - Release 0.62
   Reshipping with current Module::Install included due to error reports
     about failed installs
index 70297f9..f5609ce 100644 (file)
@@ -15,6 +15,11 @@ requires('Class::Inspector'          => '1.13');
 requires('URI::Find'                 => undef);
 requires('Data::Dump'                => undef);
 
+feature 'JSON (application/json) support',
+    -default   => 0,
+    'JSON'     => undef;
+    'JSON::XS' => undef;
+
 feature 'Data::Denter (text/x-data-denter) support',
     -default => 0,
     'Data::Denter' => undef;
index 82002df..f4bf2e4 100644 (file)
@@ -11,7 +11,7 @@ use strict;
 use warnings;
 
 use base 'Catalyst::Action';
-use JSON::Syck;
+use JSON qw( decode_json );
 
 sub execute {
     my $self = shift;
@@ -27,7 +27,7 @@ sub execute {
     }
 
     if ( $rbody ) {
-        my $rdata = eval { JSON::Syck::Load( $rbody ); };
+        my $rdata = eval { decode_json( $rbody ) };
         if ($@) {
             return $@;
         }
index 9b20e55..72ff6c4 100644 (file)
@@ -14,10 +14,12 @@ use base 'Catalyst::Action';
 use Class::Inspector;
 use Catalyst;
 use Catalyst::Request::REST;
+use Catalyst::Controller::REST;
+
 use 5.8.1;
 
 our
-   $VERSION = '0.62';
+   $VERSION = $Catalyst::Controller::REST::VERSION;
 
 # This is wrong in several ways. First, there's no guarantee that
 # Catalyst.pm has not been subclassed. Two, there's no guarantee that
index 2a65e2c..9e34a26 100644 (file)
@@ -11,7 +11,7 @@ use strict;
 use warnings;
 
 use base 'Catalyst::Action';
-use JSON::Syck;
+use JSON qw(encode_json);
 
 sub execute {
     my $self = shift;
@@ -24,7 +24,7 @@ sub execute {
         ) || 'rest';
     my $output;
     eval {
-        $output = JSON::Syck::Dump($c->stash->{$stash_key});
+        $output = encode_json( $c->stash->{$stash_key} );
     };
     if ($@) {
         return $@;
index ef954a7..a44849d 100644 (file)
@@ -1,6 +1,6 @@
 package Catalyst::Controller::REST;
 
-our $VERSION = 0.62;
+our $VERSION = 0.63;
 
 =head1 NAME