blib/lib/Git/Wrapper/Plus/Support.pm untested

filter: Statementstmt 0.0% 0 / 55 Branchbran 0.0% 0 / 12 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 17 Podpod 0.0% 0 / 7 totaltotal 0.0% 0 / 91 SCAR 40.3
CC
7
Cov
0%
supports_command
12.0
supports_behavior
12.0
supports_argument
12.0
CRAP 56.0
1 use 5.008; # utf8
2 use strict;
3 use warnings;
4 use utf8;
5  
6 package Git::Wrapper::Plus::Support;
7 $Git::Wrapper::Plus::Support::VERSION = '0.004010';
8 # ABSTRACT: Determine what versions of things support what
9  
10 our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY
11  
12 use Moo qw( has );
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36 has 'git' => ( is => ro =>, required => 1 );
37  
38 has 'versions' => ( is => ro =>, lazy => 1, builder => 1 );
39  
40 sub _build_versions {
41 my ( $self, ) = @_;
42 require Git::Wrapper::Plus::Versions;
43 return Git::Wrapper::Plus::Versions->new( git => $self->git );
44 }
45  
46  
47  
48  
49  
50  
51  
52  
53 has 'commands' => ( is => ro =>, lazy => 1, builder => 1 );
54  
55 sub _build_commands {
56 require Git::Wrapper::Plus::Support::Commands;
57 return Git::Wrapper::Plus::Support::Commands->new();
58 }
59  
60  
61  
62  
63  
64  
65  
66  
67 has 'behaviors' => ( is => ro =>, lazy => 1, builder => 1 );
68  
69 sub _build_behaviors {
70 require Git::Wrapper::Plus::Support::Behaviors;
71 return Git::Wrapper::Plus::Support::Behaviors->new();
72 }
73  
74  
75  
76  
77  
78  
79  
80  
81 has 'arguments' => ( is => ro =>, lazy => 1, builder => 1 );
82  
83 sub _build_arguments {
84 require Git::Wrapper::Plus::Support::Arguments;
85 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 my ( $self, $command ) = @_;
110 return unless $self->commands->has_entry($command);
111 return 1 if $self->commands->entry_supports( $command, $self->versions );
112 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 my ( $self, $beh ) = @_;
137 return unless $self->behaviors->has_entry($beh);
138 return 1 if $self->behaviors->entry_supports( $beh, $self->versions );
139 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 my ( $self, $command, $argument ) = @_;
164 return unless $self->arguments->has_argument( $command, $argument );
165 return 1 if $self->arguments->argument_supports( $command, $argument, $self->versions );
166 return 0;
167  
168 }
169  
170 no Moo;
171 1;
172  
173 __END__