Committing switch from NEXT to MRO::Compat.
[catagits/Catalyst-Action-Serialize-Data-Serializer.git] / lib / Catalyst / Controller / REST.pm
index 9ad724a..737cb13 100644 (file)
@@ -1,6 +1,6 @@
 package Catalyst::Controller::REST;
 
-our $VERSION = '0.65';
+our $VERSION = '0.71';
 
 =head1 NAME
 
@@ -107,7 +107,7 @@ installed.
 
 In addition, each serializer has it's quirks in terms of what sorts of data
 structures it will properly handle.  L<Catalyst::Controller::REST> makes
-no attempt to svae you from yourself in this regard. :) 
+no attempt to save you from yourself in this regard. :) 
 
 =over 2
 
@@ -120,9 +120,11 @@ Returns YAML generated by L<YAML::Syck>.
 This uses L<YAML::Syck> and L<URI::Find> to generate YAML with all URLs turned
 to hyperlinks.  Only useable for Serialization.
 
-=item C<text/x-json> => C<JSON::Syck>
+=item C<application/json> => C<JSON>
 
-Uses L<JSON::Syck> to generate JSON output
+Uses L<JSON> to generate JSON output.  It is strongly advised to also have 
+L<JSON::XS> installed.  The C<text/x-json> content type is supported but is
+deprecated and you will receive warnings in your log.
 
 =item C<text/x-data-dumper> => C<Data::Serializer>
 
@@ -215,28 +217,26 @@ use Params::Validate qw(SCALAR OBJECT);
 __PACKAGE__->mk_accessors(qw(serialize));
 
 __PACKAGE__->config(
-        'stash_key' => 'rest',
-        'map'       => {
-            'text/html'          => 'YAML::HTML',
-            'text/xml'           => 'XML::Simple',
-            'text/x-yaml'        => 'YAML',
-            'application/json'   => 'JSON',
-            'text/x-json'        => 'JSON',
-            'text/x-data-dumper' => [ 'Data::Serializer', 'Data::Dumper' ],
-            'text/x-data-denter' => [ 'Data::Serializer', 'Data::Denter' ],
-            'text/x-data-taxi'   => [ 'Data::Serializer', 'Data::Taxi'   ],
-            'application/x-storable'    => [ 'Data::Serializer', 'Storable'     ],
-            'application/x-freezethaw'  => [ 'Data::Serializer', 'FreezeThaw'   ],
-            'text/x-config-general' => [ 'Data::Serializer', 'Config::General' ],
-            'text/x-php-serialization' => [ 'Data::Serializer', 'PHP::Serialization' ],
-        },
+    'stash_key' => 'rest',
+    'map'       => {
+        'text/html'          => 'YAML::HTML',
+        'text/xml'           => 'XML::Simple',
+        'text/x-yaml'        => 'YAML',
+        'application/json'   => 'JSON',
+        'text/x-json'        => 'JSON',
+        'text/x-data-dumper' => [ 'Data::Serializer', 'Data::Dumper' ],
+        'text/x-data-denter' => [ 'Data::Serializer', 'Data::Denter' ],
+        'text/x-data-taxi'   => [ 'Data::Serializer', 'Data::Taxi'   ],
+        'application/x-storable'    => [ 'Data::Serializer', 'Storable'     ],
+        'application/x-freezethaw'  => [ 'Data::Serializer', 'FreezeThaw'   ],
+        'text/x-config-general' => [ 'Data::Serializer', 'Config::General' ],
+        'text/x-php-serialization' => [ 'Data::Serializer', 'PHP::Serialization' ],
+    },
 );
 
-sub begin : ActionClass('Deserialize') {
-}
+sub begin : ActionClass('Deserialize') { }
 
-sub end : ActionClass('Serialize') {
-}
+sub end : ActionClass('Serialize') { }
 
 =item status_ok
 
@@ -442,25 +442,27 @@ L<Catalyst::Action::Serialize>.
 The C<begin> method uses L<Catalyst::Action::Deserialize>.  The C<end>
 method uses L<Catalyst::Action::Serialize>.  If you want to override
 either behavior, simply implement your own C<begin> and C<end> actions
-and use NEXT:
+and use MRO::Compat:
 
   my Foo::Controller::Monkey;
   use base qw(Catalyst::Controller::REST);
 
   sub begin :Private {
     my ($self, $c) = @_;
-    ... do things before Deserializing ...
-    $self->NEXT::begin($c); 
+    ... do things before Deserializing ...    
+    $self->maybe::next::method($c);    
     ... do things after Deserializing ...
   } 
 
   sub end :Private {
     my ($self, $c) = @_;
-    ... do things before Serializing ...
-    $self->NEXT::end($c); 
+    ... do things before Serializing ...    
+    $self->maybe::next::method($c);
     ... do things after Serializing ...
   }
 
+=back
+
 =head1 A MILD WARNING
 
 I have code in production using L<Catalyst::Controller::REST>.  That said,
@@ -486,6 +488,10 @@ Adam Jacob <adam@stalecoffee.org>, with lots of help from mst and jrockway
 
 Marchex, Inc. paid me while I developed this module.  (http://www.marchex.com)
 
+=head1 MAINTAINER
+
+J. Shirley <jshirley@cpan.org>
+
 =head1 LICENSE
 
 You may distribute this code under the same terms as Perl itself.