use FindBin;
use Template;
use Catalyst;
+use Catalyst::Utils;
use Catalyst::Exception;
my %cache;
$self->{name} = $name;
$self->{dir} = $name;
$self->{dir} =~ s/\:\:/-/g;
- $self->{appprefix} = lc $self->{dir};
- $self->{appprefix} =~ s/-/_/g;
+ $self->{appprefix} = Catalyst::Utils::appprefix($name);
$self->{startperl} = $Config{startperl};
$self->{scriptgen} = $Catalyst::CATALYST_SCRIPT_GEN || 4;
$self->{author} = $self->{author} = $ENV{'AUTHOR'}
=head1 LICENSE
-This library is free software . You can redistribute it and/or modify
-it under the same terms as perl itself.
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
=cut
package [% name %];
use strict;
+use warnings;
# -Debug activates the debug mode for very useful log messages
# Static::Simple will serve static files from the root directory
our $VERSION = '0.01';
# Configure the application
-[% name %]->config( name => '[% name %]' );
+__PACKAGE__->config( name => '[% name %]' );
# Start the application
-[% name %]->setup;
+__PACKAGE__->setup;
=head1 NAME
=head1 LICENSE
-This library is free software . You can redistribute it and/or modify
-it under the same terms as perl itself.
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
=cut
Copyright 2004 Sebastian Riedel. All rights reserved.
-This library is free software. You can redistribute it and/or modify
-it under the same terms as perl itself.
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
=cut
__fastcgi__
BEGIN { $ENV{CATALYST_ENGINE} ||= 'FastCGI' }
use strict;
+use Getopt::Long;
+use Pod::Usage;
use FindBin;
use lib "$FindBin::Bin/../lib";
use [% name %];
-[% name %]->run;
+my $help = 0;
+my ( $listen, $nproc );
+
+GetOptions(
+ 'help|?' => \$help,
+ 'listen|l=s' => \$listen,
+ 'nproc|n=i' => \$nproc,
+);
+
+pod2usage(1) if $help;
+
+[% name %]->run( $listen, { nproc => $nproc } );
1;
=head1 SYNOPSIS
-See L<Catalyst::Manual>
+[% appprefix %]_server.pl [options]
+
+ Options:
+ -? -help display this help and exits
+ -l -listen Socket path to listen on
+ (defaults to standard input)
+ can be HOST:PORT, :PORT or a
+ filesystem path
+ -n -nproc specify number of processes to keep
+ to serve requests (defaults to 1)
=head1 DESCRIPTION
Copyright 2004 Sebastian Riedel. All rights reserved.
-This library is free software. You can redistribute it and/or modify
-it under the same terms as perl itself.
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
=cut
__server__
Copyright 2004 Sebastian Riedel. All rights reserved.
-This library is free software. You can redistribute it and/or modify
-it under the same terms as perl itself.
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
=cut
__test__
Copyright 2004 Sebastian Riedel. All rights reserved.
-This library is free software. You can redistribute it and/or modify
-it under the same terms as perl itself.
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
=cut
__create__
Copyright 2004 Sebastian Riedel. All rights reserved.
-This library is free software. You can redistribute it and/or modify
-it under the same terms as perl itself.
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
=cut
__compclass__
package [% class %];
use strict;
+use warnings;
use base 'Catalyst::Base';
=head1 NAME
=head1 LICENSE
-This library is free software . You can redistribute it and/or modify
-it under the same terms as perl itself.
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
=cut