lib/Git/Wrapper/Plus/Support.pm

filter: Statementstmt 95.6% 44 / 46 Branchbran 58.3% 7 / 12 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 13 / 13 Podpod 100% 3 / 3 totaltotal 90.5% 67 / 74 SCAR 19.6
CC
7
Cov
88%
supports_behavior
3.5
supports_argument
3.5
supports_command
3.0
CRAP 7.1
« blib/lib/Git/Wrapper/Plus/Util.pm ↑ Summary lib/Git/Wrapper/Plus.pm »
1 7 ▶use 5.008; # utf8
Subroutine BEGIN: called CC=1 SCAR=0.0
2 7 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 7 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 7 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 package Git::Wrapper::Plus::Support;
7 7 $Git::Wrapper::Plus::Support::VERSION = '0.004010';
8 # ABSTRACT: Determine what versions of things support what
9  
10 7 our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY
11  
12 7 ▶use Moo qw( has );
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36 7 has 'git' => ( is => ro =>, required => 1 );
37  
38 7 has 'versions' => ( is => ro =>, lazy => 1, builder => 1 );
39  
40 sub _build_versions {
41 9 ▶ my ( $self, ) = @_;
Subroutine _build_versions: called CC=1 SCAR=0.0
42 9 require Git::Wrapper::Plus::Versions;
43 9 return Git::Wrapper::Plus::Versions->new( git => $self->git );
44 }
45  
46  
47  
48  
49  
50  
51  
52  
53 7 has 'commands' => ( is => ro =>, lazy => 1, builder => 1 );
54  
55 sub _build_commands {
56 9 ▶ require Git::Wrapper::Plus::Support::Commands;
Subroutine _build_commands: called CC=1 SCAR=0.0
57 9 return Git::Wrapper::Plus::Support::Commands->new();
58 }
59  
60  
61  
62  
63  
64  
65  
66  
67 7 has 'behaviors' => ( is => ro =>, lazy => 1, builder => 1 );
68  
69 sub _build_behaviors {
70 3 ▶ require Git::Wrapper::Plus::Support::Behaviors;
Subroutine _build_behaviors: called CC=1 SCAR=0.0
71 3 return Git::Wrapper::Plus::Support::Behaviors->new();
72 }
73  
74  
75  
76  
77  
78  
79  
80  
81 7 has 'arguments' => ( is => ro =>, lazy => 1, builder => 1 );
82  
83 sub _build_arguments {
84 1 ▶ require Git::Wrapper::Plus::Support::Arguments;
Subroutine _build_arguments: called CC=1 SCAR=0.0
85 1 return Git::Wrapper::Plus::Support::Arguments->new();
86 }
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108 sub supports_command {
109 28 ▶ my ( $self, $command ) = @_;
Subroutine supports_command: called CC=3 SCAR=11.0
Pod documented
110 28 ▶ return unless $self->commands->has_entry($command);
Branch: 1 branch
BranchTrueFalseTotal
unless $self->commands->has_entry($command) 0 28 28
111 28 ▶ return 1 if $self->commands->entry_supports( $command, $self->versions );
Branch: 1 branch
BranchTrueFalseTotal
if $self->commands->entry_supports($command, $self->versions) 27 1 28
112 1 return 0;
113 }
114  
115  
116  
117  
118  
119  
120  
121  
122  
123  
124  
125  
126  
127  
128  
129  
130  
131  
132  
133  
134  
135 sub supports_behavior {
136 6 ▶ my ( $self, $beh ) = @_;
Subroutine supports_behavior: called CC=3 SCAR=12.5
Pod documented
137 6 ▶ return unless $self->behaviors->has_entry($beh);
Branch: 1 branch
BranchTrueFalseTotal
unless $self->behaviors->has_entry($beh) 0 6 6
138 6 ▶ return 1 if $self->behaviors->entry_supports( $beh, $self->versions );
Branch: 1 branch
BranchTrueFalseTotal
if $self->behaviors->entry_supports($beh, $self->versions) 6 0 6
139 0 return 0;
140 }
141  
142  
143  
144  
145  
146  
147  
148  
149  
150  
151  
152  
153  
154  
155  
156  
157  
158  
159  
160  
161  
162 sub supports_argument {
163 1 ▶ my ( $self, $command, $argument ) = @_;
Subroutine supports_argument: called CC=3 SCAR=12.5
Pod documented
164 1 ▶ return unless $self->arguments->has_argument( $command, $argument );
Branch: 1 branch
BranchTrueFalseTotal
unless $self->arguments->has_argument($command, $argument) 0 1 1
165 1 ▶ return 1 if $self->arguments->argument_supports( $command, $argument, $self->versions );
Branch: 1 branch
BranchTrueFalseTotal
if $self->arguments->argument_supports($command, $argument, $self->versions) 1 0 1
166 0 return 0;
167  
168 }
169  
170 7 ▶no Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
171 7 1;
172  
173 __END__
« blib/lib/Git/Wrapper/Plus/Util.pm ↑ Summary lib/Git/Wrapper/Plus.pm »