X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FAction%2FSerialize%2FData%2FSerializer.pm;h=4891998d59eb6480ab6ca8bd4cb258c07b5645e7;hb=e4d7f27e77152829ca8cd8f621c6c3b627b0a8b5;hp=a485fced9d8d65a390a891b9042061bf479ef99b;hpb=0a6732c935e687213c53f013d925f35083f8c592;p=catagits%2FCatalyst-Action-Serialize-Data-Serializer.git diff --git a/lib/Catalyst/Action/Serialize/Data/Serializer.pm b/lib/Catalyst/Action/Serialize/Data/Serializer.pm index a485fce..4891998 100644 --- a/lib/Catalyst/Action/Serialize/Data/Serializer.pm +++ b/lib/Catalyst/Action/Serialize/Data/Serializer.pm @@ -6,7 +6,7 @@ use namespace::autoclean; extends 'Catalyst::Action'; use Data::Serializer; -our $VERSION = '1.05'; +our $VERSION = '1.08'; $VERSION = eval $VERSION; sub execute { @@ -16,7 +16,7 @@ sub execute { my $stash_key = ( $controller->{'serialize'} ? $controller->{'serialize'}->{'stash_key'} : - $controller->{'stash_key'} + $controller->{'stash_key'} ) || 'rest'; my $sp = $serializer; $sp =~ s/::/\//g; @@ -37,3 +37,83 @@ sub execute { __PACKAGE__->meta->make_immutable; 1; + +__END__ + +=pod + +=head1 NAME + +Catalyst::Action::Serialize::Data::Serializer - Serialize with Data::Serializer + +=head1 SYNOPSIS + + package MyApp::Controller::Foo; + + use Moose; + use namespace::autoclean; + + BEGIN { extends 'Catalyst::Controller' } + + __PACKAGE__->config( + 'default' => 'text/x-yaml', + 'stash_key' => 'rest', + 'map' => { + 'text/x-yaml' => 'YAML', + 'application/json' => 'JSON', + 'text/x-data-dumper' => [ 'Data::Serializer', 'Data::Dumper' ], + }, + ); + +=head1 DESCRIPTION + +This module implements a serializer for use with C and others. It +was factored out of L because it is unlikely to be +widely used and tends to break tests, be insecure, and is generally weird. Use +at your own risk. + +=head1 AUTHOR + +Adam Jacob Eadam@stalecoffee.orgE, with lots of help from mst and jrockway + +Marchex, Inc. paid me while I developed this module. (L) + +=head1 CONTRIBUTORS + +Tomas Doran (t0m) Ebobtfish@bobtfish.netE + +John Goulah + +Christopher Laco + +Daisuke Maki Edaisuke@endeworks.jpE + +Hans Dieter Pearcey + +Brian Phillips Ebphillips@cpan.orgE + +Dave Rolsky Eautarch@urth.orgE + +Luke Saunders + +Arthur Axel "fREW" Schmidt Efrioux@gmail.comE + +J. Shirley Ejshirley@gmail.comE + +Gavin Henry Eghenry@surevoip.co.ukE + +Gerv http://www.gerv.net/ + +Colin Newell + +Wallace Reis Ewreis@cpan.orgE + +=head1 COPYRIGHT + +Copyright (c) 2006-2013 the above named AUTHOR and CONTRIBUTORS + +=head1 LICENSE + +You may distribute this code under the same terms as Perl itself. + +=cut