Module/Build/Service/clamd.pm

filter: Statementstmt 51.8% 14 / 27 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 25.0% 2 / 8 Podpod n/a totaltotal 45.7% 16 / 35 CC 1 SCAR 4.3
CC
1
Cov
52%
_build_command
2.0
_build_config
2.0
_build_config_default
2.0
CRAP 1.5
« Module/Build/Service/memcached.pm ↑ Summary Module/Build/Service/gearmand.pm »
1 package Module::Build::Service::clamd;
2 {
3 1 $Module::Build::Service::clamd::VERSION = '0.91';
4 }
5 # ABSTRACT: Service implementation for clamd
6  
7 1 ▶use Log::Any qw{$log};
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 extends 'Module::Build::Service::Base';
10 1 with 'Module::Build::Service::Fork';
11  
12  
13 0 ▶sub _build_command {
Subroutine _build_command: not called CC=1 SCAR=6.9
14 0 my ($self) = @_;
15 0 [$self->bin, "-c", $self->config];
16 }
17  
18  
19 has 'config' => (is => 'lazy',
20 0 ▶ isa => sub {-f $_[0]});
Subroutine __ANON__: not called CC=1 SCAR=1.2
21 0 ▶sub _build_config {
Subroutine _build_config: not called CC=1 SCAR=6.9
22 0 my ($self) = @_;
23 0 $self->config_default->filename;
24 }
25  
26 has 'config_default' => (init_arg => undef,
27 is => 'lazy',
28 0 ▶ isa => sub {ref $_[0] eq 'File::Temp'});
Subroutine __ANON__: not called CC=1 SCAR=1.2
29 0 ▶sub _build_config_default {
Subroutine _build_config_default: not called CC=1 SCAR=6.9
30 0 my ($self) = @_;
31 0 require File::Temp;
32 0 my $tempfile = File::Temp->new();
33 0 $tempfile->printf (<<CLAMD, $self->socket);
34 Debug true
35 FixStaleSocket true
36 Foreground true
37 LocalSocket %s
38 CLAMD
39 0 $tempfile;
40 }
41  
42  
43 1 has 'socket' => (is => 'lazy');
44 0 ▶sub _build_socket {
Subroutine _build_socket: not called CC=1 SCAR=6.9
45 0 my ($self) = @_;
46 0 File::Spec->catfile ($self->_builder->mbs_socket_dir, 'clamd');
47 }
48  
49  
50 1 1;
51  
52 __END__
« Module/Build/Service/memcached.pm ↑ Summary Module/Build/Service/gearmand.pm »