[Catalyst-commits] r13507 - in Catalyst-Plugin-ConfigLoader/trunk:
. lib/Catalyst/Plugin t
t0m at dev.catalyst.perl.org
t0m at dev.catalyst.perl.org
Thu Aug 19 23:01:53 GMT 2010
Author: t0m
Date: 2010-08-20 00:01:53 +0100 (Fri, 20 Aug 2010)
New Revision: 13507
Added:
Catalyst-Plugin-ConfigLoader/trunk/t/24-mock-shortappname.t
Modified:
Catalyst-Plugin-ConfigLoader/trunk/Changes
Catalyst-Plugin-ConfigLoader/trunk/lib/Catalyst/Plugin/ConfigLoader.pm
Log:
Fix issue from the mailing list
Modified: Catalyst-Plugin-ConfigLoader/trunk/Changes
===================================================================
--- Catalyst-Plugin-ConfigLoader/trunk/Changes 2010-08-19 20:28:42 UTC (rev 13506)
+++ Catalyst-Plugin-ConfigLoader/trunk/Changes 2010-08-19 23:01:53 UTC (rev 13507)
@@ -1,5 +1,7 @@
Revision history for Perl extension Catalyst::Plugin::ConfigLoader.
+ - Fix issue with 2 character app names that are kept in versioned
+ directories (e.g. app called QX in QX-2.1.5/)
- bump dep on Config::Any to use the -ForceArray Config::General option
(caelum)
Modified: Catalyst-Plugin-ConfigLoader/trunk/lib/Catalyst/Plugin/ConfigLoader.pm
===================================================================
--- Catalyst-Plugin-ConfigLoader/trunk/lib/Catalyst/Plugin/ConfigLoader.pm 2010-08-19 20:28:42 UTC (rev 13506)
+++ Catalyst-Plugin-ConfigLoader/trunk/lib/Catalyst/Plugin/ConfigLoader.pm 2010-08-19 23:01:53 UTC (rev 13507)
@@ -183,7 +183,7 @@
|| $c->config->{ 'Plugin::ConfigLoader' }->{ file }
|| $c->path_to( $prefix );
- my ( $extension ) = ( $path =~ m{\.(.{1,4})$} );
+ my ( $extension ) = ( $path =~ m{\.([^/\.]{1,4})$} );
if ( -d $path ) {
$path =~ s{[\/\\]$}{};
Added: Catalyst-Plugin-ConfigLoader/trunk/t/24-mock-shortappname.t
===================================================================
--- Catalyst-Plugin-ConfigLoader/trunk/t/24-mock-shortappname.t (rev 0)
+++ Catalyst-Plugin-ConfigLoader/trunk/t/24-mock-shortappname.t 2010-08-19 23:01:53 UTC (rev 13507)
@@ -0,0 +1,23 @@
+use strict;
+use warnings;
+use Test::More;
+
+{
+ package QX;
+ use strict;
+ use warnings;
+ use Path::Class ();
+
+ use base 'Catalyst::Plugin::ConfigLoader';
+
+ sub config { {} }
+ sub path_to { shift; Path::Class::dir('/home/foo/QX-0.9.5/' . shift); }
+}
+
+my $app = bless {}, 'QX';
+my ($path, $extension) = $app->get_config_path;
+is $path, '/home/foo/QX-0.9.5/qx';
+is $extension, undef;
+
+done_testing;
+
More information about the Catalyst-commits
mailing list