File Coverage

blib/lib/Mojolicious/Command/psgi.pm
Criterion Covered Total %
statement 7 7 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod 1 1 100.0
total 11 11 100.0


line stmt bran cond sub pod time code
1             package Mojolicious::Command::psgi;
2 2     2   551 use Mojo::Base 'Mojolicious::Command';
  2         3  
  2         12  
3              
4 2     2   689 use Mojo::Server::PSGI;
  2         6  
  2         20  
5              
6             has description => 'Start application with PSGI';
7             has usage => sub { shift->extract_usage };
8              
9 11     11 1 45 sub run { Mojo::Server::PSGI->new(app => shift->app)->to_psgi_app }
10              
11             1;
12              
13             =encoding utf8
14              
15             =head1 NAME
16              
17             Mojolicious::Command::psgi - PSGI command
18              
19             =head1 SYNOPSIS
20              
21             Usage: APPLICATION psgi [OPTIONS]
22              
23             ./myapp.pl psgi
24              
25             Options:
26             -h, --help Show this summary of available options
27             --home Path to home directory of your application, defaults to
28             the value of MOJO_HOME or auto-detection
29             -m, --mode Operating mode for your application, defaults to the
30             value of MOJO_MODE/PLACK_ENV or "development"
31              
32             =head1 DESCRIPTION
33              
34             L starts applications with the L backend.
35              
36             This is a core command, that means it is always enabled and its code a good example for learning to build new commands,
37             you're welcome to fork it.
38              
39             See L for a list of commands that are available by default.
40              
41             =head1 ATTRIBUTES
42              
43             L inherits all attributes from L and implements the following new
44             ones.
45              
46             =head2 description
47              
48             my $description = $psgi->description;
49             $psgi = $psgi->description('Foo');
50              
51             Short description of this command, used for the command list.
52              
53             =head2 usage
54              
55             my $usage = $psgi->usage;
56             $psgi = $psgi->usage('Foo');
57              
58             Usage information for this command, used for the help screen.
59              
60             =head1 METHODS
61              
62             L inherits all methods from L and implements the following new ones.
63              
64             =head2 run
65              
66             my $app = $psgi->run;
67              
68             Run this command.
69              
70             =head1 SEE ALSO
71              
72             L, L, L.
73              
74             =cut