[Catalyst-commits] r6602 - in trunk/Catalyst-Plugin-Cache: lib/Catalyst/Plugin t

nothingmuch at dev.catalyst.perl.org nothingmuch at dev.catalyst.perl.org
Tue Jul 31 16:06:47 GMT 2007


Author: nothingmuch
Date: 2007-07-31 16:06:46 +0100 (Tue, 31 Jul 2007)
New Revision: 6602

Modified:
   trunk/Catalyst-Plugin-Cache/lib/Catalyst/Plugin/Cache.pm
   trunk/Catalyst-Plugin-Cache/t/config_backend_class.t
Log:
foo

Modified: trunk/Catalyst-Plugin-Cache/lib/Catalyst/Plugin/Cache.pm
===================================================================
--- trunk/Catalyst-Plugin-Cache/lib/Catalyst/Plugin/Cache.pm	2007-07-31 12:11:30 UTC (rev 6601)
+++ trunk/Catalyst-Plugin-Cache/lib/Catalyst/Plugin/Cache.pm	2007-07-31 15:06:46 UTC (rev 6602)
@@ -6,7 +6,7 @@
 use strict;
 use warnings;
 
-our $VERSION = "0.03";
+our $VERSION = "0.04";
 
 use Scalar::Util ();
 use Catalyst::Utils ();
@@ -81,7 +81,11 @@
     my %config = %$config;
 
     if ( my $class = delete $config{class} ) {
-        $app->setup_cache_backend_by_class( $name, $class, \%config );
+        eval { $app->setup_cache_backend_by_class( $name, $class, %config ) }
+            ||
+        eval { $app->setup_cache_backend_by_class( $name, $class, \%config ) }
+            ||
+        die "Couldn't construct $class with either list style or hash ref style param passing: $@";
     } elsif ( my $store = delete $config->{store} || $app->default_cache_store ) {
         my $method = lc("setup_${store}_cache_backend");
 

Modified: trunk/Catalyst-Plugin-Cache/t/config_backend_class.t
===================================================================
--- trunk/Catalyst-Plugin-Cache/t/config_backend_class.t	2007-07-31 12:11:30 UTC (rev 6601)
+++ trunk/Catalyst-Plugin-Cache/t/config_backend_class.t	2007-07-31 15:06:46 UTC (rev 6602)
@@ -14,6 +14,7 @@
     package MyCache;
     sub new {
         my ( $class, $p ) = @_;
+        die unless ref $p;
         bless { %$p }, $class;
     }
     sub get {}




More information about the Catalyst-commits mailing list