X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FUtils.pm;h=440d9e9c7867fc821441c251ea06309a2653bd15;hb=a8946dc8b4ba4c46b4db564b8f9692d48cc7a62f;hp=d72441ea6951430a3d646e16697deb8225d3e798;hpb=41a8bf1f4e417f1439866c09c08a3998ae81528a;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Utils.pm b/lib/Catalyst/Utils.pm index d72441e..440d9e9 100644 --- a/lib/Catalyst/Utils.pm +++ b/lib/Catalyst/Utils.pm @@ -7,7 +7,7 @@ use Path::Class; use URI; use Carp qw/croak/; use Cwd; - +use Class::MOP; use String::RewritePrefix; use namespace::clean; @@ -158,8 +158,17 @@ sub class2tempdir { Returns home directory for given class. +=head2 dist_indicator_file_list + +Returns a list of files which can be tested to check if you're inside +a checkout + =cut +sub dist_indicator_file_list { + qw{Makefile.PL Build.PL dist.ini}; +} + sub home { my $class = shift; @@ -179,9 +188,7 @@ sub home { $home = $home->parent while $home =~ /b?lib$/; # only return the dir if it has a Makefile.PL or Build.PL or dist.ini - if (-f $home->file("Makefile.PL") or -f $home->file("Build.PL") - or -f $home->file("dist.ini")) { - + if (grep { -f $home->file($_) } dist_indicator_file_list()) { # clean up relative path: # MyApp/script/.. -> MyApp