[Catalyst-commits] r13461 - in trunk/Config-Any: . lib/Config/Any t
t/conf
caelum at dev.catalyst.perl.org
caelum at dev.catalyst.perl.org
Mon Aug 2 10:00:37 GMT 2010
Author: caelum
Date: 2010-08-02 10:00:37 +0000 (Mon, 02 Aug 2010)
New Revision: 13461
Added:
trunk/Config-Any/t/conf/single_element_arrayref.conf
Modified:
trunk/Config-Any/Changes
trunk/Config-Any/lib/Config/Any/General.pm
trunk/Config-Any/t/50-general.t
Log:
enable -ForceArray option by default for Config::General
Modified: trunk/Config-Any/Changes
===================================================================
--- trunk/Config-Any/Changes 2010-08-02 09:13:52 UTC (rev 13460)
+++ trunk/Config-Any/Changes 2010-08-02 10:00:37 UTC (rev 13461)
@@ -1,5 +1,7 @@
Revision history for Config-Any
+ - enable -ForceArray option by default for Config::General (caelum)
+
0.19 Mon 15 Feb 2010
- add JSON::DWIW to the top of the JSON loaders list (caelum)
- remove need for caching in Perl loader by using do() instead
Modified: trunk/Config-Any/lib/Config/Any/General.pm
===================================================================
--- trunk/Config-Any/lib/Config/Any/General.pm 2010-08-02 09:13:52 UTC (rev 13460)
+++ trunk/Config-Any/lib/Config/Any/General.pm 2010-08-02 10:00:37 UTC (rev 13461)
@@ -16,6 +16,7 @@
name = TestApp
<Component Controller::Foo>
foo bar
+ bar [ arrayref-value ]
</Component>
<Model Baz>
qux xyzzy
@@ -49,6 +50,8 @@
$args->{ -ConfigFile } = $file;
+ $args->{ -ForceArray } = 1 unless exists $args->{ -ForceArray };
+
require Config::General;
my $configfile = Config::General->new( %$args );
my $config = { $configfile->getall };
Modified: trunk/Config-Any/t/50-general.t
===================================================================
--- trunk/Config-Any/t/50-general.t 2010-08-02 09:13:52 UTC (rev 13460)
+++ trunk/Config-Any/t/50-general.t 2010-08-02 10:00:37 UTC (rev 13461)
@@ -8,7 +8,7 @@
plan skip_all => 'Config::General format not supported';
}
else {
- plan tests => 6;
+ plan tests => 7;
}
{
@@ -24,6 +24,14 @@
ok( exists $config->{ component } );
}
+{
+ my $config = Config::Any::General->load(
+ 't/conf/single_element_arrayref.conf'
+ );
+ is_deeply $config->{foo}, [ 'bar' ],
+ 'single element arrayref';
+}
+
# test invalid config
{
my $file = 't/invalid/conf.conf';
Added: trunk/Config-Any/t/conf/single_element_arrayref.conf
===================================================================
--- trunk/Config-Any/t/conf/single_element_arrayref.conf (rev 0)
+++ trunk/Config-Any/t/conf/single_element_arrayref.conf 2010-08-02 10:00:37 UTC (rev 13461)
@@ -0,0 +1 @@
+foo [ bar ]
More information about the Catalyst-commits
mailing list