Back out - what the hell was the unexpected hunk. I fail at today.
[catagits/Catalyst-Devel.git] / lib / Catalyst / Helper.pm
index 5078b2e..8ab9ad2 100644 (file)
@@ -48,7 +48,7 @@ sub mk_app {
     # Needs to be here for PAR
     require Catalyst;
 
-    if ( $name =~ /[^\w\:]/ ) {
+    if ( $name =~ /[^\w:]/ || $name =~ /^\d/ || $name =~ /\b:\b|:{3,}/) {
         warn "Error: Invalid application name.\n";
         return 0;
     }
@@ -770,6 +770,7 @@ it under the same terms as Perl itself.
 
 1;
 __makefile__
+[% startperl %]
 # IMPORTANT: if you delete this file your app will not work as
 # expected.  You have been warned.
 use inc::Module::Install;
@@ -790,8 +791,8 @@ install_script glob('script/*.pl');
 auto_install;
 WriteAll;
 __config__
-# rename this file to [% name %].yml and put a : in front of "name" if
-# you want to use yaml like in old versions of Catalyst
+# rename this file to [% name %].yml and put a ':' in front of 'name' if
+# you want to use YAML like in old versions of Catalyst
 name [% name %]
 __readme__
 Run script/[% appprefix %]_server.pl to test the application.
@@ -801,6 +802,7 @@ This file documents the revision history for Perl extension [% name %].
 0.01  [% time %]
         - initial revision, generated by Catalyst
 __apptest__
+[% startperl %]
 use strict;
 use warnings;
 use Test::More tests => 2;
@@ -809,6 +811,7 @@ BEGIN { use_ok 'Catalyst::Test', '[% name %]' }
 
 ok( request('/')->is_success, 'Request should succeed' );
 __podtest__
+[% startperl %]
 use strict;
 use warnings;
 use Test::More;
@@ -819,6 +822,7 @@ plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD};
 
 all_pod_files_ok();
 __podcoveragetest__
+[% startperl %]
 use strict;
 use warnings;
 use Test::More;
@@ -900,7 +904,7 @@ pod2usage(1) if $help;
         pidfile => $pidfile,
         manager => $manager,
         detach  => $detach,
-       keep_stderr => $keep_stderr,
+        keep_stderr => $keep_stderr,
     }
 );
 
@@ -1027,11 +1031,13 @@ my $runner = sub {
 };
 
 if ( $restart ) {
-    require Catalyst::Restarter;
-
     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;
@@ -1042,7 +1048,7 @@ if ( $restart ) {
     $args{filter} = qr/$file_regex/
         if defined $file_regex;
 
-    my $restarter = Catalyst::Restarter->new(
+    my $restarter = $subclass->new(
         %args,
         start_sub => $runner,
     );