[Catalyst-commits] r7348 - in Catalyst-Action-REST/0.60/trunk: . lib/Catalyst/Action lib/Catalyst/Action/Deserialize/Data lib/Catalyst/Action/Deserialize/XML lib/Catalyst/Action/Serialize/XML lib/Catalyst/Controller

claco at dev.catalyst.perl.org claco at dev.catalyst.perl.org
Fri Jan 4 00:47:30 GMT 2008


Author: claco
Date: 2008-01-04 00:47:29 +0000 (Fri, 04 Jan 2008)
New Revision: 7348

Modified:
   Catalyst-Action-REST/0.60/trunk/
   Catalyst-Action-REST/0.60/trunk/Changelog
   Catalyst-Action-REST/0.60/trunk/lib/Catalyst/Action/Deserialize/Data/Serializer.pm
   Catalyst-Action-REST/0.60/trunk/lib/Catalyst/Action/Deserialize/XML/Simple.pm
   Catalyst-Action-REST/0.60/trunk/lib/Catalyst/Action/REST.pm
   Catalyst-Action-REST/0.60/trunk/lib/Catalyst/Action/Serialize/XML/Simple.pm
   Catalyst-Action-REST/0.60/trunk/lib/Catalyst/Action/SerializeBase.pm
   Catalyst-Action-REST/0.60/trunk/lib/Catalyst/Controller/REST.pm
Log:
 r1144 at mbp:  claco | 2008-01-03 19:43:42 -0500
 Fixed RT#30498 - REST controller references Catalyst without loading it first.
 Fixed RT#32042 - Import of Params::Validate :all plays badly with subclasses that have their own validate()
 Fixed RT#30456 - Debug messages print even with debugging disabled



Property changes on: Catalyst-Action-REST/0.60/trunk
___________________________________________________________________
Name: svk:merge
   - 30504762-a21f-0410-86fe-fb543316e637:/local/Catalyst-Action-REST:70
   + 30504762-a21f-0410-86fe-fb543316e637:/local/Catalyst-Action-REST:70
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Action-REST/0.50/trunk:7341
58586828-bfeb-4a8b-ac3c-3302daf284f8:/local/Catalyst-Action-REST/0.60/trunk:1144

Modified: Catalyst-Action-REST/0.60/trunk/Changelog
===================================================================
--- Catalyst-Action-REST/0.60/trunk/Changelog	2008-01-03 23:50:18 UTC (rev 7347)
+++ Catalyst-Action-REST/0.60/trunk/Changelog	2008-01-04 00:47:29 UTC (rev 7348)
@@ -1,6 +1,13 @@
+Thu Jan  3 19:42:16 EST 2008
+	Fixed RT#30498 - REST controller references Catalyst without
+	  loading it first.
+	Fixed RT#32042 - Import of Params::Validate :all plays badly
+	  with subclasses that have their own validate()
+	Fixed RT#30456 - Debug messages print even with debugging disabled
+
 Thu Jan  3 08:54:09 PST 2008
 	Fixed an issue where YAML::Syck versions 0.92 require $c->request->body to
-	be stringified
+	  be stringified
 
 Fri Dec 21 15:23:46 EDT 2007
 	Updated the configuration specifiers to operate more in line with the way

Modified: Catalyst-Action-REST/0.60/trunk/lib/Catalyst/Action/Deserialize/Data/Serializer.pm
===================================================================
--- Catalyst-Action-REST/0.60/trunk/lib/Catalyst/Action/Deserialize/Data/Serializer.pm	2008-01-03 23:50:18 UTC (rev 7347)
+++ Catalyst-Action-REST/0.60/trunk/lib/Catalyst/Action/Deserialize/Data/Serializer.pm	2008-01-04 00:47:29 UTC (rev 7348)
@@ -24,7 +24,8 @@
         require $sp
     };
     if ($@) {
-        $c->log->debug("Could not load $serializer, refusing to serialize: $@");
+        $c->log->debug("Could not load $serializer, refusing to serialize: $@")
+            if $c->debug;
         return 0;
     }
     my $body = $c->request->body;
@@ -48,7 +49,8 @@
         $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;
 }

Modified: Catalyst-Action-REST/0.60/trunk/lib/Catalyst/Action/Deserialize/XML/Simple.pm
===================================================================
--- Catalyst-Action-REST/0.60/trunk/lib/Catalyst/Action/Deserialize/XML/Simple.pm	2008-01-03 23:50:18 UTC (rev 7347)
+++ Catalyst-Action-REST/0.60/trunk/lib/Catalyst/Action/Deserialize/XML/Simple.pm	2008-01-04 00:47:29 UTC (rev 7348)
@@ -20,7 +20,8 @@
         require XML::Simple;
     };
     if ($@) {
-        $c->log->debug("Could not load XML::Simple, refusing to deserialize: $@");
+        $c->log->debug("Could not load XML::Simple, refusing to deserialize: $@")
+            if $c->debug;
         return 0;
     }
 
@@ -41,7 +42,8 @@
         }
     } 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;
 }

