From: Tomas Doran Date: Sun, 12 Jul 2009 17:44:06 +0000 (+0000) Subject: Fix issues X-Git-Tag: 1.21_01~1^2~50 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Devel.git;a=commitdiff_plain;h=f8d3d4e0929da31ebbfdbe0238eae9b615a590d4 Fix issues --- diff --git a/lib/Catalyst/Helper.pm b/lib/Catalyst/Helper.pm index 4ce0071..871985f 100644 --- a/lib/Catalyst/Helper.pm +++ b/lib/Catalyst/Helper.pm @@ -12,7 +12,6 @@ use Catalyst::Utils; use Catalyst::Exception; use Path::Class qw/dir file/; use File::ShareDir qw/dist_dir/; -use aliased 'Path::Class::Dir'; use namespace::autoclean; my %cache; @@ -27,8 +26,6 @@ Catalyst::Helper - Bootstrap a Catalyst application =cut - - sub get_sharedir_file { my ($self, @filename) = @_; my $dist_dir; @@ -41,6 +38,7 @@ sub get_sharedir_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; } @@ -283,6 +281,7 @@ sub render_file { sub render_sharedir_file { my ( $self, $file, $path, $vars ) = @_; my $template = $self->get_sharedir_file( $file ); + die("Cannot get template from $file for $self\n") unless $template; $self->render_file_contents($template, $path, $vars); } @@ -443,13 +442,13 @@ sub _mk_create { sub _mk_compclass { my $self = shift; my $file = $self->{file}; - return $self->render_sharedir_file( 'lib', 'Helper', 'compclass.tt', "$file" ); + return $self->render_sharedir_file( File::Spec->catfile('lib', 'Helper', 'compclass.pm.tt'), $file ); } sub _mk_comptest { my $self = shift; my $test = $self->{test}; - $self->render_sharedir_file( 't', 'comptest.tt', "$test" ); ## wtf do i rename this to? + $self->render_sharedir_file( File::Spec->catfile('t', 'comptest.tt'), $test ); ## wtf do i rename this to? } sub _mk_images { @@ -495,7 +494,6 @@ sub _deprecate_file { } } - =head1 DESCRIPTION This module is used by B to create a set of scripts for a @@ -655,10 +653,6 @@ Writes content to a file. Called by L. Calculates the name of the next numbered test file and returns it. Don't give the number or the .t suffix for the test name. -=head2 Dir - -Alias for L - =cut =head2 get_sharedir_file diff --git a/share/lib/Helper/compclass.tt b/share/lib/Helper/compclass.pm.tt similarity index 100% rename from share/lib/Helper/compclass.tt rename to share/lib/Helper/compclass.pm.tt