lib/Git/Wrapper/Plus/Support/Arguments.pm

filter: Statementstmt 100% 41 / 41 Branchbran 50.0% 3 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 12 / 12 Podpod 100% 5 / 5 totaltotal 95.3% 61 / 64 SCAR 13.9
CC
4
Cov
94%
arguments
2.0
has_argument
2.0
argument_supports
2.0
CRAP 4.0
« blib/lib/Git/Wrapper/Plus/Support/RangeDictionary.pm ↑ Summary lib/Git/Wrapper/Plus/Support/RangeSet.pm »
1 2 ▶use 5.008; # utf8
Subroutine BEGIN: called CC=1 SCAR=0.0
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 package Git::Wrapper::Plus::Support::Arguments;
7 2 $Git::Wrapper::Plus::Support::Arguments::VERSION = '0.004010';
8 # ABSTRACT: Database of command argument support data
9  
10 2 our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY
11  
12 2 ▶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  
37  
38  
39  
40  
41 2 has 'entries' => ( is => ro =>, lazy => 1, builder => 1 );
42  
43 sub _build_entries {
44 1 ▶ my $hash = {};
Subroutine _build_entries: called CC=1 SCAR=0.0
45 1 require Git::Wrapper::Plus::Support::RangeDictionary;
46 1 $hash->{'cat-file'} = Git::Wrapper::Plus::Support::RangeDictionary->new();
47 1 $hash->{'cat-file'}->add_range(
48 '-e' => {
49 'min' => '1.0.0',
50 'min_tag' => '0.99.9l',
51 'min_sha1' => '7950571ad75c1c97e5e53626d8342b01b167c790',
52 },
53 );
54 1 return $hash;
55 }
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67 sub commands {
68 1 ▶ my ($self) = @_;
Subroutine commands: called CC=1 SCAR=0.0
Pod documented
69 1 my (@items) = sort keys %{ $self->entries };
70 1 return @items;
71 }
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83 sub arguments {
84 1 ▶ my ( $self, $command ) = @_;
Subroutine arguments: called CC=2 SCAR=7.1
Pod documented
85 1 ▶ return unless $self->has_command($command);
Branch: 1 branch
BranchTrueFalseTotal
unless $self->has_command($command) 0 1 1
86 1 return $self->entries->{$command}->entries;
87 }
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99 sub has_command {
100 3 ▶ my ( $self, $command ) = @_;
Subroutine has_command: called CC=1 SCAR=0.0
Pod documented
101 3 return exists $self->entries->{$command};
102 }
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114 sub has_argument {
115 2 ▶ my ( $self, $command, $argument ) = @_;
Subroutine has_argument: called CC=2 SCAR=7.1
Pod documented
116 2 ▶ return unless $self->has_command($command);
Branch: 1 branch
BranchTrueFalseTotal
unless $self->has_command($command) 0 2 2
117 2 return $self->entries->{$command}->has_entry($argument);
118 }
119  
120  
121  
122  
123  
124  
125  
126  
127  
128 sub argument_supports {
129 1 ▶ my ( $self, $command, $argument, $version_object ) = @_;
Subroutine argument_supports: called CC=2 SCAR=7.1
Pod documented
130 1 ▶ return unless $self->has_argument( $command, $argument );
Branch: 1 branch
BranchTrueFalseTotal
unless $self->has_argument($command, $argument) 0 1 1
131 1 return $self->entries->{$command}->entry_supports( $argument, $version_object );
132 }
133  
134 2 ▶no Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
135 2 1;
136  
137 __END__
« blib/lib/Git/Wrapper/Plus/Support/RangeDictionary.pm ↑ Summary lib/Git/Wrapper/Plus/Support/RangeSet.pm »