X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FConfig-Any.git;a=blobdiff_plain;f=lib%2FConfig%2FAny.pm;h=c9f19cd1d3ed76affc5a673e319200559f4799a2;hp=ef3430b9709604a1daddf9ecef85d044bad440f9;hb=4748f060c5038b49fa96c3be95b28deb88a7a323;hpb=dcfb1d1d1a544d27a82cb174168df23abc539acb diff --git a/lib/Config/Any.pm b/lib/Config/Any.pm index ef3430b..c9f19cd 100644 --- a/lib/Config/Any.pm +++ b/lib/Config/Any.pm @@ -6,7 +6,7 @@ use warnings; use Carp; use Module::Pluggable::Object (); -our $VERSION = '0.15'; +our $VERSION = '0.24'; =head1 NAME @@ -142,7 +142,9 @@ sub _load { } # figure out what plugins we're using - my @plugins = $force ? @{ $args->{ force_plugins } } : $class->plugins; + my @plugins = $force + ? map { eval "require $_;"; $_; } @{ $args->{ force_plugins } } + : $class->plugins; # map extensions if we have to my ( %extension_lut, $extension_re ); @@ -178,7 +180,7 @@ sub _load { if ( $use_ext_lut ) { $filename =~ m{\.($extension_re)\z}; - if( !$1 ) { + if ( !$1 ) { $filename =~ m{\.([^.]+)\z}; croak "There are no loaders available for .${1} files"; } @@ -231,7 +233,9 @@ sub _support_error { map { ref $_ ? join( ' ', @$_ ) : $_ } $module->requires_all_of ); } if ( $module->can( 'requires_any_of' ) ) { - return 'one of ' . join( ' or ', $module->requires_any_of ); + return 'one of ' + . join( ' or ', + map { ref $_ ? join( ' ', @$_ ) : $_ } $module->requires_any_of ); } } @@ -263,6 +267,7 @@ found by L. sub plugins { my $class = shift; + # filter out things that don't look like our plugins return grep { $_->isa( 'Config::Any::Base' ) } $class->finder->plugins; } @@ -277,7 +282,8 @@ parameter to those methods. sub extensions { my $class = shift; - my @ext = map { $_->extensions } $class->plugins; + my @ext + = map { $_->extensions } $class->plugins; return wantarray ? @ext : \@ext; }