X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FScript%2FCreate.pm;h=7d318fe08a4cbe922e03f34f501e55b4b005ae58;hb=b89d8b9875b08957089b2758fb3533bf8fc1e0c6;hp=e65a597176912f67249768ccecb06cb1f579311f;hpb=3453b9295cbc4a512f28f5130994d698fcc5e250;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Script/Create.pm b/lib/Catalyst/Script/Create.pm index e65a597..7d318fe 100644 --- a/lib/Catalyst/Script/Create.pm +++ b/lib/Catalyst/Script/Create.pm @@ -1,35 +1,41 @@ package Catalyst::Script::Create; use Moose; -use MooseX::Types::Moose qw/Bool/; +use MooseX::Types::Moose qw/Bool Str/; use namespace::autoclean; with 'Catalyst::ScriptRole'; has force => ( - traits => [qw(Getopt)], - cmd_aliases => 'nonew', - isa => Bool, - is => 'ro', + traits => [qw(Getopt)], + cmd_aliases => 'nonew', + isa => Bool, + is => 'ro', documentation => 'Force new scripts', ); has debug => ( - traits => [qw(Getopt)], - cmd_aliases => 'd', - isa => Bool, - is => 'ro', + traits => [qw(Getopt)], + cmd_aliases => 'd', + isa => Bool, + is => 'ro', documentation => 'Force debug mode', ); has mechanize => ( - traits => [qw(Getopt)], - cmd_aliases => 'mech', - isa => Bool, - is => 'ro', + traits => [qw(Getopt)], + cmd_aliases => 'mech', + isa => Bool, + is => 'ro', documentation => 'use WWW::Mechanize', ); -has helper_class => ( isa => 'Str', is => 'ro', default => 'Catalyst::Helper' ); +has helper_class => ( + isa => Str, + is => 'ro', + builder => '_build_helper_class', +); + +sub _build_helper_class { 'Catalyst::Helper' } sub run { my ($self) = @_; @@ -55,9 +61,9 @@ Catalyst::Script::Create - Create a new Catalyst Component myapp_create.pl [options] model|view|controller name [helper] [options] Options: - -force don't create a .new file where a file to be created exists - -mechanize use Test::WWW::Mechanize::Catalyst for tests if available - -help display this help and exits + --force don't create a .new file where a file to be created exists + --mechanize use Test::WWW::Mechanize::Catalyst for tests if available + --help display this help and exits Examples: myapp_create.pl controller My::Controller @@ -82,7 +88,7 @@ Create a new Catalyst Component. Existing component files are not overwritten. If any of the component files to be created already exist the file will be written with a '.new' suffix. -This behavior can be suppressed with the C<-force> option. +This behavior can be suppressed with the C<--force> option. =head1 AUTHORS