Revision history for Perl extension Catalyst::Plugin::ConfigLoader.
+0.15 Tue Aug 21 2007
+ - Allow multiple __HOME__ and __path_to()__ replaces in one string
+ (Greg Sheard)
+
0.14 Tue Apr 03 2007
- switch to Module::Install
- added a user manual
use NEXT;
use Data::Visitor::Callback;
-our $VERSION = '0.14';
+our $VERSION = '0.15';
=head1 NAME
my $v = Data::Visitor::Callback->new(
plain_value => sub {
return unless defined $_;
- s{__HOME__}{ $c->path_to( '' ) }e;
- s{__path_to\((.+)\)__}{ $c->path_to( split( '/', $1 ) ) }e;
+ s{__HOME__}{ $c->path_to( '' ) }eg;
+ s{__path_to\((.+?)\)__}{ $c->path_to( split( '/', $1 ) ) }eg;
}
);
$v->visit( $c->config );
use FindBin;
use lib "$FindBin::Bin/lib";
-use Test::More tests => 4;
+use Test::More tests => 5;
use Catalyst::Test 'TestApp';
$response = request('http://localhost/appconfig/foo');
is( $response->content, 'bar', 'app finalize_config works' );
+
+ $response = request('http://localhost/appconfig/multi');
+ my $home = TestApp->config->{ home };
+ my $path = join( ',', $home, TestApp->path_to( 'x' ), $home, TestApp->path_to( 'y' ) );
+ is( $response->content, $path, 'vars substituted in config var, twice' );
}
foo => 'foo'
},
cache => '__HOME__/cache',
+ multi => '__HOME__,__path_to(x)__,__HOME__,__path_to(y)__',
}