Version 0.33
[catagits/Catalyst-Plugin-ConfigLoader.git] / lib / Catalyst / Plugin / ConfigLoader.pm
index 5edbad1..826af28 100644 (file)
@@ -8,7 +8,7 @@ use MRO::Compat;
 use Data::Visitor::Callback;
 use Catalyst::Utils ();
 
-our $VERSION = '0.25';
+our $VERSION = '0.33';
 
 =head1 NAME
 
@@ -179,11 +179,12 @@ sub get_config_path {
 
     my $appname = ref $c || $c;
     my $prefix  = Catalyst::Utils::appprefix( $appname );
-    my $path    = Catalyst::Utils::env_value( $c, 'CONFIG' )
+    my $path    = Catalyst::Utils::env_value( $appname, 'CONFIG' )
         || $c->config->{ 'Plugin::ConfigLoader' }->{ file }
         || $c->path_to( $prefix );
 
-    my ( $extension ) = ( $path =~ m{\.(.{1,4})$} );
+    ## don't look for extension if this is a dir
+    my ( $extension ) = !-d $path ? ( $path =~ m{\.([^\/\\.]{1,4})$} ) : () ;
 
     if ( -d $path ) {
         $path =~ s{[\/\\]$}{};
@@ -273,8 +274,8 @@ sub finalize_config {
 
 =head2 config_substitutions( $value )
 
-This method substitutes macros found with calls to a function. There are three
-default macros:
+This method substitutes macros found with calls to a function. There are a
+number of default macros:
 
 =over 4
 
@@ -356,7 +357,7 @@ Work to this module has been generously sponsored by:
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright 2006-2009 by Brian Cassidy
+Copyright 2006-2010 by Brian Cassidy
 
 This library is free software; you can redistribute it and/or modify
 it under the same terms as Perl itself.