Toadfarm/Command/restart.pm

filter: Statementstmt 92.8% 13 / 14 Branchbran 50.0% 1 / 2 Conditioncond 100% 3 / 3 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 3 / 3 Podpod 100% 1 / 1 totaltotal 92.0% 23 / 25 CC 4 SCAR 8.7
CC
4
Cov
89%
_restart
3.0
run
2.1
BEGIN
1.0
CRAP 2.4
« Toadfarm/Plugin/AccessLog.pm ↑ Summary
1 package Toadfarm::Command::restart;
2 1 ▶use Mojo::Base 'Toadfarm::Command::stop';
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 1 has description => 'Toadfarm: Restart or start the server';
5  
6 3 ▶sub run {
Subroutine run: called CC=2 SCAR=7.6
Pod documented
7 3 my $self = shift;
8 3 my $exit = $self->_restart;
9 3 ▶ return $exit if $ENV{TOADFARM_NO_EXIT};
Branch: 1 branch
BranchTrueFalseTotal
if $ENV{"TOADFARM_NO_EXIT"} 3 0 3
10 0 exit $exit;
11 }
12  
13 3 ▶sub _restart {
Subroutine _restart: called CC=3 SCAR=11.0
14 3 my ($self, @args) = @_;
15 3 my $exit;
16 3 local $ENV{TOADFARM_NO_EXIT} = 1;
17 3 ▶ $exit ||= $self->$_(@args) for qw(_stop _start);
Condition100%3/3
$exit ||= $self->$_(@args)
l!l&&r!l&&!r
123
MC/DC100%2/2
$exit ||= $self->$_(@args)
$exit $self->$_(@args)
Truth table100%3/3
A ||= B
A= $exitB= $self->$_(@args)
ABresult
1X1
011
000
18 3 return $exit;
19 }
20  
21 1 1;
22  
23 =encoding utf8
24  
25 =head1 NAME
26  
27 Toadfarm::Command::restart - Restart a Toadfarm DSL script
28  
29 =head1 DESCRIPTION
30  
31 L<Toadfarm::Command::restart> is a command for restarting a L<Toadfarm>
32 application.
33  
34 =head1 SYNOPSIS
35  
36 $ /path/to/script.pl restart
37  
38 =head1 ATTRIBUTES
39  
40 =head2 description
41  
42 Short description of command, used for the command list.
43  
44 =head1 METHODS
45  
46 =head2 run
47  
48 Run command.
49  
50 =head1 COPYRIGHT AND LICENSE
51  
52 Copyright (C) 2014, Jan Henning Thorsen
53  
54 This program is free software, you can redistribute it and/or modify it under
55 the terms of the Artistic License version 2.0.
56  
57 =head1 AUTHOR
58  
59 Jan Henning Thorsen - C<jhthorsen@cpan.org>
60  
61 =cut
« Toadfarm/Plugin/AccessLog.pm ↑ Summary