X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FPlugin%2FConfigLoader.pm;h=f5c416b2f82e3b5731e742d5077c7ecd774e342f;hb=935441daab55e1b8b994e39bb8167591bbb455ba;hp=760c57edfae51f1d53f7bfa69cae3bfd85c1523b;hpb=94621b2636dd344b503a8910db871bfd7517b2bf;p=catagits%2FCatalyst-Plugin-ConfigLoader.git diff --git a/lib/Catalyst/Plugin/ConfigLoader.pm b/lib/Catalyst/Plugin/ConfigLoader.pm index 760c57e..f5c416b 100644 --- a/lib/Catalyst/Plugin/ConfigLoader.pm +++ b/lib/Catalyst/Plugin/ConfigLoader.pm @@ -10,7 +10,7 @@ use Module::Pluggable::Fast require => 1; use Data::Visitor::Callback; -our $VERSION = '0.08'; +our $VERSION = '0.1'; =head1 NAME @@ -68,8 +68,12 @@ sub setup { my $config = $loader->load( $_ ); $c->log->debug( "Loaded Config $_" ) if $c->debug; - _fix_syntax( $config ); - $c->config( $config ) if $config; + + next if !$config; + + _fix_syntax( $config ); + + $c->config( $config ); } } @@ -152,7 +156,11 @@ sub _fix_syntax { map +{ prefix => $_ eq 'Component' ? '' : $_ . '::', values => delete $config->{ lc $_ } || delete $config->{ $_ } - }, qw( Component Model View Controller ) + }, + grep { + ref $config->{ lc $_ } || ref $config->{ $_ } + } + qw( Component Model M View V Controller C ) ); foreach my $comp ( @components ) {