Initial updates
[catagits/Catalyst-Devel.git] / lib / Catalyst / Helper.pm
index b6b0675..75a9a37 100644 (file)
@@ -1,6 +1,7 @@
 package Catalyst::Helper;
 
 use strict;
+use warnings;
 use base 'Class::Accessor::Fast';
 use Config;
 use File::Spec;
@@ -13,6 +14,8 @@ use Catalyst::Exception;
 
 my %cache;
 
+our $VERSION = '1.00';
+
 =head1 NAME
 
 Catalyst::Helper - Bootstrap a Catalyst application
@@ -65,14 +68,15 @@ sub mk_app {
         warn "Error: Invalid application name.\n";
         return 0;
     }
-    $self->{name} = $name;
-    $self->{dir}  = $name;
-    $self->{dir} =~ s/\:\:/-/g;
-    $self->{script}    = File::Spec->catdir( $self->{dir}, 'script' );
-    $self->{appprefix} = Catalyst::Utils::appprefix($name);
-    $self->{startperl} = "#!$Config{perlpath} -w";
-    $self->{scriptgen} = $Catalyst::CATALYST_SCRIPT_GEN || 4;
-    $self->{author}    = $self->{author} = $ENV{'AUTHOR'}
+    $self->{name            } = $name;
+    $self->{dir             } = $name;
+    $self->{dir             } =~ s/\:\:/-/g;
+    $self->{script          } = File::Spec->catdir( $self->{dir}, 'script' );
+    $self->{appprefix       } = Catalyst::Utils::appprefix($name);
+    $self->{startperl       } = "#!$Config{perlpath} -w";
+    $self->{scriptgen       } = $Catalyst::CATALYST_SCRIPT_GEN || 4;
+    $self->{catalyst_version} = $Catalyst::VERSION;
+    $self->{author          } = $self->{author} = $ENV{'AUTHOR'}
       || eval { @{ [ getpwuid($<) ] }[6] }
       || 'Catalyst developer';
 
@@ -529,6 +533,8 @@ Sebastian Riedel, C<sri@oook.de>
 This library is free software, you can redistribute it and/or modify
 it under the same terms as Perl itself.
 
+=begin pod_to_ignore
+
 =cut
 
 1;
@@ -540,6 +546,8 @@ package [% name %];
 use strict;
 use warnings;
 
+use Catalyst::Runtime '5.70';
+
 #
 # Set flags and add plugins for the application
 #
@@ -554,7 +562,12 @@ use Catalyst qw/-Debug ConfigLoader Static::Simple/;
 our $VERSION = '0.01';
 
 #
-# Configure the application 
+# Configure the application. 
+#
+# Note that settings in [% name %].yml take precedence over
+# this when using ConfigLoader. Thus configuration details
+# given here can function as a default configuration, with a
+# YAML file acting as an override for local deployment.
 #
 __PACKAGE__->config( name => '[% name %]' );
 
@@ -670,8 +683,9 @@ use inc::Module::Install;
 name '[% dir %]';
 all_from '[% path %]';
 
-requires Catalyst => '5.64';
-
+requires Catalyst => '[% catalyst_version %]';
+requires YAML; # This should reflect the config file format you've chosen
+               # See Catalyst::Plugin::ConfigLoader for supported formats
 catalyst;
 
 install_script glob('script/*.pl');
@@ -721,6 +735,7 @@ __cgi__
 BEGIN { $ENV{CATALYST_ENGINE} ||= 'CGI' }
 
 use strict;
+use warnings;
 use FindBin;
 use lib "$FindBin::Bin/../lib";
 use [% name %];
@@ -759,6 +774,7 @@ __fastcgi__
 BEGIN { $ENV{CATALYST_ENGINE} ||= 'FastCGI' }
 
 use strict;
+use warnings;
 use Getopt::Long;
 use Pod::Usage;
 use FindBin;
@@ -839,6 +855,7 @@ BEGIN {
 }  
 
 use strict;
+use warnings;
 use Getopt::Long;
 use Pod::Usage;
 use FindBin;
@@ -945,6 +962,7 @@ __test__
 [% startperl %]
 
 use strict;
+use warnings;
 use Getopt::Long;
 use Pod::Usage;
 use FindBin;
@@ -1000,6 +1018,7 @@ __create__
 [% startperl %]
 
 use strict;
+use warnings;
 use Getopt::Long;
 use Pod::Usage;
 use Catalyst::Helper;