Subprocess/Job/Delegate/PrintError.pm

filter: Statementstmt 100% 21 / 21 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 92.8% 13 / 14 Podpod 0.0% 0 / 8 totaltotal 77.7% 35 / 45 CC 2 SCAR 1.3
CC
2
Cov
96%
__ANON__
2.0
__ANON__
1.0
BEGIN
1.0
CRAP 1.1
« Subprocess/Job/Delegate/Callback.pm ↑ Summary Subprocess/Job/Delegate/CompletionCondvar.pm »
1 package AnyEvent::Subprocess::Job::Delegate::PrintError;
2 48 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
3 48 $AnyEvent::Subprocess::Job::Delegate::PrintError::VERSION = '1.102912';
4 }
5 # ABSTRACT: Print errors to a filehandle
6 48 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 48 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 47 with 'AnyEvent::Subprocess::Job::Delegate';
9  
10 has 'handle' => (
11 is => 'ro',
12 isa => 'GlobRef',
13 32 ▶ default => sub { \*STDERR },
Subroutine __ANON__: called CC=1 SCAR=0.0
14 47 );
15  
16 has 'callback' => (
17 is => 'ro',
18 isa => 'CodeRef',
19 32 ▶ default => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
20 32 my $self = shift;
21 1 ▶ return sub {
Subroutine __ANON__: called CC=2 SCAR=7.0
22 1 my $msg = join '', @_;
23 1 ▶ $msg .= "\n" unless $msg =~ /\n$/;
Branch: 1 branch
BranchTrueFalseTotal
unless $msg =~ /\n$/ 0 1 1
24 1 print {$self->handle} ($msg);
25 }
26 32 },
27 47 );
28  
29 1 ▶sub receive_child_error {
Subroutine receive_child_error: called CC=1 SCAR=0.0
Pod undocumented
30 1 my ($self, $job, $error) = @_;
31 1 $self->callback->($error);
32 }
33  
34 16 ▶sub build_run_delegates {}
Subroutine build_run_delegates: called CC=1 SCAR=0.0
Pod undocumented
35 6 ▶sub child_setup_hook {}
Subroutine child_setup_hook: called CC=1 SCAR=0.0
Pod undocumented
36 1 ▶sub child_finalize_hook {}
Subroutine child_finalize_hook: called CC=1 SCAR=0.0
Pod undocumented
37 16 ▶sub parent_setup_hook {}
Subroutine parent_setup_hook: called CC=1 SCAR=0.0
Pod undocumented
38 10 ▶sub parent_finalize_hook {}
Subroutine parent_finalize_hook: called CC=1 SCAR=0.0
Pod undocumented
39 6 ▶sub build_code_args {}
Subroutine build_code_args: called CC=1 SCAR=0.0
Pod undocumented
40 0 ▶sub receive_child_result {}
Subroutine receive_child_result: not called CC=1 SCAR=0.0
Pod undocumented
41  
42 47 __PACKAGE__->meta->make_immutable;
43  
44 47 1;
45  
46 __END__
« Subprocess/Job/Delegate/Callback.pm ↑ Summary Subprocess/Job/Delegate/CompletionCondvar.pm »