line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojolicious::Command::Author::generate::lite_app; |
2
|
1
|
|
|
1
|
|
8
|
use Mojo::Base 'Mojolicious::Command'; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
9
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
has description => 'Generate Mojolicious::Lite application'; |
5
|
|
|
|
|
|
|
has usage => sub { shift->extract_usage }; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub run { |
8
|
1
|
|
50
|
1
|
1
|
113
|
my ($self, $name) = (shift, shift || 'myapp.pl'); |
9
|
1
|
|
|
|
|
16
|
$self->render_to_rel_file('liteapp', $name); |
10
|
1
|
|
|
|
|
18
|
$self->chmod_rel_file($name, 0744); |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
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 generate fully functional L 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 for a list of commands that are available by default. |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
L inherits all attributes from L 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 inherits all methods from L 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, L, L. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=cut |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
__DATA__ |