X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FConfig-Any.git;a=blobdiff_plain;f=lib%2FConfig%2FAny%2FINI.pm;h=bc1951b66a358533031c30716600292d801e1728;hp=68e3f06f8876554025bb4b6362e53f7c395f32f1;hb=f9f3d682a0332cec1207764dcada85a7ff7750f0;hpb=5a2e0210fe5c7da046be37b4240008f2b667be67 diff --git a/lib/Config/Any/INI.pm b/lib/Config/Any/INI.pm index 68e3f06..bc1951b 100644 --- a/lib/Config/Any/INI.pm +++ b/lib/Config/Any/INI.pm @@ -3,6 +3,8 @@ package Config::Any::INI; use strict; use warnings; +use base 'Config::Any::Base'; + our $MAP_SECTION_SPACE_TO_NESTED_KEY = 1; =head1 NAME @@ -45,6 +47,9 @@ sub load { require Config::Tiny; my $config = Config::Tiny->read( $file ); + + die $Config::Tiny::errstr if not defined $config; + my $out = delete $config->{ _ } || {}; for my $k ( keys %$config ) { @@ -63,16 +68,13 @@ sub load { return $out; } -=head2 is_supported( ) +=head2 requires_all_of( ) -Returns true if L is available. +Specifies that this module requires L in order to work. =cut -sub is_supported { - eval { require Config::Tiny; }; - return $@ ? 0 : 1; -} +sub requires_all_of { 'Config::Tiny' } =head1 PACKAGE VARIABLES @@ -101,7 +103,7 @@ Joel Bernstein Erataxis@cpan.orgE =head1 COPYRIGHT AND LICENSE -Copyright 2007 by Brian Cassidy, portions copyright 2006, 2007 by Joel Bernstein +Copyright 2006-2015 by Brian Cassidy, portions copyright 2006, 2007 by Joel Bernstein This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.