[Catalyst-commits] r10874 - in Catalyst-Devel/1.00/branches/helper_refactor: lib/Catalyst share/lib/Helper

t0m at dev.catalyst.perl.org t0m at dev.catalyst.perl.org
Sun Jul 12 17:44:06 GMT 2009


Author: t0m
Date: 2009-07-12 17:44:06 +0000 (Sun, 12 Jul 2009)
New Revision: 10874

Added:
   Catalyst-Devel/1.00/branches/helper_refactor/share/lib/Helper/compclass.pm.tt
Removed:
   Catalyst-Devel/1.00/branches/helper_refactor/share/lib/Helper/compclass.tt
Modified:
   Catalyst-Devel/1.00/branches/helper_refactor/lib/Catalyst/Helper.pm
Log:
Fix issues

Modified: Catalyst-Devel/1.00/branches/helper_refactor/lib/Catalyst/Helper.pm
===================================================================
--- Catalyst-Devel/1.00/branches/helper_refactor/lib/Catalyst/Helper.pm	2009-07-12 17:43:03 UTC (rev 10873)
+++ Catalyst-Devel/1.00/branches/helper_refactor/lib/Catalyst/Helper.pm	2009-07-12 17:44:06 UTC (rev 10874)
@@ -12,7 +12,6 @@
 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 @@
 
 =cut
 
-
-
 sub get_sharedir_file {
     my ($self, @filename) = @_;
     my $dist_dir;
@@ -41,6 +38,7 @@
         $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_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_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 @@
     }
 }
 
-
 =head1 DESCRIPTION
 
 This module is used by B<catalyst.pl> to create a set of scripts for a
@@ -655,10 +653,6 @@
 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<Path::Class::Dir>
-
 =cut
 
 =head2 get_sharedir_file

Copied: Catalyst-Devel/1.00/branches/helper_refactor/share/lib/Helper/compclass.pm.tt (from rev 10867, Catalyst-Devel/1.00/branches/helper_refactor/share/lib/Helper/compclass.tt)
===================================================================
--- Catalyst-Devel/1.00/branches/helper_refactor/share/lib/Helper/compclass.pm.tt	                        (rev 0)
+++ Catalyst-Devel/1.00/branches/helper_refactor/share/lib/Helper/compclass.pm.tt	2009-07-12 17:44:06 UTC (rev 10874)
@@ -0,0 +1,42 @@
+package [% class %];
+
+use strict;
+use warnings;
+use parent 'Catalyst::[% long_type %]';
+
+=head1 NAME
+
+[% class %] - Catalyst [% long_type %]
+
+=head1 DESCRIPTION
+
+Catalyst [% long_type %].
+[% IF long_type == 'Controller' %]
+=head1 METHODS
+
+=cut
+
+
+=head2 index
+
+=cut
+
+sub index :Path :Args(0) {
+    my ( $self, $c ) = @_;
+
+    $c->response->body('Matched [% class %] in [%name%].');
+}
+
+[% END %]
+=head1 AUTHOR
+
+[%author%]
+
+=head1 LICENSE
+
+This library is free software. You can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
+
+1;

Deleted: Catalyst-Devel/1.00/branches/helper_refactor/share/lib/Helper/compclass.tt
===================================================================
--- Catalyst-Devel/1.00/branches/helper_refactor/share/lib/Helper/compclass.tt	2009-07-12 17:43:03 UTC (rev 10873)
+++ Catalyst-Devel/1.00/branches/helper_refactor/share/lib/Helper/compclass.tt	2009-07-12 17:44:06 UTC (rev 10874)
@@ -1,42 +0,0 @@
-package [% class %];
-
-use strict;
-use warnings;
-use parent 'Catalyst::[% long_type %]';
-
-=head1 NAME
-
-[% class %] - Catalyst [% long_type %]
-
-=head1 DESCRIPTION
-
-Catalyst [% long_type %].
-[% IF long_type == 'Controller' %]
-=head1 METHODS
-
-=cut
-
-
-=head2 index
-
-=cut
-
-sub index :Path :Args(0) {
-    my ( $self, $c ) = @_;
-
-    $c->response->body('Matched [% class %] in [%name%].');
-}
-
-[% END %]
-=head1 AUTHOR
-
-[%author%]
-
-=head1 LICENSE
-
-This library is free software. You can redistribute it and/or modify
-it under the same terms as Perl itself.
-
-=cut
-
-1;




More information about the Catalyst-commits mailing list