fixed paths to proper files
[catagits/Catalyst-Devel.git] / lib / Catalyst / Helper.pm
index 6def9fb..799d4f3 100644 (file)
@@ -349,12 +349,12 @@ sub _mk_dirs {
 sub _mk_appclass {
     my $self = shift;
     my $mod  = $self->{mod};
-    $self->render_sharedir_file( 'lib/appclass.tt', "$mod.pm" );
+    $self->render_sharedir_file( 'lib/MyApp.pm.tt', "$mod.pm" );
 }
 
 sub _mk_rootclass {
     my $self = shift;
-    $self->render_sharedir_file( 'lib/MyApp/Controller/rootclass.tt',
+    $self->render_sharedir_file( 'lib/MyApp/Controller/Root.pm.tt',
         File::Spec->catfile( $self->{c}, "Root.pm" ) );
 }
 
@@ -363,7 +363,7 @@ sub _mk_makefile {
     $self->{path} = File::Spec->catfile( 'lib', split( '::', $self->{name} ) );
     $self->{path} .= '.pm';
     my $dir = $self->{dir};
-    $self->render_sharedir_file( 'makefile.tt', "$dir\/Makefile.PL" );
+    $self->render_sharedir_file( 'Makefile.PL.tt', "$dir\/Makefile.PL" );
 
     if ( $self->{makefile} ) {
 
@@ -377,36 +377,36 @@ sub _mk_config {
     my $self      = shift;
     my $dir       = $self->{dir};
     my $appprefix = $self->{appprefix};
-    $self->render_sharedir_file( 'config.tt',
+    $self->render_sharedir_file( 'myapp.conf.tt',
         File::Spec->catfile( $dir, "$appprefix.conf" ) );
 }
 
 sub _mk_readme {
     my $self = shift;
     my $dir  = $self->{dir};
-    $self->render_sharedir_file( 'readme.tt', "$dir\/README" );
+    $self->render_sharedir_file( 'README.tt', "$dir\/README" );
 }
 
 sub _mk_changes {
     my $self = shift;
     my $dir  = $self->{dir};
     my $time = strftime('%Y-%m-%d %H:%M:%S', localtime time);
-    $self->render_sharedir_file( 'changes.tt', "$dir\/Changes", { time => $time } );
+    $self->render_sharedir_file( 'Changes.tt', "$dir\/Changes", { time => $time } );
 }
 
 sub _mk_apptest {
     my $self = shift;
     my $t    = $self->{t};
-    $self->render_sharedir_file( 't/apptest.tt',         "$t\/01app.t" );
-    $self->render_sharedir_file( 't/podtest.tt',         "$t\/02pod.t" );
-    $self->render_sharedir_file( 't/podcoveragetest.tt', "$t\/03podcoverage.t" );
+    $self->render_sharedir_file( 't/01app.t.tt',         "$t\/01app.t" );
+    $self->render_sharedir_file( 't/02pod.t.tt',         "$t\/02pod.t" );
+    $self->render_sharedir_file( 't/03podcoverage.tt', "$t\/03podcoverage.t" );
 }
 
 sub _mk_cgi {
     my $self      = shift;
     my $script    = $self->{script};
     my $appprefix = $self->{appprefix};
-    $self->render_sharedir_file( 'script/cgi.tt', "$script\/$appprefix\_cgi.pl" );
+    $self->render_sharedir_file( 'script/myapp_cgi.pl.tt', "$script\/$appprefix\_cgi.pl" );
     chmod 0700, "$script/$appprefix\_cgi.pl";
 }
 
@@ -414,7 +414,7 @@ sub _mk_fastcgi {
     my $self      = shift;
     my $script    = $self->{script};
     my $appprefix = $self->{appprefix};
-    $self->render_sharedir_file( 'script/fastcgi.tt', "$script\/$appprefix\_fastcgi.pl" );
+    $self->render_sharedir_file( 'script/myapp_fastcgi.pl.tt', "$script\/$appprefix\_fastcgi.pl" );
     chmod 0700, "$script/$appprefix\_fastcgi.pl";
 }
 
@@ -422,7 +422,7 @@ sub _mk_server {
     my $self      = shift;
     my $script    = $self->{script};
     my $appprefix = $self->{appprefix};
-    $self->render_sharedir_file( 'script/server.tt', "$script\/$appprefix\_server.pl" );
+    $self->render_sharedir_file( 'script/myapp_server.pl.tt', "$script\/$appprefix\_server.pl" );
     chmod 0700, "$script/$appprefix\_server.pl";
 }
 
@@ -430,7 +430,7 @@ sub _mk_test {
     my $self      = shift;
     my $script    = $self->{script};
     my $appprefix = $self->{appprefix};
-    $self->render_sharedir_file( 'script/test.tt', "$script/$appprefix\_test.pl" );
+    $self->render_sharedir_file( 'script/myapp_test.pl.tt', "$script/$appprefix\_test.pl" );
     chmod 0700, "$script/$appprefix\_test.pl";
 }
 
@@ -438,20 +438,20 @@ sub _mk_create {
     my $self      = shift;
     my $script    = $self->{script};
     my $appprefix = $self->{appprefix};
-    $self->render_sharedir_file( 'script/create.tt', "$script\/$appprefix\_create.pl" );
+    $self->render_sharedir_file( 'script/myapp_create.pl.tt', "$script\/$appprefix\_create.pl" );
     chmod 0700, "$script/$appprefix\_create.pl";
 }
 
 sub _mk_compclass {
     my $self = shift;
     my $file = $self->{file};
-    return $self->render_sharedir_file( 'compclass.tt', "$file" );
+    return $self->render_sharedir_file( 'myapp_compclass.pl.tt', "$file" );
 }
 
 sub _mk_comptest {
     my $self = shift;
     my $test = $self->{test};
-    $self->render_sharedir_file( 'comptest.tt', "$test" );
+    $self->render_sharedir_file( 'comptest.tt', "$test" );  ## wtf do i rename this to?
 }
 
 sub _mk_images {
@@ -462,7 +462,7 @@ sub _mk_images {
       btn_120x50_powered btn_120x50_powered_shadow btn_88x31_built
       btn_88x31_built_shadow btn_88x31_powered btn_88x31_powered_shadow/;
     for my $name (@images) {
-        my $image = $self->get_sharedir_file("root", "$name.png.bin");
+        my $image = $self->get_sharedir_file("root", "static", "images", "$name.png.bin");
         $self->mk_file( File::Spec->catfile( $images, "$name.png" ), $image );
     }
 }
@@ -692,6 +692,31 @@ Writes content to a file. Called by L</render_file>.
 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
+
+Method for getting a file out of share/
+
+=cut
+
+=head2 render_file_contents
+
+Process a L<Template::Toolkit> template.
+
+=cut
+
+=head2 render_sharedir_file
+
+Render a template/image file from our share directory
+
+=cut
+
+
 =head1 NOTE
 
 The helpers will read author name from /etc/passwd by default.