reworked __HOME__ to be a synonym for $c->path_to( '' )
[catagits/Catalyst-Plugin-ConfigLoader.git] / lib / Catalyst / Plugin / ConfigLoader.pm
index 7761e96..fc68afb 100644 (file)
@@ -92,7 +92,11 @@ the file inside the app's home directory.
 sub finalize_config {\r
     my $c = shift;\r
     my $v = Data::Visitor::Callback->new(\r
-        plain_value => sub { s[^__HOME__/(.+)$][ $c->path_to($1) ]e if defined $_ }\r
+        plain_value => sub {\r
+            return unless defined $_;\r
+            s[__HOME__][ $c->path_to( '' ) ]e;\r
+            s[__path_to\((.+)\)__][ $c->path_to( split( '/', $1 ) ) ]e;\r
+        }\r
     );\r
     $v->visit( $c->config );\r
 }\r