X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FAction%2FDeserialize%2FYAML.pm;h=439c6e6766f4836def7ea011565cae81cc177ea1;hb=96a61a601b093754a99bb61b57e41dbfc3228ad7;hp=84630f40c5c16412d252abba3c12fe7fcf3846ca;hpb=e601addaf89882fccbc824c1a53328f0d049b32b;p=catagits%2FCatalyst-Action-REST.git diff --git a/lib/Catalyst/Action/Deserialize/YAML.pm b/lib/Catalyst/Action/Deserialize/YAML.pm index 84630f4..439c6e6 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.84'; +$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; }