[Catalyst-commits] r10664 - Catalyst-Devel/1.00/branches/helper_refactor/share/script

dhoss at dev.catalyst.perl.org dhoss at dev.catalyst.perl.org
Thu Jun 25 10:44:04 GMT 2009


Author: dhoss
Date: 2009-06-25 10:44:03 +0000 (Thu, 25 Jun 2009)
New Revision: 10664

Modified:
   Catalyst-Devel/1.00/branches/helper_refactor/share/script/myapp_cgi.pl.tt
   Catalyst-Devel/1.00/branches/helper_refactor/share/script/myapp_fastcgi.pl.tt
   Catalyst-Devel/1.00/branches/helper_refactor/share/script/myapp_server.pl.tt
   Catalyst-Devel/1.00/branches/helper_refactor/share/script/myapp_test.pl.tt
Log:
updated script templates to reflect new -Runtime scripts


Modified: Catalyst-Devel/1.00/branches/helper_refactor/share/script/myapp_cgi.pl.tt
===================================================================
--- Catalyst-Devel/1.00/branches/helper_refactor/share/script/myapp_cgi.pl.tt	2009-06-25 10:37:12 UTC (rev 10663)
+++ Catalyst-Devel/1.00/branches/helper_refactor/share/script/myapp_cgi.pl.tt	2009-06-25 10:44:03 UTC (rev 10664)
@@ -1,15 +1,8 @@
 [% startperl %]
 
-BEGIN { $ENV{CATALYST_ENGINE} ||= 'CGI' }
+use Catalyst::ScriptRunner;
+Catalyst::ScriptRunner->run('Catalyst','CGI');
 
-use strict;
-use warnings;
-use FindBin;
-use lib "$FindBin::Bin/../lib";
-use [% name %];
-
-[% name %]->run;
-
 1;
 
 =head1 NAME

Modified: Catalyst-Devel/1.00/branches/helper_refactor/share/script/myapp_fastcgi.pl.tt
===================================================================
--- Catalyst-Devel/1.00/branches/helper_refactor/share/script/myapp_fastcgi.pl.tt	2009-06-25 10:37:12 UTC (rev 10663)
+++ Catalyst-Devel/1.00/branches/helper_refactor/share/script/myapp_fastcgi.pl.tt	2009-06-25 10:44:03 UTC (rev 10664)
@@ -1,40 +1,8 @@
 [% startperl %]
 
-BEGIN { $ENV{CATALYST_ENGINE} ||= 'FastCGI' }
+use Catalyst::ScriptRunner;
+Catalyst::ScriptRunner->run('Catalyst','FastCGI');
 
-use strict;
-use warnings;
-use Getopt::Long;
-use Pod::Usage;
-use FindBin;
-use lib "$FindBin::Bin/../lib";
-use [% name %];
-
-my $help = 0;
-my ( $listen, $nproc, $pidfile, $manager, $detach, $keep_stderr );
-
-GetOptions(
-    'help|?'      => \$help,
-    'listen|l=s'  => \$listen,
-    'nproc|n=i'   => \$nproc,
-    'pidfile|p=s' => \$pidfile,
-    'manager|M=s' => \$manager,
-    'daemon|d'    => \$detach,
-    'keeperr|e'   => \$keep_stderr,
-);
-
-pod2usage(1) if $help;
-
-[% name %]->run(
-    $listen,
-    {   nproc   => $nproc,
-        pidfile => $pidfile,
-        manager => $manager,
-        detach  => $detach,
-        keep_stderr => $keep_stderr,
-    }
-);
-
 1;
 
 =head1 NAME

Modified: Catalyst-Devel/1.00/branches/helper_refactor/share/script/myapp_server.pl.tt
===================================================================
--- Catalyst-Devel/1.00/branches/helper_refactor/share/script/myapp_server.pl.tt	2009-06-25 10:37:12 UTC (rev 10663)
+++ Catalyst-Devel/1.00/branches/helper_refactor/share/script/myapp_server.pl.tt	2009-06-25 10:44:03 UTC (rev 10664)
@@ -24,69 +24,12 @@
     );
 }
 
-__PACKAGE__->new_with_options->run;
 
 
-pod2usage(1) if $help;
+__PACKAGE__->new_with_options->run;
 
-if ( $debug ) {
-    $ENV{CATALYST_DEBUG} = 1;
-}
 
-# If we load this here, then in the case of a restarter, it does not
-# need to be reloaded for each restart.
-require Catalyst;
 
-# If this isn't done, then the Catalyst::Devel tests for the restarter
-# fail.
-$| = 1 if $ENV{HARNESS_ACTIVE};
-
-my $runner = sub {
-    # This is require instead of use so that the above environment
-    # variables can be set at runtime.
-    require [% name %];
-
-    [% name %]->run(
-        $port, $host,
-        {
-            argv       => \@argv,
-            'fork'     => $fork,
-            keepalive  => $keepalive,
-            background => $background,
-            pidfile    => $pidfile,
-        }
-    );
-};
-
-if ( $restart ) {
-    die "Cannot run in the background and also watch for changed files.\n"
-        if $background;
-
-    require Catalyst::Restarter;
-
-    my $subclass = Catalyst::Restarter->pick_subclass;
-
-    my %args;
-    $args{follow_symlinks} = 1
-        if $follow_symlinks;
-    $args{directories} = $watch_directory
-        if defined $watch_directory;
-    $args{sleep_interval} = $check_interval
-        if defined $check_interval;
-    $args{filter} = qr/$file_regex/
-        if defined $file_regex;
-
-    my $restarter = $subclass->new(
-        %args,
-        start_sub => $runner,
-    );
-
-    $restarter->run_and_watch;
-}
-else {
-    $runner->();
-}
-
 1;
 
 =head1 NAME

Modified: Catalyst-Devel/1.00/branches/helper_refactor/share/script/myapp_test.pl.tt
===================================================================
--- Catalyst-Devel/1.00/branches/helper_refactor/share/script/myapp_test.pl.tt	2009-06-25 10:37:12 UTC (rev 10663)
+++ Catalyst-Devel/1.00/branches/helper_refactor/share/script/myapp_test.pl.tt	2009-06-25 10:44:03 UTC (rev 10664)
@@ -1,23 +1,11 @@
 [% startperl %]
 
-use strict;
-use warnings;
-use Getopt::Long;
-use Pod::Usage;
-use FindBin;
-use lib "$FindBin::Bin/../lib";
-use Catalyst::Test '[% name %]';
+use Catalyst::ScriptRunner;
+Catalyst::ScriptRunner->run('Catalyst','Test');
 
-my $help = 0;
-
-GetOptions( 'help|?' => \$help );
-
-pod2usage(1) if ( $help || !$ARGV[0] );
-
-print request($ARGV[0])->content . "\n";
-
 1;
 
+
 =head1 NAME
 
 [% appprefix %]_test.pl - Catalyst Test




More information about the Catalyst-commits mailing list