Fixed scripts on win32
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Helper.pm
index a020ed8..3d72db5 100644 (file)
@@ -66,7 +66,7 @@ sub mk_app {
     $self->{scriptgen} = $Catalyst::CATALYST_SCRIPT_GEN;
     $self->{author}    = $self->{author} = $ENV{'AUTHOR'}
       || eval { @{ [ getpwuid($<) ] }[6] }
-      || 'A clever guy';
+      || 'Catalyst developer';
     $self->_mk_dirs;
     $self->_mk_appclass;
     $self->_mk_build;
@@ -430,7 +430,7 @@ Catalyst based application.
 
 =head1 METHODS
 
-=over4
+=over 4
 
 =item default
 
@@ -441,6 +441,8 @@ sub default : Private {
     $c->res->output('Congratulations, [% name %] is on Catalyst!');
 }
 
+=back
+
 =head1 AUTHOR
 
 [%author%]
@@ -498,7 +500,7 @@ my $build = Catalyst::Build->new(
 );
 $build->create_build_script;
 __readme__
-Run script/[% apprefix %]_server.pl to test the application.
+Run script/[% appprefix %]_server.pl to test the application.
 __changes__
 This file documents the revision history for Perl extension [% name %].
 0.01  [% time %]
@@ -526,11 +528,16 @@ plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD};
 all_pod_coverage_ok();
 __cgi__
 [% startperl %] -w
-BEGIN { $ENV{CATALYST_ENGINE} ||= 'CGI' }
 
 use strict;
 use FindBin;
-use lib "$FindBin::Bin/../lib";
+use Path::Class;
+
+BEGIN {
+    $ENV{CATALYST_ENGINE} ||= 'CGI';
+    use lib dir($FindBin::Bin)->parent->subdir('lib')->stringify;
+}
+
 use [% name %];
 
 [% name %]->run;
@@ -564,11 +571,15 @@ it under the same terms as perl itself.
 __fastcgi__
 [% startperl %] -w
 
-BEGIN { $ENV{CATALYST_ENGINE} ||= 'FastCGI' }
-
 use strict;
 use FindBin;
-use lib "$FindBin::Bin/../lib";
+use Path::Class;
+
+BEGIN {
+    $ENV{CATALYST_ENGINE} ||= 'FastCGI';
+    use lib dir($FindBin::Bin)->parent->subdir('lib')->stringify;
+}
+
 use [% name %];
 
 [% name %]->run;
@@ -602,16 +613,18 @@ it under the same terms as perl itself.
 __server__
 [% startperl %] -w
 
-BEGIN { 
-    $ENV{CATALYST_ENGINE} ||= 'HTTP';
-    $ENV{CATALYST_SCRIPT_GEN} = [% scriptgen %];
-}  
-
 use strict;
 use Getopt::Long;
 use Pod::Usage;
 use FindBin;
-use lib "$FindBin::Bin/../lib";
+use Path::Class;
+
+BEGIN {
+    $ENV{CATALYST_ENGINE} ||= 'HTTP';
+    $ENV{CATALYST_SCRIPT_GEN} = [% scriptgen %];
+    use lib dir($FindBin::Bin)->parent->subdir('lib')->stringify;
+}
+
 use [% name %];
 
 my $help = 0;
@@ -660,13 +673,17 @@ it under the same terms as perl itself.
 __test__
 [% startperl %] -w
 
-BEGIN { $ENV{CATALYST_ENGINE} ||= 'Test' }
-
 use strict;
 use Getopt::Long;
 use Pod::Usage;
 use FindBin;
-use lib "$FindBin::Bin/../lib";
+use Path::Class;
+
+BEGIN {
+    $ENV{CATALYST_ENGINE} ||= 'Test';
+    use lib dir($FindBin::Bin)->parent->subdir('lib')->stringify;
+}
+
 use [% name %];
 
 my $help = 0;
@@ -793,7 +810,7 @@ Catalyst component.
 [% IF type == 'C' %]
 =head1 METHODS
 
-=over4
+=over 4
 
 =item default
 
@@ -803,6 +820,9 @@ sub default : Private {
     my ( $self, $c ) = @_;
     $c->res->output('Congratulations, [% class %] is on Catalyst!');
 }
+
+=back
+
 [% END %]
 =head1 AUTHOR