$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->{startperl } = -r '/usr/bin/env'
+ ? '#!/usr/bin/env perl'
+ : "#!$Config{perlpath} -w";
$self->{scriptgen } = $Catalyst::Devel::CATALYST_SCRIPT_GEN || 4;
$self->{catalyst_version} = $Catalyst::VERSION;
$self->{author } = $self->{author} = $ENV{'AUTHOR'}
These are the methods that the Helper classes can call on the
<$helper> object passed to them.
-=head2 render_file
+=head2 render_file ($file, $path, $vars)
-Render and create a file from a template in DATA using
-Template Toolkit.
+Render and create a file from a template in DATA using Template
+Toolkit. $file is the relevent chunk of the __DATA__ section, $path is
+the path to the file and $vars is the hashref as expected by
+L<Template Toolkit|Template>.
-=head2 get_file
+=head2 get_file ($class, $file)
Fetch file contents from the DATA section. This is used internally by
-L</render_file>.
+L</render_file>. $class is the name of the class to get the DATA
+section from. __PACKAGE__ or ( caller(0) )[0] might be sensible
+values for this.
=head2 mk_app
Create the main application skeleton. This is called by L<catalyst.pl>.
-=head2 mk_component
+=head2 mk_component ($app)
This method is called by L<create.pl> to make new components
for your application.
-=head3 mk_dir
+=head3 mk_dir ($path)
Surprisingly, this function makes a directory.
-=head2 mk_file
+=head2 mk_file ($file, $content)
Writes content to a file. Called by L</render_file>.
-=head2 next_test
+=head2 next_test ($test_name)
Calculates the name of the next numbered test file and returns it.
+Don't give the number or the .t suffix for the test name.
=head1 NOTE
=head1 LICENSE
-This library is free software, you can redistribute it and/or modify
+This library is free software. You can redistribute it and/or modify
it under the same terms as Perl itself.
=begin pod_to_ignore
# -Debug: activates the debug mode for very useful log messages
# ConfigLoader: will load the configuration from a Config::General file in the
# application's home directory
-# Static::Simple: will serve static files from the application's root
+# Static::Simple: will serve static files from the application's root
# directory
use parent qw/Catalyst/;
Static::Simple/;
our $VERSION = '0.01';
-# Configure the application.
+# Configure the application.
#
# Note that settings in [% appprefix %].conf (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,
-# with a external configuration file acting as an override for
+# with an external configuration file acting as an override for
# local deployment.
__PACKAGE__->config( name => '[% name %]' );
=head1 LICENSE
-This library is free software, you can redistribute it and/or modify
+This library is free software. You can redistribute it and/or modify
it under the same terms as Perl itself.
=cut
my ( $self, $c ) = @_;
$c->response->body( 'Page not found' );
$c->response->status(404);
-
}
=head2 end
Attempt to render a view, if needed.
-=cut
+=cut
sub end : ActionClass('RenderView') {}
=head1 LICENSE
-This library is free software, you can redistribute it and/or modify
+This library is free software. You can redistribute it and/or modify
it under the same terms as Perl itself.
=cut
=head1 COPYRIGHT
-This library is free software, you can redistribute it and/or modify
+This library is free software. You can redistribute it and/or modify
it under the same terms as Perl itself.
=cut
my $help = 0;
my ( $listen, $nproc, $pidfile, $manager, $detach, $keep_stderr );
-
+
GetOptions(
'help|?' => \$help,
'listen|l=s' => \$listen,
pod2usage(1) if $help;
-[% name %]->run(
- $listen,
+[% name %]->run(
+ $listen,
{ nproc => $nproc,
- pidfile => $pidfile,
+ pidfile => $pidfile,
manager => $manager,
detach => $detach,
keep_stderr => $keep_stderr,
=head1 SYNOPSIS
[% appprefix %]_fastcgi.pl [options]
-
+
Options:
-? -help display this help and exits
-l -listen Socket path to listen on
=head1 COPYRIGHT
-This library is free software, you can redistribute it and/or modify
+This library is free software. You can redistribute it and/or modify
it under the same terms as Perl itself.
=cut
__server__
[% startperl %]
-BEGIN {
+BEGIN {
$ENV{CATALYST_ENGINE} ||= 'HTTP';
$ENV{CATALYST_SCRIPT_GEN} = [% scriptgen %];
require Catalyst::Engine::HTTP;
-}
+}
use strict;
use warnings;
my $restart_regex = '(?:/|^)(?!\.#).+(?:\.yml$|\.yaml$|\.conf|\.pm)$';
my $restart_directory = undef;
my $follow_symlinks = 0;
+my $background = 0;
my @argv = @ARGV;
'restartregex|rr=s' => \$restart_regex,
'restartdirectory=s@' => \$restart_directory,
'followsymlinks' => \$follow_symlinks,
+ 'background' => \$background,
);
pod2usage(1) if $help;
restart_regex => qr/$restart_regex/,
restart_directory => $restart_directory,
follow_symlinks => $follow_symlinks,
+ background => $background,
} );
1;
(defaults to '[SCRIPT_DIR]/..')
-follow_symlinks follow symlinks in search directories
(defaults to false. this is a no-op on Win32)
+ -background run the process in the background
See also:
perldoc Catalyst::Manual
perldoc Catalyst::Manual::Intro
=head1 COPYRIGHT
-This library is free software, you can redistribute it and/or modify
+This library is free software. You can redistribute it and/or modify
it under the same terms as Perl itself.
=cut
=head1 COPYRIGHT
-This library is free software, you can redistribute it and/or modify
+This library is free software. You can redistribute it and/or modify
it under the same terms as Perl itself.
=cut
use warnings;
use Getopt::Long;
use Pod::Usage;
-eval "use Catalyst::Devel;";
+eval "use Catalyst::Helper;";
if ($@) {
die <<END;
perl -MCPAN -e 'install Catalyst::Devel'
perl -MCPANPLUS -e 'install Catalyst::Devel'
END
+}
my $force = 0;
my $mech = 0;
=head1 COPYRIGHT
-This library is free software, you can redistribute it and/or modify
+This library is free software. You can redistribute it and/or modify
it under the same terms as Perl itself.
=cut
=cut
-=head2 index
+=head2 index
=cut
=head1 LICENSE
-This library is free software, you can redistribute it and/or modify
+This library is free software. You can redistribute it and/or modify
it under the same terms as Perl itself.
=cut