missing changes
[catagits/Catalyst-Devel.git] / lib / Catalyst / Helper.pm
index e75e742..835c061 100644 (file)
@@ -16,7 +16,6 @@ use Catalyst::Exception;
 
 my %cache;
 
-our $VERSION = '1.00';
 
 =head1 NAME
 
@@ -75,6 +74,7 @@ sub mk_app {
     $self->{dir             } =~ s/\:\:/-/g;
     $self->{script          } = File::Spec->catdir( $self->{dir}, 'script' );
     $self->{appprefix       } = Catalyst::Utils::appprefix($name);
+    $self->{appenv          } = Catalyst::Utils::class2env($name);
     $self->{startperl       } = "#!$Config{perlpath} -w";
     $self->{scriptgen       } = $Catalyst::Devel::CATALYST_SCRIPT_GEN || 4;
     $self->{catalyst_version} = $Catalyst::VERSION;
@@ -388,7 +388,7 @@ sub _mk_readme {
 sub _mk_changes {
     my $self = shift;
     my $dir  = $self->{dir};
-    my $time = strftime('%Y-%m-%d %T', localtime time);
+    my $time = strftime('%Y-%m-%d %H:%M:%S', localtime time);
     $self->render_file( 'changes', "$dir\/Changes", { time => $time } );
 }
 
@@ -564,7 +564,7 @@ our $VERSION = '0.01';
 
 # Configure the application. 
 #
-# Note that settings in [% name %].yml (or other external
+# Note that settings in [% appprefix %].yml (or other external
 # configuration file that you set up manually) take precedence
 # over this when using ConfigLoader. Thus configuration
 # details given here can function as a default configuration,
@@ -667,7 +667,7 @@ use inc::Module::Install;
 name '[% dir %]';
 all_from '[% path %]';
 
-requires 'Catalyst' => '[% catalyst_version %]';
+requires 'Catalyst::Runtime' => '[% catalyst_version %]';
 requires 'Catalyst::Plugin::ConfigLoader';
 requires 'Catalyst::Plugin::Static::Simple';
 requires 'Catalyst::Action::RenderView';
@@ -768,7 +768,7 @@ use lib "$FindBin::Bin/../lib";
 use [% name %];
 
 my $help = 0;
-my ( $listen, $nproc, $pidfile, $manager, $detach );
+my ( $listen, $nproc, $pidfile, $manager, $detach, $keep_stderr );
  
 GetOptions(
     'help|?'      => \$help,
@@ -777,6 +777,7 @@ GetOptions(
     'pidfile|p=s' => \$pidfile,
     'manager|M=s' => \$manager,
     'daemon|d'    => \$detach,
+    'keeperr|e'   => \$keep_stderr,
 );
 
 pod2usage(1) if $help;
@@ -787,6 +788,7 @@ pod2usage(1) if $help;
         pidfile => $pidfile, 
         manager => $manager,
         detach  => $detach,
+       keep_stderr => $keep_stderr,
     }
 );
 
@@ -815,6 +817,8 @@ pod2usage(1) if $help;
    -M -manager   specify alternate process manager
                  (FCGI::ProcManager sub-class)
                  or empty string to disable
+   -e -keeperr   send error messages to STDOUT, not
+                 to the webserver
 
 =head1 DESCRIPTION
 
@@ -837,6 +841,7 @@ __server__
 BEGIN { 
     $ENV{CATALYST_ENGINE} ||= 'HTTP';
     $ENV{CATALYST_SCRIPT_GEN} = [% scriptgen %];
+    require Catalyst::Engine::HTTP;
 }  
 
 use strict;
@@ -850,11 +855,11 @@ my $debug             = 0;
 my $fork              = 0;
 my $help              = 0;
 my $host              = undef;
-my $port              = 3000;
+my $port              = $ENV{[% appenv %]_PORT} || $ENV{CATALYST_PORT} || 3000;
 my $keepalive         = 0;
-my $restart           = 0;
+my $restart           = $ENV{[% appenv %]_RELOAD} || $ENV{CATALYST_RELOAD} || 0;
 my $restart_delay     = 1;
-my $restart_regex     = '\.yml$|\.yaml$|\.pm$';
+my $restart_regex     = '(?:/|^)(?!\.#).+(?:\.yml$|\.yaml$|\.pm)$';
 my $restart_directory = undef;
 
 my @argv = @ARGV;
@@ -874,7 +879,7 @@ GetOptions(
 
 pod2usage(1) if $help;
 
-if ( $restart ) {
+if ( $restart && $ENV{CATALYST_ENGINE} eq 'HTTP' ) {
     $ENV{CATALYST_ENGINE} = 'HTTP::Restarter';
 }
 if ( $debug ) {
@@ -1039,6 +1044,7 @@ pod2usage(1) unless $helper->mk_component( '[% name %]', @ARGV );
 
  Examples:
    [% appprefix %]_create.pl controller My::Controller
+   [% appprefix %]_create.pl controller My::Controller BindLex
    [% appprefix %]_create.pl -mechanize controller My::Controller
    [% appprefix %]_create.pl view My::View
    [% appprefix %]_create.pl view MyView TT