add nice syntax for plugins to match models/views/controllers (ilmari)
Brian Cassidy [Tue, 5 Aug 2008 02:23:12 +0000 (02:23 +0000)]
Changes
lib/Catalyst/Plugin/ConfigLoader.pm
t/20-mock_load.t
t/mockapp/mockapp.pl

diff --git a/Changes b/Changes
index 11a1917..bdf3384 100644 (file)
--- a/Changes
+++ b/Changes
@@ -5,6 +5,7 @@ Revision history for Perl extension Catalyst::Plugin::ConfigLoader.
       Config::General format
     - fix up pod to explain in more detail how to pass options to each
       driver class (Sergio Salvi)
+    - add nice syntax for plugins to match models/views/controllers (ilmari)
 
 0.20  Fri May 02 2008
     - sort configs by filename for loading (RT #31498)
index e9d683e..16b27d8 100644 (file)
@@ -227,7 +227,7 @@ sub _fix_syntax {
             values => delete $config->{ lc $_ } || delete $config->{ $_ }
         },
         grep { ref $config->{ lc $_ } || ref $config->{ $_ } }
-            qw( Component Model M View V Controller C )
+            qw( Component Model M View V Controller C Plugin )
     );
 
     foreach my $comp ( @components ) {
index d095161..78fa146 100644 (file)
@@ -1,6 +1,6 @@
 package MockApp;
 
-use Test::More tests => 9;
+use Test::More tests => 10;
 
 use Cwd;
 $ENV{ CATALYST_HOME } = cwd . '/t/mockapp';
@@ -21,3 +21,4 @@ is( __PACKAGE__->config->{ 'Model::Baz' }->{ another },  'new key' );
 is( __PACKAGE__->config->{ 'view' },                     'View::TT::New' );
 is( __PACKAGE__->config->{ 'foo_sub' },                  'x-y' );
 is( __PACKAGE__->config->{ 'literal_macro' },            '__DATA__' );
+is( __PACKAGE__->config->{ 'Plugin::Zot' }->{ zoot },    'zooot');
index b73a985..15b46c5 100644 (file)
@@ -4,4 +4,5 @@
     'Model::Baz'      => { qux => 'xyzzy' },
     foo_sub           => '__foo(x,y)__',
     literal_macro     => '__literal(__DATA__)__',
+    Plugin            => { Zot => { zoot => 'zooot' } },
 }