X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FHelper.pm;h=d63c7c107da4bf08a7098935acfe6ee59998b46e;hb=0f895006548490d5382421201b2f3f2f2406b7c6;hp=e86f6e66a0b2c7f738127e3c0fc1b8bfdeb5f1f0;hpb=e24c5c59f274a81a05ba60bc9fe4f991baae0bf5;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Helper.pm b/lib/Catalyst/Helper.pm index e86f6e6..d63c7c1 100644 --- a/lib/Catalyst/Helper.pm +++ b/lib/Catalyst/Helper.pm @@ -494,7 +494,7 @@ use warnings; # # Set flags and add plugins for the application # -# -Debug : activates the debug mode for very useful log messages +# -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/; @@ -604,7 +604,6 @@ use strict; use Catalyst::Build; my $build = Catalyst::Build->new( - create_makefile_pl => 'passthrough', license => 'perl', module_name => '[% name %]', requires => { Catalyst => '5.49' }, @@ -752,6 +751,7 @@ use Pod::Usage; use FindBin; use lib "$FindBin::Bin/../lib"; +my $debug = 0; my $fork = 0; my $help = 0; my $host = undef; @@ -763,6 +763,7 @@ my $restart_regex = '\.yml$|\.yaml$|\.pm$'; my @argv = @ARGV; GetOptions( + 'debug|d' => \$debug, 'fork' => \$fork, 'help|?' => \$help, 'host=s' => \$host, @@ -777,6 +778,9 @@ pod2usage(1) if $help; if ( $restart ) { $ENV{CATALYST_ENGINE} = 'HTTP::Restarter'; } +if ( $debug ) { + $ENV{CATALYST_DEBUG} = 1; +} require [% name %]; @@ -799,6 +803,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 @@ -834,14 +839,12 @@ 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 [% name %]; +use Catalyst::Test '[% name %]'; my $help = 0; @@ -849,7 +852,7 @@ GetOptions( 'help|?' => \$help ); pod2usage(1) if ( $help || !$ARGV[0] ); -print [% name %]->run($ARGV[0])->content . "\n"; +print request($ARGV[0])->content . "\n"; 1;