package Catalyst::Script::Create;
use Moose;
-use Catalyst::Helper;
use MooseX::Types::Moose qw/Bool/;
use namespace::autoclean;
documentation => 'use WWW::Mechanize',
);
+has helper_class => ( isa => 'Str', is => 'ro', default => 'Catalyst::Helper' );
+
sub run {
my ($self) = @_;
- $self->_display_help if ( !$ARGV[0] );
+ $self->_exit_with_usage if !$self->ARGV->[0];
- my $helper = Catalyst::Helper->new( { '.newfiles' => !$self->force, mech => $self->mech } );
+ my $helper_class = $self->helper_class;
+ Class::MOP::load_class($helper_class);
+ my $helper = $helper_class->new( { '.newfiles' => !$self->force, mech => $self->mechanize } );
- $self->_display_help unless $helper->mk_component( $self->app, @ARGV );
+ $self->_exit_with_usage unless $helper->mk_component( $self->application_name, @ARGV );
}
__PACKAGE__->meta->make_immutable;
-1;
=head1 NAME
it under the same terms as Perl itself.
=cut
+