X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Action-REST.git;a=blobdiff_plain;f=lib%2FCatalyst%2FAction%2FDeserialize%2FYAML.pm;h=e84ccc6bab3612f415cf83fbce87b6cf507ca7f3;hp=84630f40c5c16412d252abba3c12fe7fcf3846ca;hb=3bb36dcaabf34fef5c15b1bb74c5eb198a7f5168;hpb=e601addaf89882fccbc824c1a53328f0d049b32b diff --git a/lib/Catalyst/Action/Deserialize/YAML.pm b/lib/Catalyst/Action/Deserialize/YAML.pm index 84630f4..e84ccc6 100644 --- a/lib/Catalyst/Action/Deserialize/YAML.pm +++ b/lib/Catalyst/Action/Deserialize/YAML.pm @@ -1,18 +1,14 @@ -# -# Catlyst::Action::Deserialize::YAML.pm -# Created by: Adam Jacob, Marchex, -# Created on: 10/12/2006 03:00:32 PM PDT -# -# $Id$ - package Catalyst::Action::Deserialize::YAML; -use strict; -use warnings; +use Moose; +use namespace::autoclean; -use base 'Catalyst::Action'; +extends 'Catalyst::Action'; use YAML::Syck; +our $VERSION = '0.82'; +$VERSION = eval $VERSION; + sub execute { my $self = shift; my ( $controller, $c, $test ) = @_; @@ -21,7 +17,8 @@ sub execute { if ($body) { my $rdata; eval { - $rdata = LoadFile( $c->request->body ); + my $body = $c->request->body; + $rdata = LoadFile( "$body" ); }; if ($@) { return $@; @@ -29,7 +26,8 @@ sub execute { $c->request->data($rdata); } else { $c->log->debug( - 'I would have deserialized, but there was nothing in the body!'); + 'I would have deserialized, but there was nothing in the body!') + if $c->debug; } return 1; }