Add built local::lib
[catagits/Gitalist.git] / local-lib5 / bin / catalyst.pl
CommitLineData
3fea05b9 1#!/usr/bin/perl -w
2
3eval 'exec /usr/bin/perl -w -S $0 ${1+"$@"}'
4 if 0; # not running under some shell
5
6use strict;
7use Getopt::Long;
8use Pod::Usage;
9BEGIN {
10eval " use Catalyst::Devel 1.0; ";
11
12if ($@) {
13 die <<END;
14To use the Catalyst development tools including catalyst.pl and the
15generated script/myapp_create.pl you need Catalyst::Helper, which is
16part of the Catalyst-Devel distribution. Please install this via a
17vendor package or by running one of -
18
19 perl -MCPAN -e 'install Catalyst::Devel'
20 perl -MCPANPLUS -e 'install Catalyst::Devel'
21END
22
23}
24};
25
26use Catalyst::Helper;
27
28my $force = 0;
29my $help = 0;
30my $makefile = 0;
31my $scripts = 0;
32
33GetOptions(
34 'help|?' => \$help,
35 'force|nonew' => \$force,
36 'makefile' => \$makefile,
37 'scripts' => \$scripts,
38);
39
40pod2usage(1) if ( $help || !$ARGV[0] );
41
42my $helper = Catalyst::Helper->new(
43 {
44 '.newfiles' => !$force,
45 'makefile' => $makefile,
46 'scripts' => $scripts,
47 name => $ARGV[0],
48 }
49);
50# Pass $ARGV[0] for compatibility with old ::Devel
51pod2usage(1) unless $helper->mk_app( $ARGV[0] );
52
531;
54__END__
55
56=head1 NAME
57
58catalyst - Bootstrap a Catalyst application
59
60=head1 SYNOPSIS
61
62catalyst.pl [options] application-name
63
64'catalyst.pl' creates a skeleton for a new application, and allows you to
65upgrade the skeleton of your old application.
66
67 Options:
68 -force don't create a .new file where a file to be created exists
69 -help display this help and exit
70 -makefile only update Makefile.PL
71 -scripts only update helper scripts
72
73 application-name must be a valid Perl module name and can include "::",
74 which will be converted to '-' in the project name.
75
76
77 Examples:
78 catalyst.pl My::App
79 catalyst.pl MyApp
80
81 To upgrade your app to a new version of Catalyst:
82 catalyst.pl -force -scripts MyApp
83
84
85=head1 DESCRIPTION
86
87The C<catalyst.pl> script bootstraps a Catalyst application, creating a
88directory structure populated with skeleton files.
89
90The application name must be a valid Perl module name. The name of the
91directory created is formed from the application name supplied, with double
92colons replaced with hyphens (so, for example, the directory for C<My::App> is
93C<My-App>).
94
95Using the example application name C<My::App>, the application directory will
96contain the following items:
97
98=over 4
99
100=item README
101
102a skeleton README file, which you are encouraged to expand on
103
104=item Changes
105
106a changes file with an initial entry for the creation of the application
107
108=item Makefile.PL
109
110Makefile.PL uses the C<Module::Install> system for packaging and distribution
111of the application.
112
113=item lib
114
115contains the application module (C<My/App.pm>) and
116subdirectories for model, view, and controller components (C<My/App/M>,
117C<My/App/V>, and C<My/App/C>).
118
119=item root
120
121root directory for your web document content. This is left empty.
122
123=item script
124
125a directory containing helper scripts:
126
127=over 4
128
129=item C<myapp_create.pl>
130
131helper script to generate new component modules
132
133=item C<myapp_server.pl>
134
135runs the generated application within a Catalyst test server, which can be
136used for testing without resorting to a full-blown web server configuration.
137
138=item C<myapp_cgi.pl>
139
140runs the generated application as a CGI script
141
142=item C<myapp_fastcgi.pl>
143
144runs the generated application as a FastCGI script
145
146=item C<myapp_test.pl>
147
148runs an action of the generated application from the comand line.
149
150=back
151
152=item t
153
154test directory
155
156=back
157
158The application module generated by the C<catalyst.pl> script is functional,
159although it reacts to all requests by outputting a friendly welcome screen.
160
161=head1 NOTE
162
163Neither C<catalyst.pl> nor the generated helper script will overwrite existing
164files. In fact the scripts will generate new versions of any existing files,
165adding the extension C<.new> to the filename. The C<.new> file is not created
166if would be identical to the existing file.
167
168This means you can re-run the scripts for example to see if newer versions of
169Catalyst or its plugins generate different code, or to see how you may have
170changed the generated code (although you do of course have all your code in a
171version control system anyway, don't you ...).
172
173=head1 SEE ALSO
174
175L<Catalyst::Manual>, L<Catalyst::Manual::Intro>
176
177=head1 AUTHORS
178
179Catalyst Contributors, see Catalyst.pm
180
181=head1 COPYRIGHT
182
183This library is free software, you can redistribute it and/or modify it under
184the same terms as Perl itself.
185
186=cut