X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FPlugin%2FConfigLoader.pm;h=78a4af38cc5e6796fc547be9ac7ad9cd07e9806b;hb=6e7f9907fb0873332c04031fce097740f788e07b;hp=8fe2df57e3c551195349b93f3fbf0f6c4f01d74c;hpb=87dd9ae005a6d138f56a2e742ce128dba0587297;p=catagits%2FCatalyst-Plugin-ConfigLoader.git diff --git a/lib/Catalyst/Plugin/ConfigLoader.pm b/lib/Catalyst/Plugin/ConfigLoader.pm index 8fe2df5..78a4af3 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.09'; =head1 NAME @@ -67,9 +67,13 @@ sub setup { next unless -f $_; my $config = $loader->load( $_ ); - $c->debug( "Loaded Config $_" ) if $c->debug; - _fix_syntax( $config ); - $c->config( $config ) if $config; + $c->log->debug( "Loaded Config $_" ) if $c->debug; + + 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 ) {