FAQ
Hi all,

I noticed that ConfigLoader's pretty syntax? (particluarly with
Config::General) for model, view and controller config didn't extend to
plugin config.

[1]: Like this:

<Model Foo>
bar baz
</Model>

instead of

<Model::Foo>
bar baz
</Model::Foo>

Here's a patch that extends the feature to cover plugins:

=== Changes
==================================================================
--- Changes (revision 55488)
+++ Changes (local)
@@ -5,6 +5,7 @@
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 as well as models/views/controllers

0.20 Fri May 02 2008
- sort configs by filename for loading (RT #31498)
=== lib/Catalyst/Plugin/ConfigLoader.pm
==================================================================
--- lib/Catalyst/Plugin/ConfigLoader.pm (revision 55488)
+++ lib/Catalyst/Plugin/ConfigLoader.pm (local)
@@ -227,7 +227,7 @@
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 ) {
=== t/20-mock_load.t
==================================================================
--- t/20-mock_load.t (revision 55488)
+++ t/20-mock_load.t (local)
@@ -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->{ 'view' }, 'View::TT::New' );
is( __PACKAGE__->config->{ 'foo_sub' }, 'x-y' );
is( __PACKAGE__->config->{ 'literal_macro' }, '__DATA__' );
+is( __PACKAGE__->config->{ 'Plugin::Zot' }->{ zoot }, 'zooot');
=== t/mockapp/mockapp.pl
==================================================================
--- t/mockapp/mockapp.pl (revision 55488)
+++ t/mockapp/mockapp.pl (local)
@@ -4,4 +4,5 @@
'Model::Baz' => { qux => 'xyzzy' },
foo_sub => '__foo(x,y)__',
literal_macro => '__literal(__DATA__)__',
+ Plugin => { Zot => { zoot => 'zooot' } },
}


--
ilmari
"A disappointingly low fraction of the human race is,
at any given time, on fire." - Stig Sandbeck Mathisen

Search Discussions

  • Brian Cassidy at Aug 5, 2008 at 3:25 am

    On Mon, Aug 4, 2008 at 8:51 PM, Dagfinn Ilmari Manns?ker wrote:
    I noticed that ConfigLoader's pretty syntax? (particluarly with
    Config::General) for model, view and controller config didn't extend to
    plugin config.


    Here's a patch that extends the feature to cover plugins:
    Applied as svn revision 8177. Thanks.

    -Brian

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedAug 5, '08 at 12:51a
activeAug 5, '08 at 3:25a
posts2
users2
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2023 Grokbase