| 1 | package Mojolicious::Command::Author::generate::lite_app; | ||||||||||||
| 2 | 1 | ▶ | use Mojo::Base 'Mojolicious::Command'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | |||||||||||||
| 4 | 1 | has description => 'Generate Mojolicious::Lite application'; | |||||||||||
| 5 | 4 | ▶ | has usage => sub { shift->extract_usage }; | ||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | |||||||||||||
| 7 | 1 | ▶ | sub run { | ||||||||||
|
Subroutine
run: called CC=2 SCAR=7.1
Pod
documented
| |||||||||||||
| 8 | 1 | ▶ | my ($self, $name) = (shift, shift || 'myapp.pl'); | ||||||||||
|
Condition50%1/2
shift() || 'myapp.pl'
MC/DC0%0/1
shift() || 'myapp.pl'
shift()
Truth table50%1/2
A
A= shift()
| |||||||||||||
| 9 | 1 | $self->render_to_rel_file('liteapp', $name); | |||||||||||
| 10 | 1 | $self->chmod_rel_file($name, 0744); | |||||||||||
| 11 | } | ||||||||||||
| 12 | |||||||||||||
| 13 | 1 | 1; | |||||||||||
| 14 | |||||||||||||
| 15 | =encoding utf8 | ||||||||||||
| 16 | |||||||||||||
| 17 | =head1 NAME | ||||||||||||
| 18 | |||||||||||||
| 19 | Mojolicious::Command::Author::generate::lite_app - Lite app generator command | ||||||||||||
| 20 | |||||||||||||
| 21 | =head1 SYNOPSIS | ||||||||||||
| 22 | |||||||||||||
| 23 | Usage: APPLICATION generate lite-app [OPTIONS] [NAME] | ||||||||||||
| 24 | |||||||||||||
| 25 | mojo generate lite-app | ||||||||||||
| 26 | mojo generate lite-app foo.pl | ||||||||||||
| 27 | |||||||||||||
| 28 | Options: | ||||||||||||
| 29 | -h, --help Show this summary of available options | ||||||||||||
| 30 | |||||||||||||
| 31 | =head1 DESCRIPTION | ||||||||||||
| 32 | |||||||||||||
| 33 | L<Mojolicious::Command::Author::generate::lite_app> generate fully functional L<Mojolicious::Lite> applications. | ||||||||||||
| 34 | |||||||||||||
| 35 | This is a core command, that means it is always enabled and its code a good example for learning to build new commands, | ||||||||||||
| 36 | you're welcome to fork it. | ||||||||||||
| 37 | |||||||||||||
| 38 | See L<Mojolicious::Commands/"COMMANDS"> for a list of commands that are available by default. | ||||||||||||
| 39 | |||||||||||||
| 40 | =head1 ATTRIBUTES | ||||||||||||
| 41 | |||||||||||||
| 42 | L<Mojolicious::Command::Author::generate::lite_app> inherits all attributes from L<Mojolicious::Command> and implements | ||||||||||||
| 43 | the following new ones. | ||||||||||||
| 44 | |||||||||||||
| 45 | =head2 description | ||||||||||||
| 46 | |||||||||||||
| 47 | my $description = $app->description; | ||||||||||||
| 48 | $app = $app->description('Foo'); | ||||||||||||
| 49 | |||||||||||||
| 50 | Short description of this command, used for the command list. | ||||||||||||
| 51 | |||||||||||||
| 52 | =head2 usage | ||||||||||||
| 53 | |||||||||||||
| 54 | my $usage = $app->usage; | ||||||||||||
| 55 | $app = $app->usage('Foo'); | ||||||||||||
| 56 | |||||||||||||
| 57 | Usage information for this command, used for the help screen. | ||||||||||||
| 58 | |||||||||||||
| 59 | =head1 METHODS | ||||||||||||
| 60 | |||||||||||||
| 61 | L<Mojolicious::Command::Author::generate::lite_app> inherits all methods from L<Mojolicious::Command> and implements | ||||||||||||
| 62 | the following new ones. | ||||||||||||
| 63 | |||||||||||||
| 64 | =head2 run | ||||||||||||
| 65 | |||||||||||||
| 66 | $app->run(@ARGV); | ||||||||||||
| 67 | |||||||||||||
| 68 | Run this command. | ||||||||||||
| 69 | |||||||||||||
| 70 | =head1 SEE ALSO | ||||||||||||
| 71 | |||||||||||||
| 72 | L<Mojolicious>, L<Mojolicious::Guides>, L<https://mojolicious.org>. | ||||||||||||
| 73 | |||||||||||||
| 74 | =cut | ||||||||||||
| 75 | |||||||||||||
| 76 | __DATA__ | ||||||||||||