Toadfarm/Command/reload.pm

filter: Statementstmt 71.4% 10 / 14 Branchbran 25.0% 1 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod 100% 1 / 1 totaltotal 66.6% 14 / 21 CC 3 SCAR 12.7
CC
3
Cov
61%
run
4.4
BEGIN
1.0
CRAP 3.6
« Toadfarm/Command/start.pm ↑ Summary Toadfarm/Command/status.pm »
1 package Toadfarm::Command::reload;
2 1 ▶use Mojo::Base 'Toadfarm::Command::start';
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 1 has description => 'Toadfarm: Hot deploy or start the server';
5  
6 2 ▶sub run {
Subroutine run: called CC=3 SCAR=14.8
Pod documented
7 2 my $self = shift;
8  
9 0 ▶ if (grep {/^--tail/} @_) {
Branch: 1 branch
BranchTrueFalseTotal
if (grep {/^--tail/u;} @_) 0 2 2
10 0 ▶ exec $self->_hypnotoad, $0 unless fork; # start or hot reload
Branch: 1 branch
BranchTrueFalseTotal
unless fork 0 0 0
11 0 return $self->_tail(grep { !/^--tail/ } @_);
12 }
13  
14 # reload
15 2 $self->_log_daemon_msg('Reloading the process %s');
16 2 system $self->_hypnotoad, $0; # start or hot reload
17 2 $self->_end($? >> 8);
18 }
19  
20 1 1;
21  
22 =encoding utf8
23  
24 =head1 NAME
25  
26 Toadfarm::Command::reload - Reload a Toadfarm DSL script
27  
28 =head1 DESCRIPTION
29  
30 L<Toadfarm::Command::reload> is a command for reloading a L<Toadfarm>
31 application.
32  
33 =head1 SYNOPSIS
34  
35 $ /path/to/script.pl reload
36 $ /path/to/script.pl reload --tail <args>
37  
38 C<--tail> will pass the call L<Toadfarm::Command::tail> after issuing
39 start/reload on C<script.pl>.
40  
41 =head1 ATTRIBUTES
42  
43 =head2 description
44  
45 Short description of command, used for the command list.
46  
47 =head1 METHODS
48  
49 =head2 run
50  
51 Run command.
52  
53 =head1 COPYRIGHT AND LICENSE
54  
55 Copyright (C) 2014, Jan Henning Thorsen
56  
57 This program is free software, you can redistribute it and/or modify it under
58 the terms of the Artistic License version 2.0.
59  
60 =head1 AUTHOR
61  
62 Jan Henning Thorsen - C<jhthorsen@cpan.org>
63  
64 =cut
« Toadfarm/Command/start.pm ↑ Summary Toadfarm/Command/status.pm »