PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB` package Config::Any::Base; use strict; use warnings; =head1 NAME Config::Any::Base - Base class for loaders =head1 DESCRIPTION This is a base class for all loaders. It currently handles the specification of dependencies in order to ensure the subclass can load the config file format. =head1 METHODS =head2 is_supported( ) Allows us to determine if the file format can be loaded. The can be done via one of two subclass methods: =over 4 =item * C - returns an array of items that must all be present in order to work =item * C - returns an array of items in which at least one must be present =back You can specify a module version by passing an array reference in the return. sub requires_all_of { [ 'My::Module', '1.1' ], 'My::OtherModule' } Lack of specifying these subs will assume you require no extra modules to function. =cut sub is_supported { my ( $class ) = shift; if ( $class->can( 'requires_all_of' ) ) { eval join( '', map { _require_line( $_ ) } $class->requires_all_of ); return $@ ? 0 : 1; } if ( $class->can( 'requires_any_of' ) ) { for ( $class->requires_any_of ) { eval _require_line( $_ ); return 1 unless $@; } return 0; } # requires nothing! return 1; } sub _require_line { my ( $input ) = shift; my ( $module, $version ) = ( ref $input ? @$input : $input ); return "require $module;" . ( $version ? "${module}->VERSION('${version}');" : '' ); } =head1 AUTHOR Brian Cassidy Ebricas@cpan.orgE =head1 COPYRIGHT AND LICENSE Copyright 2008-2009 by Brian Cassidy This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 SEE ALSO =over 4 =item * L =back =cut 1;