X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FHelper.pm;h=0c3880077ddcd56ee9af9adb796b6a34fbd572a3;hb=1f9cb7c179c8e4077d99badf31f3a356efdc809c;hp=470809ada5fe62943c18c3bdefe6de544070c867;hpb=e4d883627ffd461f5ad4c55f3d6f5126c6513616;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Helper.pm b/lib/Catalyst/Helper.pm index 470809a..0c38800 100644 --- a/lib/Catalyst/Helper.pm +++ b/lib/Catalyst/Helper.pm @@ -491,16 +491,24 @@ package [% name %]; use strict; use warnings; -# -Debug activates the debug mode for very useful log messages -# Static::Simple will serve static files from the root directory +# +# Set flags and add plugins for the application +# +# -Debug: activates the debug mode for very useful log messages +# Static::Simple: will serve static files from the applications root directory +# use Catalyst qw/-Debug Static::Simple/; our $VERSION = '0.01'; +# # Configure the application +# __PACKAGE__->config( name => '[% name %]' ); +# # Start the application +# __PACKAGE__->setup; =head1 NAME @@ -523,7 +531,9 @@ Catalyst based application. =cut +# # Output a friendly welcome message +# sub default : Private { my ( $self, $c ) = @_; @@ -531,7 +541,9 @@ sub default : Private { $c->response->body( $c->welcome_message ); } -# Uncomment and modify this end action after adding a View class +# +# Uncomment and modify this end action after adding a View component +# #=item end # #=cut @@ -740,6 +752,7 @@ use Pod::Usage; use FindBin; use lib "$FindBin::Bin/../lib"; +my $debug = 0; my $fork = 0; my $help = 0; my $host = undef; @@ -751,6 +764,7 @@ my $restart_regex = '\.yml$|\.yaml$|\.pm$'; my @argv = @ARGV; GetOptions( + 'debug|d' => \$debug, 'fork' => \$fork, 'help|?' => \$help, 'host=s' => \$host, @@ -765,6 +779,9 @@ pod2usage(1) if $help; if ( $restart ) { $ENV{CATALYST_ENGINE} = 'HTTP::Restarter'; } +if ( $debug ) { + $ENV{CATALYST_DEBUG} = 1; +} require [% name %]; @@ -787,6 +804,7 @@ require [% name %]; [% appprefix %]_server.pl [options] Options: + -d -debug force debug mode -f -fork handle each request in a new process (defaults to false) -? -help display this help and exits @@ -972,7 +990,9 @@ Catalyst [% long_type %]. =over 4 -# Uncomment, modify and add new actions to fit your needs +# +# Uncomment and modify this or add new actions to fit your needs +# #=item default # #=cut