X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FHelper.pm;h=d407feef41d5738b1cbb3925f0159e2f93b86ba4;hb=48b8b079e41ad454eeedf6f820c3071d100d8afa;hp=6a052e6001d7f209c1deb762b5d1d3c2b7d12b90;hpb=98380db73bd40e0169c98c7811763c209f70cb13;p=catagits%2FCatalyst-Devel.git diff --git a/lib/Catalyst/Helper.pm b/lib/Catalyst/Helper.pm index 6a052e6..d407fee 100644 --- a/lib/Catalyst/Helper.pm +++ b/lib/Catalyst/Helper.pm @@ -15,6 +15,11 @@ use Path::Class qw/dir file/; use File::ShareDir qw/dist_dir/; use namespace::autoclean; +with 'MooseX::Emulate::Class::Accessor::Fast'; + +# Change Catalyst/Devel.pm also +our $VERSION = '1.22'; + my %cache; =head1 NAME @@ -30,7 +35,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'; @@ -185,17 +193,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