X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FAction%2FREST.pm;h=a525ed6013f34cae557d8b9b77d4035512cfba5a;hb=a400ef8b6bb950a4fb6d17e20d912d920370549a;hp=7ddf629128c57746ddb5d2fbf9a81f2dea60b111;hpb=eaa7cec1399ed978f8a8083c34283ba9601edcc1;p=catagits%2FCatalyst-Action-REST.git diff --git a/lib/Catalyst/Action/REST.pm b/lib/Catalyst/Action/REST.pm index 7ddf629..a525ed6 100644 --- a/lib/Catalyst/Action/REST.pm +++ b/lib/Catalyst/Action/REST.pm @@ -1,23 +1,16 @@ -# -# REST.pm -# Created by: Adam Jacob, Marchex, -# Created on: 10/12/2006 03:00:32 PM PDT -# -# $Id$ - package Catalyst::Action::REST; -use strict; -use warnings; +use Moose; +use namespace::autoclean; -use base 'Catalyst::Action'; +extends 'Catalyst::Action'; use Class::Inspector; use Catalyst::Request::REST; use Catalyst::Controller::REST; BEGIN { require 5.008001; } -our $VERSION = '0.78'; +our $VERSION = '0.80'; $VERSION = eval $VERSION; sub new { @@ -132,14 +125,8 @@ sub dispatch { sub _get_allowed_methods { my ( $self, $controller, $c, $name ) = @_; my $class = ref($controller) ? ref($controller) : $controller; - my $methods = Class::Inspector->methods($class); - my @allowed; - foreach my $method ( @{$methods} ) { - if ( $method =~ /^$name\_(.+)$/ ) { - push( @allowed, $1 ); - } - } - return @allowed; + my $methods = Class::Inspector->methods($class); + return map { /^$name\_(.+)$/ } @$methods; }; sub _return_options { @@ -185,12 +172,18 @@ one of the accepted return formats. You can do this by setting it in your query accepted return formats. You can do this by setting it in your query string thusly: C<< ?content-type=application%2Fjson (where %2F == / uri escaped). >> -B Apache will refuse %2F unless configured otherise. -Make sure C<< AllowEncodedSlashes On >> is in your httpd.conf file in orde +B Apache will refuse %2F unless configured otherwise. +Make sure C is in your httpd.conf file in order for this to run smoothly. =back +=head1 AUTHOR + +Adam Jacob , with lots of help from mst and jrockway + +Marchex, Inc. paid me while I developed this module. (L) + =head1 CONTRIBUTORS Arthur Axel "fREW" Schmidt @@ -209,11 +202,9 @@ Hans Dieter Pearcey Tomas Doran (t0m) -=head1 AUTHOR - -Adam Jacob , with lots of help from mst and jrockway +=head1 COPYRIGHT -Marchex, Inc. paid me while I developed this module. (L) +Copyright the above named AUTHOR and CONTRIBUTORS =head1 LICENSE