X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FHelper.pm;h=690aad15c51a1baf978aa999be668be188a064f0;hb=4c709311f8cac434180c9be738558488da23d5e7;hp=5df10e6f9b8f76924804415bf7ae8dde8eaf6ca3;hpb=2ad364470c25e803c2b8394431490622d3fb9dd7;p=catagits%2FCatalyst-Devel.git diff --git a/lib/Catalyst/Helper.pm b/lib/Catalyst/Helper.pm index 5df10e6..690aad1 100644 --- a/lib/Catalyst/Helper.pm +++ b/lib/Catalyst/Helper.pm @@ -2,6 +2,7 @@ package Catalyst::Helper; use Moose; use Config; use File::Spec; +use File::Spec::Unix; use File::Path; use FindBin; use IO::File; @@ -14,6 +15,8 @@ use Path::Class qw/dir file/; use File::ShareDir qw/dist_dir/; use namespace::autoclean; +with 'MooseX::Emulate::Class::Accessor::Fast'; + my %cache; =head1 NAME @@ -29,7 +32,10 @@ Catalyst::Helper - Bootstrap a Catalyst application sub get_sharedir_file { my ($self, @filename) = @_; my $dist_dir; - if (-d "inc/.author" && -f "lib/Catalyst/Helper.pm" + if (exists $ENV{CATALYST_DEVEL_SHAREDIR}) { + $dist_dir = $ENV{CATALYST_DEVEL_SHAREDIR}; + } + elsif (-d "inc/.author" && -f "lib/Catalyst/Helper.pm" ) { # Can't use sharedir if we're in a checkout # this feels horrible, better ideas? $dist_dir = 'share'; @@ -184,17 +190,19 @@ sub mk_component { message => qq/Couldn't load helper "$class", "$@"/ ); } - ## must be left for back compat! ################################### if ( $class->can('mk_compclass') ) { return 1 unless $class->mk_compclass( $self, @args ); } - else { return 1 unless $self->_mk_compclass } + else { + return 1 unless $self->_mk_compclass + } if ( $class->can('mk_comptest') ) { $class->mk_comptest( $self, @args ); } - else { $self->_mk_comptest } - #################################################################### + else { + $self->_mk_comptest + } } # Fallback @@ -640,7 +648,7 @@ Create the main application skeleton. This is called by L. This method is called by L to make new components for your application. -=head3 mk_dir ($path) +=head2 mk_dir ($path) Surprisingly, this function makes a directory.