Subprocess/Types.pm

filter: Statementstmt 100% 33 / 33 Branchbran 50.0% 3 / 6 Conditioncond 100% 3 / 3 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 11 / 11 Podpod n/a totaltotal 94.5% 52 / 55 CC 5 SCAR 5.2
CC
5
Cov
93%
__ANON__
3.0
__ANON__
2.1
__ANON__
2.0
CRAP 1.7
« Subprocess/Job/Delegate/Handle.pm ↑ Summary Subprocess/Running.pm »
1 package AnyEvent::Subprocess::Types;
2 49 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
3 49 $AnyEvent::Subprocess::Types::VERSION = '1.102912';
4 }
5 # ABSTRACT: C<MooseX::Types> used internally
6 49 ▶use MooseX::Types -declare => [ qw{
Subroutine BEGIN: called CC=1 SCAR=0.0
7 Direction
8 JobDelegate
9 RunDelegate
10 DoneDelegate
11 SubprocessCode
12 CodeList
13 WhenToCallBack
14 49 }];
15  
16 49 ▶use MooseX::Types::Moose qw(Str ArrayRef CodeRef);
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 385 ▶subtype Direction, as Str, where {
Subroutine __ANON__: called CC=3 SCAR=11.0
19 385 ▶ $_ eq 'r' || $_ eq 'w' || $_ eq 'rw'
Branch: 1 branch
BranchTrueFalseTotal
$_ eq "r" or $_ eq "w" or $_ eq "rw" 366 19 385
Condition100%3/3
$_ eq "r" or $_ eq "w"
l!l&&r!l&&!r
25411219
MC/DC100%2/2
$_ eq "r" or $_ eq "w"
$_ eq "r" $_ eq "w"
Truth table100%3/3
A or B
A= $_ eq "r"B= $_ eq "w"
ABresult
1X1
011
000
20 48 };
21  
22 48 role_type JobDelegate, { role => 'AnyEvent::Subprocess::Job::Delegate' };
23 48 role_type RunDelegate, { role => 'AnyEvent::Subprocess::Running::Delegate' };
24 48 role_type DoneDelegate, { role => 'AnyEvent::Subprocess::Done::Delegate' };
25  
26 48 subtype SubprocessCode, as CodeRef;
27  
28 15 ▶coerce SubprocessCode, from Str, via {
Subroutine __ANON__: called CC=1 SCAR=0.2
29 15 my $cmd = $_;
30 49 ▶ return sub { no warnings; exec $cmd or die "Failed to exec '$cmd': $!" };
Subroutine BEGIN: called CC=1 SCAR=0.2
Subroutine __ANON__: called CC=2 SCAR=7.4
Branch: 1 branch
BranchTrueFalseTotal
exec $cmd or die "Failed to exec '${cmd}': $!" 0 0 0
31 48 };
32  
33 6 ▶coerce SubprocessCode, from ArrayRef[Str], via {
Subroutine __ANON__: called CC=1 SCAR=0.0
34 6 my $cmd = $_;
35 6 my $str = join ' ', @$cmd;
36 49 ▶ return sub { no warnings; exec @$cmd or die "Failed to exec '$str': $!" };
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=2 SCAR=7.0
Branch: 1 branch
BranchTrueFalseTotal
exec @$cmd or die "Failed to exec '${str}': $!" 0 1 1
37 48 };
38  
39 48 subtype CodeList, as ArrayRef[CodeRef];
40 4 ▶coerce CodeList, from CodeRef, via { [$_] };
Subroutine __ANON__: called CC=1 SCAR=0.0
41  
42 48 enum WhenToCallBack, qw/Readable Line/;
43  
44 48 1;
45  
46  
47  
48 =pod
49  
50 =head1 NAME
51  
52 AnyEvent::Subprocess::Types - C<MooseX::Types> used internally
53  
54 =head1 VERSION
55  
56 version 1.102912
57  
58 =head1 TYPES
59  
60 Direction
61 JobDelegate
62 RunDelegate
63 DoneDelegate
64 SubprocessCode
65 CodeList
66 WhenToCallBack
67  
68 =head1 AUTHOR
69  
70 Jonathan Rockway <jrockway@cpan.org>
71  
72 =head1 COPYRIGHT AND LICENSE
73  
74 This software is copyright (c) 2011 by Jonathan Rockway.
75  
76 This is free software; you can redistribute it and/or modify it under
77 the same terms as the Perl 5 programming language system itself.
78  
79 =cut
80  
81  
82 __END__
« Subprocess/Job/Delegate/Handle.pm ↑ Summary Subprocess/Running.pm »