Modified: Catalyst-Action-REST/0.60/trunk/lib/Catalyst/Action/REST.pm
===================================================================
--- Catalyst-Action-REST/0.60/trunk/lib/Catalyst/Action/REST.pm	2008-01-03 23:50:18 UTC (rev 7347)
+++ Catalyst-Action-REST/0.60/trunk/lib/Catalyst/Action/REST.pm	2008-01-04 00:47:29 UTC (rev 7348)
@@ -12,6 +12,7 @@
 
 use base 'Catalyst::Action';
 use Class::Inspector;
+use Catalyst;
 use Catalyst::Request::REST;
 use 5.8.1;
 

Modified: Catalyst-Action-REST/0.60/trunk/lib/Catalyst/Action/Serialize/XML/Simple.pm
===================================================================
--- Catalyst-Action-REST/0.60/trunk/lib/Catalyst/Action/Serialize/XML/Simple.pm	2008-01-03 23:50:18 UTC (rev 7347)
+++ Catalyst-Action-REST/0.60/trunk/lib/Catalyst/Action/Serialize/XML/Simple.pm	2008-01-04 00:47:29 UTC (rev 7348)
@@ -20,7 +20,8 @@
         require XML::Simple
     };
     if ($@) {
-        $c->log->debug("Could not load XML::Serializer, refusing to serialize: $@");
+        $c->log->debug("Could not load XML::Serializer, refusing to serialize: $@")
+            if $c->debug;
         return 0;
     }
     my $xs = XML::Simple->new(ForceArray => 0,);

Modified: Catalyst-Action-REST/0.60/trunk/lib/Catalyst/Action/SerializeBase.pm
===================================================================
--- Catalyst-Action-REST/0.60/trunk/lib/Catalyst/Action/SerializeBase.pm	2008-01-03 23:50:18 UTC (rev 7347)
+++ Catalyst-Action-REST/0.60/trunk/lib/Catalyst/Action/SerializeBase.pm	2008-01-04 00:47:29 UTC (rev 7348)
@@ -36,7 +36,7 @@
         $self->_serialize_plugins( \@plugins );
     }
 
-    my $content_type = $c->request->preferred_content_type;
+    my $content_type = $c->request->preferred_content_type || '';
 
     # Finally, we load the class.  If you have a default serializer,
     # and we still don't have a content-type that exists in the map,
@@ -94,8 +94,7 @@
         eval { require $load_class; };
         if ($@) {
             $c->log->error(
-                "Error loading $sclass for " . $content_type . ": $!" )
-              if $c->log->is_debug;
+                "Error loading $sclass for " . $content_type . ": $!" );
             return $self->_unsupported_media_type($c, $content_type);
         } else {
             $self->_loaded_plugins->{$sclass} = 1;

Modified: Catalyst-Action-REST/0.60/trunk/lib/Catalyst/Controller/REST.pm
===================================================================
--- Catalyst-Action-REST/0.60/trunk/lib/Catalyst/Controller/REST.pm	2008-01-03 23:50:18 UTC (rev 7347)
+++ Catalyst-Action-REST/0.60/trunk/lib/Catalyst/Controller/REST.pm	2008-01-04 00:47:29 UTC (rev 7348)
@@ -208,7 +208,7 @@
 use strict;
 use warnings;
 use base 'Catalyst::Controller';
-use Params::Validate qw(:all);
+use Params::Validate qw(SCALAR OBJECT);
 
 __PACKAGE__->mk_accessors(qw(serialize));
 
@@ -253,7 +253,7 @@
 sub status_ok {
     my $self = shift;
     my $c    = shift;
-    my %p    = validate( @_, { entity => 1, }, );
+    my %p    = Params::Validate::validate( @_, { entity => 1, }, );
 
     $c->response->status(200);
     $self->_set_entity( $c, $p{'entity'} );
@@ -283,7 +283,7 @@
 sub status_created {
     my $self = shift;
     my $c    = shift;
-    my %p    = validate(
+    my %p    = Params::Validate::validate(
         @_,
         {
             location => { type     => SCALAR | OBJECT },
@@ -321,7 +321,7 @@
 sub status_accepted {
     my $self = shift;
     my $c    = shift;
-    my %p    = validate( @_, { entity => 1, }, );
+    my %p    = Params::Validate::validate( @_, { entity => 1, }, );
 
     $c->response->status(202);
     $self->_set_entity( $c, $p{'entity'} );
@@ -346,7 +346,7 @@
 sub status_bad_request {
     my $self = shift;
     my $c    = shift;
-    my %p    = validate( @_, { message => { type => SCALAR }, }, );
+    my %p    = Params::Validate::validate( @_, { message => { type => SCALAR }, }, );
 
     $c->response->status(400);
     $c->log->debug( "Status Bad Request: " . $p{'message'} ) if $c->debug;
@@ -372,7 +372,7 @@
 sub status_not_found {
     my $self = shift;
     my $c    = shift;
-    my %p    = validate( @_, { message => { type => SCALAR }, }, );
+    my %p    = Params::Validate::validate( @_, { message => { type => SCALAR }, }, );
 
     $c->response->status(404);
     $c->log->debug( "Status Not Found: " . $p{'message'} ) if $c->debug;




More information about the Catalyst-commits mailing list