Mojolicious/Command/Author/generate.pm

filter: Statementstmt 100% 11 / 11 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 100% 1 / 1 totaltotal 100% 16 / 16 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
__ANON__
1.0
__ANON__
1.0
CRAP 1.0
« Mojo/HelloWorld.pm ↑ Summary Mojolicious/Command/Author/generate/makefile.pm »
1 package Mojolicious::Command::Author::generate;
2 1 ▶use Mojo::Base 'Mojolicious::Commands';
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 1 has description => 'Generate files and directories from templates';
5 1 has hint => <<EOF;
6  
7 See 'APPLICATION generate help GENERATOR' for more information on a specific
8 generator.
9 EOF
10 1 ▶has message => sub { shift->extract_usage . "\nGenerators:\n" };
Subroutine __ANON__: called CC=1 SCAR=0.0
11 5 ▶has namespaces => sub { ['Mojolicious::Command::Author::generate'] };
Subroutine __ANON__: called CC=1 SCAR=0.0
12  
13 1 ▶sub help { shift->run(@_) }
Subroutine help: called CC=1 SCAR=0.0
Pod documented
14  
15 1 1;
16  
17 =encoding utf8
18  
19 =head1 NAME
20  
21 Mojolicious::Command::Author::generate - Generator command
22  
23 =head1 SYNOPSIS
24  
25 Usage: APPLICATION generate GENERATOR [OPTIONS]
26  
27 mojo generate app
28 mojo generate lite-app
29  
30 =head1 DESCRIPTION
31  
32 L<Mojolicious::Command::Author::generate> lists available generators.
33  
34 This is a core command, that means it is always enabled and its code a good example for learning to build new commands,
35 you're welcome to fork it.
36  
37 See L<Mojolicious::Commands/"COMMANDS"> for a list of commands that are available by default.
38  
39 =head1 ATTRIBUTES
40  
41 L<Mojolicious::Command::Author::generate> inherits all attributes from L<Mojolicious::Commands> and implements the
42 following new ones.
43  
44 =head2 description
45  
46 my $description = $generator->description;
47 $generator = $generator->description('Foo');
48  
49 Short description of this command, used for the command list.
50  
51 =head2 hint
52  
53 my $hint = $generator->hint;
54 $generator = $generator->hint('Foo');
55  
56 Short hint shown after listing available generator commands.
57  
58 =head2 message
59  
60 my $msg = $generator->message;
61 $generator = $generator->message('Bar');
62  
63 Short usage message shown before listing available generator commands.
64  
65 =head2 namespaces
66  
67 my $namespaces = $generator->namespaces;
68 $generator = $generator->namespaces(['MyApp::Command::generate']);
69  
70 Namespaces to search for available generator commands, defaults to L<Mojolicious::Command::Author::generate>.
71  
72 =head1 METHODS
73  
74 L<Mojolicious::Command::Author::generate> inherits all methods from L<Mojolicious::Commands> and implements the
75 following new ones.
76  
77 =head2 help
78  
79 $generator->help('app');
80  
81 Print usage information for generator command.
82  
83 =head1 SEE ALSO
84  
85 L<Mojolicious>, L<Mojolicious::Guides>, L<https://mojolicious.org>.
86  
87 =cut
« Mojo/HelloWorld.pm ↑ Summary Mojolicious/Command/Author/generate/makefile.pm »