[Catalyst-commits] r6698 - in trunk/Catalyst-Plugin-ConfigLoader: .
lib/Catalyst/Plugin t t/lib/TestApp
bricas at dev.catalyst.perl.org
bricas at dev.catalyst.perl.org
Tue Aug 21 15:53:43 GMT 2007
Author: bricas
Date: 2007-08-21 15:53:42 +0100 (Tue, 21 Aug 2007)
New Revision: 6698
Modified:
trunk/Catalyst-Plugin-ConfigLoader/Changes
trunk/Catalyst-Plugin-ConfigLoader/lib/Catalyst/Plugin/ConfigLoader.pm
trunk/Catalyst-Plugin-ConfigLoader/t/10-live_auto.t
trunk/Catalyst-Plugin-ConfigLoader/t/lib/TestApp/testapp.pl
Log:
multiple replaces for __HOME__ and __path_to()__
Modified: trunk/Catalyst-Plugin-ConfigLoader/Changes
===================================================================
--- trunk/Catalyst-Plugin-ConfigLoader/Changes 2007-08-19 18:04:12 UTC (rev 6697)
+++ trunk/Catalyst-Plugin-ConfigLoader/Changes 2007-08-21 14:53:42 UTC (rev 6698)
@@ -1,5 +1,9 @@
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
Modified: trunk/Catalyst-Plugin-ConfigLoader/lib/Catalyst/Plugin/ConfigLoader.pm
===================================================================
--- trunk/Catalyst-Plugin-ConfigLoader/lib/Catalyst/Plugin/ConfigLoader.pm 2007-08-19 18:04:12 UTC (rev 6697)
+++ trunk/Catalyst-Plugin-ConfigLoader/lib/Catalyst/Plugin/ConfigLoader.pm 2007-08-21 14:53:42 UTC (rev 6698)
@@ -7,7 +7,7 @@
use NEXT;
use Data::Visitor::Callback;
-our $VERSION = '0.14';
+our $VERSION = '0.15';
=head1 NAME
@@ -228,8 +228,8 @@
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 );
Modified: trunk/Catalyst-Plugin-ConfigLoader/t/10-live_auto.t
===================================================================
--- trunk/Catalyst-Plugin-ConfigLoader/t/10-live_auto.t 2007-08-19 18:04:12 UTC (rev 6697)
+++ trunk/Catalyst-Plugin-ConfigLoader/t/10-live_auto.t 2007-08-21 14:53:42 UTC (rev 6698)
@@ -4,7 +4,7 @@
use FindBin;
use lib "$FindBin::Bin/lib";
-use Test::More tests => 4;
+use Test::More tests => 5;
use Catalyst::Test 'TestApp';
@@ -18,4 +18,9 @@
$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' );
}
Modified: trunk/Catalyst-Plugin-ConfigLoader/t/lib/TestApp/testapp.pl
===================================================================
--- trunk/Catalyst-Plugin-ConfigLoader/t/lib/TestApp/testapp.pl 2007-08-19 18:04:12 UTC (rev 6697)
+++ trunk/Catalyst-Plugin-ConfigLoader/t/lib/TestApp/testapp.pl 2007-08-21 14:53:42 UTC (rev 6698)
@@ -4,4 +4,5 @@
foo => 'foo'
},
cache => '__HOME__/cache',
+ multi => '__HOME__,__path_to(x)__,__HOME__,__path_to(y)__',
}
More information about the Catalyst-commits
mailing list