use base 'Class::Accessor::Fast';
use Config;
use File::Spec;
+use File::Spec::Unix;
use File::Path;
use FindBin;
use IO::File;
# 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;
}
$self->{startperl } = -r '/usr/bin/env'
? '#!/usr/bin/env perl'
: "#!$Config{perlpath} -w";
- $self->{scriptgen } = $Catalyst::Devel::CATALYST_SCRIPT_GEN || 4;
+ $self->{scriptgen } = $Catalyst::Devel::CATALYST_SCRIPT_GEN
+ || die("Could not find SCRIPT_GEN");
$self->{catalyst_version} = $Catalyst::VERSION;
$self->{author } = $self->{author} = $ENV{'AUTHOR'}
|| eval { @{ [ getpwuid($<) ] }[6] }
sub _mk_makefile {
my $self = shift;
- $self->{path} = File::Spec->catfile( 'lib', split( '::', $self->{name} ) );
+ $self->{path} = File::Spec::Unix->catfile( 'lib', split( '::', $self->{name} ) );
$self->{path} .= '.pm';
my $dir = $self->{dir};
$self->render_file( 'makefile', "$dir\/Makefile.PL" );
This method is called by L<create.pl> to make new components
for your application.
-=head3 mk_dir ($path)
+=head2 mk_dir ($path)
Surprisingly, this function makes a directory.
'fork|f' => \$fork,
'help|?' => \$help,
'host=s' => \$host,
- 'port=s' => \$port,
+ 'port|p=s' => \$port,
'keepalive|k' => \$keepalive,
'restart|r' => \$restart,
'restartdelay|rd=s' => \$check_interval,
};
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;
$args{filter} = qr/$file_regex/
if defined $file_regex;
- my $restarter = Catalyst::Restarter->new(
+ my $restarter = $subclass->new(
%args,
start_sub => $runner,
+ argv => \@argv,
);
$restarter->run_and_watch;