X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FHelper.pm;h=3b182addbd27ea23c284bb39ae572ba9b66a9b1c;hb=1a50c493813f72e440cf1975d41f4080f411a547;hp=86ba60f7e2de03a4effc222ace20d3561a2893a1;hpb=9385890d6bcf864ba9c7be8d913e7a7d497d7ee8;p=catagits%2FCatalyst-Devel.git diff --git a/lib/Catalyst/Helper.pm b/lib/Catalyst/Helper.pm index 86ba60f..3b182ad 100644 --- a/lib/Catalyst/Helper.pm +++ b/lib/Catalyst/Helper.pm @@ -18,7 +18,7 @@ use namespace::autoclean; with 'MooseX::Emulate::Class::Accessor::Fast'; # Change Catalyst/Devel.pm also -our $VERSION = '1.23'; +our $VERSION = '1.28'; my %cache; @@ -34,28 +34,19 @@ Catalyst::Helper - Bootstrap a Catalyst application sub get_sharedir_file { my ($self, @filename) = @_; - - my @try_dirs; - if (exists $self->{base}) { - push @try_dirs, $self->{base}; - } + my $dist_dir; if (exists $ENV{CATALYST_DEVEL_SHAREDIR}) { - push @try_dirs, $ENV{CATALYST_DEVEL_SHAREDIR} + $dist_dir = $ENV{CATALYST_DEVEL_SHAREDIR}; } - if (-d "inc/.author" && -f "lib/Catalyst/Helper.pm" + elsif (-d "inc/.author" && -f "lib/Catalyst/Helper.pm" ) { # Can't use sharedir if we're in a checkout # this feels horrible, better ideas? - push @try_dirs, 'share'; + $dist_dir = 'share'; } else { - push @try_dirs, dist_dir('Catalyst-Devel'); - } - - my $file; - foreach my $dist_dir (@try_dirs) { - $file = file( $dist_dir, @filename); - last if -r $file; + $dist_dir = dist_dir('Catalyst-Devel'); } + my $file = file( $dist_dir, @filename); Carp::confess("Cannot find $file") unless -r $file; my $contents = $file->slurp; return $contents; @@ -99,7 +90,7 @@ sub mk_app { $self->{appenv } = Catalyst::Utils::class2env($name); $self->{startperl } = -r '/usr/bin/env' ? '#!/usr/bin/env perl' - : "#!$Config{perlpath} -w"; + : "#!$Config{perlpath}"; $self->{scriptgen } = $Catalyst::Devel::CATALYST_SCRIPT_GEN; $self->{catalyst_version} = $Catalyst::VERSION; $self->{author } = $self->{author} = $ENV{'AUTHOR'}