blib/lib/Clustericious/Command/apache.pm

filter: Statementstmt 73.0% 19 / 26 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 83.3% 5 / 6 Podpod 100% 1 / 1 totaltotal 59.5% 25 / 42 CC 5 SCAR 27.4
CC
5
Cov
56%
run
30.0
BEGIN
1.0
BEGIN
1.0
CRAP 15.5
« blib/lib/Clustericious/Plugin/PlugAuth.pm ↑ Summary blib/lib/Clustericious/Log/CommandLine.pm »
1 package Clustericious::Command::apache;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use Clustericious::App;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use base 'Clustericious::Command';
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use File::Which qw( which );
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 # ABSTRACT: Clustericious command to stat Apache
10 1 our $VERSION = '1.29'; # VERSION
11  
12  
13 1 __PACKAGE__->attr(description => <<EOT);
14 Start an Apache web server.
15 EOT
16  
17 1 __PACKAGE__->attr(usage => <<EOT);
18 Usage $0: Apache -f <conf> [...other Apache options]
19 Starts an Apache webserver.
20 Options are passed verbatim to the httpd executable.
21 EOT
22  
23 0 ▶sub run {
Subroutine run: not called CC=5 SCAR=34.0
Pod documented
24 0 my($self, @args) = @_;
25 0 $self->app->init_logging;
26 0 ▶ my $command = which('httpd') || die "unable to find apache";
Condition0%0/2
which('httpd') || die('unable to find apache')
l!l
00
MC/DC0%0/1
which('httpd') || die('unable to find apache')
which('httpd')
Truth table0%0/2
A
A= which('httpd')
Aresult
11
00
27 0 system $command, @args;
28 0 ▶ die "'$command @args' Failed to execute: $!" if $? == -1;
Branch: 1 branch
BranchTrueFalseTotal
if $? == -1 0 0 0
29 0 ▶ die "'$command @args' Killed with signal: ", $? & 127 if $? & 127;
Branch: 1 branch
BranchTrueFalseTotal
if $? & 127 0 0 0
30 0 ▶ die "'$command @args' Exited with ", $? >> 8 if $? >> 8;
Branch: 1 branch
BranchTrueFalseTotal
if $? >> 8 0 0 0
31 }
32  
33 1 1;
34  
35 __END__
« blib/lib/Clustericious/Plugin/PlugAuth.pm ↑ Summary blib/lib/Clustericious/Log/CommandLine.pm »