Merge remote branch 'hobbs/rework-serializer-return-2'
Tomas Doran [Sat, 19 Dec 2009 14:42:20 +0000 (14:42 +0000)]
* hobbs/rework-serializer-return-2:
  Add tests for Serialize::View error behavior
  Add some real error-handling for Serialize::View
  View is halfway there. Do we want to poke in $c->error? Maybe not.
  Port Serialize classes except for View.
  Change Serialize::execute to expect serializers to throw an exception

Changes
lib/Catalyst/Action/REST.pm

diff --git a/Changes b/Changes
index 7294f8d..0980323 100644 (file)
--- a/Changes
+++ b/Changes
@@ -3,6 +3,8 @@
   Change Catalyst::Request::REST to be a mostly empty class, with
   all the functionality in Catalyst::TraitFor::Request::REST
 
+  Simplify _get_allowed_methods method (aristotle)
+
 Fri 11 Dec 01:08:00 GMT 2009 - Release 0.79
 
   Cope with invalid (missing required q parameter) header like:
index 27705fc..68ed90a 100644 (file)
@@ -125,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 {