1 package Catalyst::Script::Create;
6 use MooseX::Types::Moose qw/Str Bool/;
7 use namespace::autoclean;
9 has app => (isa => Str, is => 'ro', required => 1);
11 sub new_with_options { shift->new(@_) }
20 'nonew|force' => \$force,
21 'mech|mechanize' => \$mech,
25 pod2usage(1) if ( $help || !$ARGV[0] );
27 my $helper = Catalyst::Helper->new( { '.newfiles' => !$force, mech => $mech } );
29 pod2usage(1) unless $helper->mk_component( $self->app, @ARGV );
34 __PACKAGE__->meta->make_immutable;
39 boyosplace_create.pl - Create a new Catalyst Component
43 boyosplace_create.pl [options] model|view|controller name [helper] [options]
46 -force don't create a .new file where a file to be created exists
47 -mechanize use Test::WWW::Mechanize::Catalyst for tests if available
48 -help display this help and exits
51 boyosplace_create.pl controller My::Controller
52 boyosplace_create.pl controller My::Controller BindLex
53 boyosplace_create.pl -mechanize controller My::Controller
54 boyosplace_create.pl view My::View
55 boyosplace_create.pl view MyView TT
56 boyosplace_create.pl view TT TT
57 boyosplace_create.pl model My::Model
58 boyosplace_create.pl model SomeDB DBIC::Schema MyApp::Schema create=dynamic\
60 boyosplace_create.pl model AnotherDB DBIC::Schema MyApp::Schema create=static\
61 dbi:Pg:dbname=foo root 4321
64 perldoc Catalyst::Manual
65 perldoc Catalyst::Manual::Intro
69 Create a new Catalyst Component.
71 Existing component files are not overwritten. If any of the component files
72 to be created already exist the file will be written with a '.new' suffix.
73 This behavior can be suppressed with the C<-force> option.
77 Catalyst Contributors, see Catalyst.pm
81 This library is free software, you can redistribute it and/or modify
82 it under the same terms as Perl itself.