add that goddamn =cut to the helper template (didn't I commit this 3 times already?)
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Helper.pm
index 0a1e108..c582aa2 100644 (file)
@@ -2,6 +2,7 @@ package Catalyst::Helper;
 
 use strict;
 use base 'Class::Accessor::Fast';
+use Config;
 use File::Spec;
 use File::Path;
 use IO::File;
@@ -69,7 +70,7 @@ sub mk_app {
     $self->{dir} =~ s/\:\:/-/g;
     $self->{script}    = File::Spec->catdir( $self->{dir}, 'script' );
     $self->{appprefix} = Catalyst::Utils::appprefix($name);
-    $self->{startperl} = '#!/usr/bin/perl -w';
+    $self->{startperl} = "#!$Config{perlpath} -w";
     $self->{scriptgen} = $Catalyst::CATALYST_SCRIPT_GEN || 4;
     $self->{author}    = $self->{author} = $ENV{'AUTHOR'}
       || eval { @{ [ getpwuid($<) ] }[6] }
@@ -98,7 +99,7 @@ sub mk_app {
         $self->_mk_test;
         $self->_mk_create;
     }
-    return 1;
+    return $self->{dir};
 }
 
 =head3 mk_component
@@ -115,7 +116,7 @@ sub mk_component {
     $self->{author} = $self->{author} = $ENV{'AUTHOR'}
       || eval { @{ [ getpwuid($<) ] }[6] }
       || 'A clever guy';
-    $self->{base} = File::Spec->catdir( $FindBin::Bin, '..' );
+    $self->{base} ||= File::Spec->catdir( $FindBin::Bin, '..' );
     unless ( $_[0] =~ /^(?:model|view|controller)$/i ) {
         my $helper = shift;
         my @args   = @_;
@@ -554,6 +555,8 @@ Catalyst based application.
 
 =head1 METHODS
 
+=cut
+
 =head2 default
 
 =cut
@@ -605,7 +608,7 @@ license('perl');
 
 include('ExtUtils::AutoInstall');
 
-requires( Catalyst => '5.58' );
+requires( Catalyst => '5.60' );
 
 catalyst_files();
 
@@ -621,7 +624,7 @@ This file documents the revision history for Perl extension [% name %].
         - initial revision, generated by Catalyst
 __apptest__
 use Test::More tests => 2;
-use_ok( Catalyst::Test, '[% name %]' );
+BEGIN { use_ok( Catalyst::Test, '[% name %]' ); }
 
 ok( request('/')->is_success );
 __podtest__
@@ -802,6 +805,8 @@ if ( $debug ) {
     $ENV{CATALYST_DEBUG} = 1;
 }
 
+# This is require instead of use so that the above environment
+# variables can be set at runtime.
 require [% name %];
 
 [% name %]->run( $port, $host, {