File Coverage

blib/lib/Mojolicious/Command/Author/generate/dockerfile.pm
Criterion Covered Total %
statement 10 10 100.0
branch 1 2 50.0
condition n/a
subroutine 3 3 100.0
pod 1 1 100.0
total 15 16 93.7


line stmt bran cond sub pod time code
1             package Mojolicious::Command::Author::generate::dockerfile;
2 1     1   8 use Mojo::Base 'Mojolicious::Command';
  1         4  
  1         9  
3              
4 1     1   16 use Mojo::File qw(path);
  1         4  
  1         320  
5              
6             has description => 'Generate "Dockerfile"';
7             has usage => sub { shift->extract_usage };
8              
9             sub run {
10 1     1 1 50 my $self = shift;
11 1         11 my $name = $self->app->moniker;
12 1 50       30 my $exe = $ENV{MOJO_EXE} ? path($ENV{MOJO_EXE})->to_rel($self->app->home)->to_string : "script/$name";
13 1         22 $self->render_to_rel_file('dockerfile', 'Dockerfile', {name => $name, cmd => "./$exe prefork"});
14             }
15              
16             1;
17              
18             =encoding utf8
19              
20             =head1 NAME
21              
22             Mojolicious::Command::Author::generate::dockerfile - Dockerfile generator command
23              
24             =head1 SYNOPSIS
25              
26             Usage: APPLICATION generate dockerfile [OPTIONS]
27              
28             ./myapp.pl generate dockerfile
29             ./script/my_app generate dockerfile
30              
31             Options:
32             -h, --help Show this summary of available options
33              
34             =head1 DESCRIPTION
35              
36             L generates C for applications.
37              
38             This is a core command, that means it is always enabled and its code a good example for learning to build new commands,
39             you're welcome to fork it.
40              
41             See L for a list of commands that are available by default.
42              
43             =head1 ATTRIBUTES
44              
45             L inherits all attributes from L and
46             implements the following new ones.
47              
48             =head2 description
49              
50             my $description = $dockerfile->description;
51             $dockerfile = $dockerfile->description('Foo');
52              
53             Short description of this command, used for the command list.
54              
55             =head2 usage
56              
57             my $usage = $dockerfile->usage;
58             $dockerfile = $dockerfile->usage('Foo');
59              
60             Usage information for this command, used for the help screen.
61              
62             =head1 METHODS
63              
64             L inherits all methods from L and implements
65             the following new ones.
66              
67             =head2 run
68              
69             $dockerfile->run(@ARGV);
70              
71             Run this command.
72              
73             =head1 SEE ALSO
74              
75             L, L, L.
76              
77             =cut
78              
79             __DATA__