[Catalyst-commits] r7473 - in trunk/Catalyst-Plugin-ConfigLoader: .
lib/Catalyst/Plugin
marcus at dev.catalyst.perl.org
marcus at dev.catalyst.perl.org
Sun Mar 9 19:00:47 GMT 2008
Author: marcus
Date: 2008-03-09 19:00:47 +0000 (Sun, 09 Mar 2008)
New Revision: 7473
Modified:
trunk/Catalyst-Plugin-ConfigLoader/Changes
trunk/Catalyst-Plugin-ConfigLoader/lib/Catalyst/Plugin/ConfigLoader.pm
Log:
pod update
Modified: trunk/Catalyst-Plugin-ConfigLoader/Changes
===================================================================
--- trunk/Catalyst-Plugin-ConfigLoader/Changes 2008-03-09 15:13:17 UTC (rev 7472)
+++ trunk/Catalyst-Plugin-ConfigLoader/Changes 2008-03-09 19:00:47 UTC (rev 7473)
@@ -1,5 +1,6 @@
Revision history for Perl extension Catalyst::Plugin::ConfigLoader.
+ - Updated pod with new example
0.20 Wed Feb 06 2008
- sort configs by filename for loading (RT #31498)
Modified: trunk/Catalyst-Plugin-ConfigLoader/lib/Catalyst/Plugin/ConfigLoader.pm
===================================================================
--- trunk/Catalyst-Plugin-ConfigLoader/lib/Catalyst/Plugin/ConfigLoader.pm 2008-03-09 15:13:17 UTC (rev 7472)
+++ trunk/Catalyst-Plugin-ConfigLoader/lib/Catalyst/Plugin/ConfigLoader.pm 2008-03-09 19:00:47 UTC (rev 7473)
@@ -26,6 +26,15 @@
# you can specify a file if you'd like
__PACKAGE__->config( 'Plugin::ConfigLoader' => { file => 'config.yaml' } );
+ In the file, assuming it's in YAML format:
+
+ foo: bar
+
+ Accessible through the context object, or the class itself
+
+ $c->config->{foo} # bar
+ MyApp->config->{foo} # bar
+
=head1 DESCRIPTION
This module will attempt to load find and load a configuration
@@ -58,7 +67,6 @@
|| {},
}
);
-
# map the array of hashrefs to a simple hash
my %configs = map { %$_ } @$cfg;
@@ -125,7 +133,6 @@
else {
@files = map { ( "$path.$_", "${path}_${suffix}.$_" ) } @extensions;
}
-
@files;
}
More information about the Catalyst-commits
mailing list