| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Mojolicious::Command::perldoc; |
|
2
|
1
|
|
|
1
|
|
662
|
use Mojo::Base 'Mojolicious::Command'; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
# This command is a copy of Mojolicious::Command::daemon |
|
5
|
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
126814
|
use Getopt::Long qw(GetOptionsFromArray :config no_auto_abbrev no_ignore_case); |
|
|
1
|
|
|
|
|
11284
|
|
|
|
1
|
|
|
|
|
5
|
|
|
7
|
1
|
|
|
1
|
|
1116
|
use Mojo::Server::Daemon; |
|
|
1
|
|
|
|
|
61780
|
|
|
|
1
|
|
|
|
|
12
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
has description => 'Quickly serve perldoc files'; |
|
10
|
|
|
|
|
|
|
has usage => sub { shift->extract_usage }; |
|
11
|
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
82
|
use File::Basename; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
361
|
|
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub run { |
|
15
|
0
|
|
|
0
|
1
|
|
my ($self, @args) = @_; |
|
16
|
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
my $daemon = Mojo::Server::Daemon->new(app => Mojolicious->new); |
|
18
|
0
|
|
|
|
|
|
$daemon->app->plugin('PODRenderer'); |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
GetOptionsFromArray \@args, |
|
21
|
0
|
|
|
0
|
|
|
'b|backlog=i' => sub { $daemon->backlog($_[1]) }, |
|
22
|
0
|
|
|
0
|
|
|
'c|clients=i' => sub { $daemon->max_clients($_[1]) }, |
|
23
|
0
|
|
|
0
|
|
|
'i|inactivity-timeout=i' => sub { $daemon->inactivity_timeout($_[1]) }, |
|
24
|
|
|
|
|
|
|
'l|listen=s' => \my @listen, |
|
25
|
0
|
|
|
0
|
|
|
'p|proxy' => sub { $daemon->reverse_proxy(1) }, |
|
26
|
0
|
|
|
0
|
|
|
'r|requests=i' => sub { $daemon->max_requests($_[1]) }; |
|
|
0
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
|
28
|
0
|
0
|
|
|
|
|
$daemon->listen(\@listen) if @listen; |
|
29
|
0
|
|
|
|
|
|
$daemon->run; |
|
30
|
|
|
|
|
|
|
} |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=encoding utf8 |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 NAME |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Mojolicious::Command::perldoc - Quickly serve perldoc files |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
Usage: APPLICATION perldoc [OPTIONS] |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
./myapp.pl perldoc |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
Options: |
|
47
|
|
|
|
|
|
|
-h, --help Show this summary of available options |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
L quickly serves perldoc files |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Serves files from the current directory as well as those specified on the |
|
54
|
|
|
|
|
|
|
command line. Numeric shortcuts (e.g. /1, /2, etc) are created for files |
|
55
|
|
|
|
|
|
|
that are specified on the command line. |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
L inherits all attributes from |
|
60
|
|
|
|
|
|
|
L and implements the following new ones. |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head2 description |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
my $description = $perldoc->description; |
|
65
|
|
|
|
|
|
|
$perldoc = $perldoc->description('Foo'); |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Short description of this command, used for the command list. |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head2 usage |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
my $usage = $perldoc->usage; |
|
72
|
|
|
|
|
|
|
$routes = $perldoc->usage('Foo'); |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
Usage information for this command, used for the help screen. |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 METHODS |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
L inherits all methods from |
|
79
|
|
|
|
|
|
|
L and implements the following new ones. |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head2 run |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
$perldoc->run(@ARGV); |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Run this command. |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
L, L, L. |
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=cut |