X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FConfig%2FAny%2FGeneral.pm;h=5c697e92e1a058e495245f81fac36f93cb0de10e;hb=eb6669bf50b06d26f044f070ac3dd82adcea5150;hp=975bff674a471317128484faed56ec94c2d332a9;hpb=e0c0c283d718e11db7e71a002fee6642ce1b73bd;p=p5sagit%2FConfig-Any.git
diff --git a/lib/Config/Any/General.pm b/lib/Config/Any/General.pm
index 975bff6..5c697e9 100644
--- a/lib/Config/Any/General.pm
+++ b/lib/Config/Any/General.pm
@@ -2,6 +2,9 @@ package Config::Any::General;
use strict;
use warnings;
+use Carp;
+
+use base 'Config::Any::Base';
=head1 NAME
@@ -14,6 +17,7 @@ Loads Config::General files. Example:
name = TestApp
foo bar
+ bar [ arrayref-value ]
qux xyzzy
@@ -43,14 +47,18 @@ sub load {
my $args = shift || {};
# work around bug (?) in Config::General
-# return if $class->_test_perl($file);
+ # return if $class->_test_perl($file);
- $args->{-ConfigFile} = $file;
+ $args->{ -ConfigFile } = $file;
require Config::General;
+ Config::General->VERSION('2.47');
+
+ $args->{ -ForceArray } = 1 unless exists $args->{ -ForceArray };
+
my $configfile = Config::General->new( %$args );
my $config = { $configfile->getall };
-
+
return $config;
}
@@ -61,32 +69,32 @@ sub load {
# developer.
sub _test_perl {
- my ($class, $file) = @_;
+ my ( $class, $file ) = @_;
my $is_perl_src;
eval { $is_perl_src = do "$file"; };
- delete $INC{$file}; # so we don't screw stuff later on
+ delete $INC{ $file }; # so we don't screw stuff later on
return defined $is_perl_src;
}
-=head1 AUTHOR
+=head2 requires_all_of( )
-=over 4
+Specifies that this module requires L in order to work.
-=item * Brian Cassidy Ebricas@cpan.orgE
+=cut
-=back
+sub requires_all_of { [ 'Config::General' ] }
-=head1 CONTRIBUTORS
+=head1 AUTHOR
-=over 4
+Brian Cassidy Ebricas@cpan.orgE
-=item * Joel Bernstein C<< >>
+=head1 CONTRIBUTORS
-=back
+Joel Bernstein C<< >>
=head1 COPYRIGHT AND LICENSE
-Copyright 2006 by Brian Cassidy
+Copyright 2006-2010 by Brian Cassidy
Portions Copyright 2006 Portugal Telecom