1 package Catalyst::Script::Create;
6 use MooseX::Types::Moose qw/Str Bool/;
7 use namespace::autoclean;
14 traits => [qw(NoGetopt)],
20 traits => [qw(Getopt)],
21 cmd_aliases => 'nonew',
24 documentation => qq{ force new scripts }
28 traits => [qw(Getopt)],
32 documentation => qq{ display this help and exits },
36 traits => [qw(Getopt)],
40 documentation => qq{ force debug mode }
44 traits => [qw(Getopt)],
45 cmd_aliases => 'mech',
48 documentation => qq{ use WWW::Mechanize },
55 pod2usage(1) if ( $self->help || !$ARGV[0] );
57 my $helper = Catalyst::Helper->new( { '.newfiles' => !$self->force, mech => $self->mech } );
59 pod2usage(1) unless $helper->mk_component( $self->app, @ARGV );
63 __PACKAGE__->meta->make_immutable;
68 boyosplace_create.pl - Create a new Catalyst Component
72 boyosplace_create.pl [options] model|view|controller name [helper] [options]
75 -force don't create a .new file where a file to be created exists
76 -mechanize use Test::WWW::Mechanize::Catalyst for tests if available
77 -help display this help and exits
80 boyosplace_create.pl controller My::Controller
81 boyosplace_create.pl controller My::Controller BindLex
82 boyosplace_create.pl -mechanize controller My::Controller
83 boyosplace_create.pl view My::View
84 boyosplace_create.pl view MyView TT
85 boyosplace_create.pl view TT TT
86 boyosplace_create.pl model My::Model
87 boyosplace_create.pl model SomeDB DBIC::Schema MyApp::Schema create=dynamic\
89 boyosplace_create.pl model AnotherDB DBIC::Schema MyApp::Schema create=static\
90 dbi:Pg:dbname=foo root 4321
93 perldoc Catalyst::Manual
94 perldoc Catalyst::Manual::Intro
98 Create a new Catalyst Component.
100 Existing component files are not overwritten. If any of the component files
101 to be created already exist the file will be written with a '.new' suffix.
102 This behavior can be suppressed with the C<-force> option.
106 Catalyst Contributors, see Catalyst.pm
110 This library is free software, you can redistribute it and/or modify
111 it under the same terms as Perl itself.