reworked __HOME__ to be a synonym for $c->path_to( '' )
Brian Cassidy [Tue, 18 Apr 2006 20:02:56 +0000 (20:02 +0000)]
new replacement: __path_to('foo/bar')__ => $c->path_to( 'foo', 'bar' )

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