line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Clustericious::Command::plackup; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
563
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
24
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
19
|
|
5
|
1
|
|
|
1
|
|
7
|
use Clustericious::Log; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
6
|
1
|
|
|
1
|
|
664
|
use Clustericious::App; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
7
|
1
|
|
|
1
|
|
254
|
use Mojo::Server::PSGI; |
|
1
|
|
|
|
|
630
|
|
|
1
|
|
|
|
|
10
|
|
8
|
1
|
|
|
1
|
|
27
|
use base 'Clustericious::Command'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
101
|
|
9
|
1
|
|
|
1
|
|
7
|
use File::Which qw( which ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
40
|
|
10
|
1
|
|
|
1
|
|
5
|
use Mojo::URL; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# ABSTRACT: Clustericious command to start plack server |
13
|
|
|
|
|
|
|
our $VERSION = '1.27'; # VERSION |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
__PACKAGE__->attr(description => <<EOT); |
17
|
|
|
|
|
|
|
Start a plack server (see plackup) |
18
|
|
|
|
|
|
|
EOT |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
__PACKAGE__->attr(usage => <<EOT); |
21
|
|
|
|
|
|
|
Usage $0: plackup [plackup options] |
22
|
|
|
|
|
|
|
Starts a plack server. See plackup for valid options. |
23
|
|
|
|
|
|
|
EOT |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub run { |
26
|
0
|
|
|
0
|
1
|
|
my($self, @args) = @_; |
27
|
0
|
|
|
|
|
|
my $app_name = $ENV{MOJO_APP}; |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
$self->app->init_logging; |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
0
|
|
|
|
my $plackup = which('plackup') || LOGDIE "could not find plackup in $ENV{PATH}"; |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
|
my $url = Mojo::URL->new($self->app->config->url); |
34
|
0
|
0
|
|
|
|
|
LOGDIE "@{[ $url->scheme ]} not supported" if $url->scheme ne 'http'; |
|
0
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
0
|
0
|
0
|
|
|
|
shift @args if defined $args[0] && $args[0] eq 'plackup'; |
37
|
0
|
|
|
|
|
|
push @args, $0; |
38
|
0
|
|
|
|
|
|
unshift @args, '--port' => $url->port; |
39
|
0
|
|
|
|
|
|
unshift @args, '--host' => $url->host; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
#if(my $pid_file = $self->app->config->plackup(default => {})->pid_file(default => 0)) |
42
|
|
|
|
|
|
|
#{ |
43
|
|
|
|
|
|
|
# unshift @args, '--pidfile' => $pid_file; |
44
|
|
|
|
|
|
|
#} |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
|
DEBUG "starting $plackup @args"; |
47
|
0
|
|
|
|
|
|
delete $ENV{MOJO_COMMANDS_DONE}; |
48
|
0
|
|
|
|
|
|
exec $plackup, @args; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
1; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
__END__ |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=pod |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=encoding UTF-8 |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 NAME |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Clustericious::Command::plackup - Clustericious command to start plack server |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 VERSION |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
version 1.27 |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 SYNOPSIS |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
% yourapp plackup |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 DESCRIPTION |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Start a plack server using plackup. By default plackup does not daemonize into the |
74
|
|
|
|
|
|
|
background, making it a handy development server. Any arguments will be passed into |
75
|
|
|
|
|
|
|
the plackup command directly. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 SEE ALSO |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
L<Clustericious>, L<plackup>, L<Plack> |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 AUTHOR |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
Original author: Brian Duggan |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Current maintainer: Graham Ollis E<lt>plicease@cpan.orgE<gt> |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
Contributors: |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
Curt Tilmes |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
Yanick Champoux |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
This software is copyright (c) 2013 by NASA GSFC. |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
98
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=cut |