require => 1;\r
use Data::Visitor::Callback;\r
\r
-our $VERSION = '0.06';\r
+our $VERSION = '0.07';\r
\r
=head1 NAME\r
\r
# ConfigLoader should be first in your list so\r
# other plugins can get the config information\r
use Catalyst qw( ConfigLoader ... );\r
- \r
+ \r
# by default myapp.* will be loaded\r
# you can specify a file if you'd like\r
__PACKAGE__->config( file = > 'config.yaml' ); \r
for( @files ) {\r
next unless -f $_;\r
my $config = $loader->load( $_ );\r
+ \r
+ _fix_syntax( $config );\r
+ \r
$c->config( $config ) if $config;\r
}\r
}\r
$v->visit( $c->config );\r
}\r
\r
+sub _fix_syntax {\r
+ my $config = shift;\r
+ my @components = (\r
+ map +{\r
+ prefix => $_ eq 'Component' ? '' : $_ . '::',\r
+ values => delete $config->{ lc $_ } || delete $config->{ $_ }\r
+ }, qw( Component Model View Controller )\r
+ );\r
+\r
+ foreach my $comp ( @components ) {\r
+ my $prefix = $comp->{ prefix };\r
+ foreach my $element ( keys %{ $comp->{ values } } ) {\r
+ $config->{ "$prefix$element" } = $comp->{ values }->{ $element };\r
+ }\r
+ }\r
+}\r
+\r
=head1 AUTHOR\r
\r
=over 4 \r