move use_ext before the extra args
[gitmo/MooseX-SimpleConfig.git] / lib / MooseX / SimpleConfig.pm
index 76380e5..056bdfd 100644 (file)
@@ -3,17 +3,22 @@ package MooseX::SimpleConfig;
 use Moose::Role;
 with 'MooseX::ConfigFromFile';
 
-our $VERSION   = '0.02';
+our $VERSION   = '0.03';
 
 use Config::Any ();
 
 sub get_config_from_file {
     my ($class, $file) = @_;
 
+    my $can_config_any_args = $class->can('config_any_args');
+    my $extra_args = $can_config_any_args ? 
+        $can_config_any_args->($class, $file) : {};
+    ;
     my $raw_cfany = Config::Any->load_files({
-        files => [ $file ],
         use_ext => 1,
-    });
+        %$extra_args,
+        files => [ $file ]
+    } );
 
     die q{Specified configfile '} . $file
         . q{' does not exist, is empty, or is not readable}
@@ -106,7 +111,10 @@ well, which allows specifying C<-configfile> on the commandline.
 
 =head2 configfile
 
-Provided by the base role L<MooseX::ConfigFromFile>.
+Provided by the base role L<MooseX::ConfigFromFile>.  You can
+provide a default configfile pathname like so:
+
+  has +configfile ( default => '/etc/myapp.yaml' );
 
 =head1 CLASS METHODS