[Catalyst-commits] r8607 - in trunk/Config-Any: . lib/Config t

bricas at dev.catalyst.perl.org bricas at dev.catalyst.perl.org
Mon Nov 17 13:40:15 GMT 2008


Author: bricas
Date: 2008-11-17 13:40:15 +0000 (Mon, 17 Nov 2008)
New Revision: 8607

Modified:
   trunk/Config-Any/Changes
   trunk/Config-Any/lib/Config/Any.pm
   trunk/Config-Any/t/10-branches.t
Log:
fix up branches test which did not handle the errors thrown by changes from the last release (RT #40948)
fix up error message for "any of" (RT #40972)

Modified: trunk/Config-Any/Changes
===================================================================
--- trunk/Config-Any/Changes	2008-11-17 05:38:41 UTC (rev 8606)
+++ trunk/Config-Any/Changes	2008-11-17 13:40:15 UTC (rev 8607)
@@ -1,5 +1,10 @@
 Revision history for Config-Any
 
+0.16 Mon 17 Nov 2008
+    - fix up branches test which did not handle the errors thrown by
+      changes from the last release (RT #40948)
+    - fix up error message for "any of" (RT #40972)
+
 0.15 Wed 12 Nov 2008
     - when use_ext is true, we will check to see if there are no supported
       modules for a particular file. instead of the file being skipped, an

Modified: trunk/Config-Any/lib/Config/Any.pm
===================================================================
--- trunk/Config-Any/lib/Config/Any.pm	2008-11-17 05:38:41 UTC (rev 8606)
+++ trunk/Config-Any/lib/Config/Any.pm	2008-11-17 13:40:15 UTC (rev 8607)
@@ -6,7 +6,7 @@
 use Carp;
 use Module::Pluggable::Object ();
 
-our $VERSION = '0.15';
+our $VERSION = '0.16';
 
 =head1 NAME
 
@@ -178,7 +178,7 @@
         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 +231,9 @@
             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 +265,7 @@
 
 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 +280,8 @@
 
 sub extensions {
     my $class = shift;
-    my @ext = map { $_->extensions } $class->plugins;
+    my @ext
+        = map { $_->extensions } grep { $_->is_supported } $class->plugins;
     return wantarray ? @ext : \@ext;
 }
 

Modified: trunk/Config-Any/t/10-branches.t
===================================================================
--- trunk/Config-Any/t/10-branches.t	2008-11-17 05:38:41 UTC (rev 8606)
+++ trunk/Config-Any/t/10-branches.t	2008-11-17 13:40:15 UTC (rev 8607)
@@ -38,11 +38,12 @@
     );
 }
 
-# grep out files we don't understand for these tests
-my @files = grep { !m{\.(foo|unsupported)$} } glob( "t/conf/conf.*" );
-my $filter = sub { return };
+# can only be sure that perl files will load
+my @files = ( 't/conf/conf.pl' );
 ok( Config::Any->load_files( { files => \@files, use_ext => 0 } ),
     "use_ext 0 works" );
+
+my $filter = sub { return };
 ok( Config::Any->load_files( { files => \@files, use_ext => 1 } ),
     "use_ext 1 works" );
 




More information about the Catalyst-commits mailing list