[Catalyst-commits] r7811 - in Catalyst-Runtime/5.70/trunk: .
lib/Catalyst t
bricas at dev.catalyst.perl.org
bricas at dev.catalyst.perl.org
Tue May 27 03:42:11 BST 2008
Author: bricas
Date: 2008-05-27 03:42:11 +0100 (Tue, 27 May 2008)
New Revision: 7811
Modified:
Catalyst-Runtime/5.70/trunk/Changes
Catalyst-Runtime/5.70/trunk/lib/Catalyst/Utils.pm
Catalyst-Runtime/5.70/trunk/t/unit_utils_subdir.t
Log:
Fix Catalyst::Utils::home() when application .pm is in the current dir (RT #34437)
Modified: Catalyst-Runtime/5.70/trunk/Changes
===================================================================
--- Catalyst-Runtime/5.70/trunk/Changes 2008-05-27 01:43:13 UTC (rev 7810)
+++ Catalyst-Runtime/5.70/trunk/Changes 2008-05-27 02:42:11 UTC (rev 7811)
@@ -2,6 +2,7 @@
5.7xxx xxx
- Get some of the optional_* tests working from dirs with spaces (RT #26455)
+ - Fix Catalyst::Utils::home() when application .pm is in the current dir (RT #34437)
5.7014 2008-05-25 15:26:00
- Addition of .conf in restart regex in Catalyst::Engine::HTTP::Restarter::Watcher
Modified: Catalyst-Runtime/5.70/trunk/lib/Catalyst/Utils.pm
===================================================================
--- Catalyst-Runtime/5.70/trunk/lib/Catalyst/Utils.pm 2008-05-27 01:43:13 UTC (rev 7810)
+++ Catalyst-Runtime/5.70/trunk/lib/Catalyst/Utils.pm 2008-05-27 02:42:11 UTC (rev 7811)
@@ -8,6 +8,7 @@
use URI;
use Class::Inspector;
use Carp qw/croak/;
+use Cwd;
=head1 NAME
@@ -160,6 +161,7 @@
# find the @INC entry in which $file was found
(my $path = $inc_entry) =~ s/$file$//;
+ $path ||= cwd() if !defined $path || !length $path;
my $home = dir($path)->absolute->cleanup;
# pop off /lib and /blib if they're there
Modified: Catalyst-Runtime/5.70/trunk/t/unit_utils_subdir.t
===================================================================
--- Catalyst-Runtime/5.70/trunk/t/unit_utils_subdir.t 2008-05-27 01:43:13 UTC (rev 7810)
+++ Catalyst-Runtime/5.70/trunk/t/unit_utils_subdir.t 2008-05-27 02:42:11 UTC (rev 7811)
@@ -1,4 +1,4 @@
-use Test::More tests=>7;
+use Test::More tests => 8;
use strict;
use warnings;
@@ -30,3 +30,13 @@
like($home, qr{t[\/\\]something}, "has path TestApp/t/something");
unlike($home, qr{[\/\\]script[\/\\]foo}, "doesn't have path /script/foo");
}
+
+{
+ $INC{'TestApp.pm'} = "TestApp.pm";
+ my $dir = "$FindBin::Bin/something";
+ chdir( $dir );
+
+ my $home = Catalyst::Utils::home('TestApp');
+
+ is( $home, $dir, 'same dir loading' );
+}
More information about the Catalyst-commits
mailing list