blib/lib/Tapper/Action/Daemon.pm

filter: Statementstmt 97.2% 35 / 36 Branchbran 66.6% 4 / 6 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 9 / 9 Podpod 100% 1 / 1 totaltotal 87.7% 50 / 57 CC 5 SCAR 8.2
CC
5
Cov
89%
run
4.6
__ANON__
2.0
BEGIN
1.0
CRAP 2.3
« blib/lib/Tapper/Action.pm ↑ Summary bin/tapper-action-daemon »
1 package Tapper::Action::Daemon;
2 7 our $AUTHORITY = 'cpan:TAPPER';
3 7 $Tapper::Action::Daemon::VERSION = '5.0.0';
4 7 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 7 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 7 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 7 ▶use Tapper::Action;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 7 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 7 ▶use Tapper::Config;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 7 ▶use Log::Log4perl;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 7 with 'MooseX::Daemonize';
15  
16 3 ▶after start => sub {
Subroutine __ANON__: called CC=2 SCAR=7.0
17 3 my $self = shift;
18  
19 3 ▶ return unless $self->is_daemon;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->is_daemon 1 2 3
20  
21 2 my $logconf = Tapper::Config->subconfig->{files}{log4perl_cfg};
22 2 Log::Log4perl->init($logconf);
23  
24 2 my $daemon = Tapper::Action->new()->loop;
25 0 say STDERR "Here I am";
26 7 };
27  
28  
29  
30 sub run
31 6 ▶{
Subroutine run: called CC=4 SCAR=15.2
Pod documented
32 6 my $self = shift;
33  
34 6 ▶ my ($command) = @ARGV ? @ARGV : @_;
Branch: 1 branch
BranchTrueFalseTotal
@ARGV ? : 6 0 6
35 6 ▶ return unless $command && grep /^$command$/, qw(start status restart stop);
Branch: 1 branch
BranchTrueFalseTotal
unless $command and grep /^$command$/, ("start", "status", "restart", "stop") 0 6 6
Condition33%1/3
$command and grep /^$command$/, ("start", "status", "restart", "stop")
!ll&&!rl&&r
006
MC/DC0%0/2
$command and grep /^$command$/, ("start", "status", "restart", "stop")
$command grep /^$command$/, ("start", "status", "restart", "stop")
Truth table33%1/3
A and B
A= $commandB= grep /^$command$/, ("start", "status", "restart", "stop")
ABresult
0X0
100
111
36 6 $self->$command;
37 3 say $self->status_message;
38 }
39 ;
40  
41  
42 7 1;
43  
44 __END__
« blib/lib/Tapper/Action.pm ↑ Summary bin/tapper-action-daemon »