| 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
| |||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||
| 35 | 6 | ▶ | return unless $command && grep /^$command$/, qw(start status restart stop); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$command and grep /^$command$/, ("start", "status", "restart", "stop")
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")
| |||||||||||||||||||||||||||||
| 36 | 6 | $self->$command; | |||||||||||||||||||||||||||
| 37 | 3 | say $self->status_message; | |||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||
| 39 | ; | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | 7 | 1; | |||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | __END__ | ||||||||||||||||||||||||||||