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

filter: Statementstmt 97.4% 38 / 39 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 10 / 10 Podpod 100% 3 / 3 totaltotal 96.4% 54 / 56 SCAR 13.9
CC
4
Cov
95%
supports_version
3.0
add_range
2.0
BEGIN
1.0
CRAP 4.0
« lib/Git/Wrapper/Plus/Support/Arguments.pm ↑ Summary lib/Git/Wrapper/Plus/Ref/Tag.pm »
1 6 ▶use 5.008; # utf8
Subroutine BEGIN: called CC=1 SCAR=0.0
2 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 package Git::Wrapper::Plus::Support::RangeSet;
7 6 $Git::Wrapper::Plus::Support::RangeSet::VERSION = '0.004010';
8 # ABSTRACT: A set of ranges of supported things
9  
10 6 our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY
11  
12 6 ▶use Moo qw( has );
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14  
15  
16  
17  
18  
19  
20 6 has 'items' => ( is => ro =>, lazy => 1, builder => 1 );
21  
22 sub _build_items {
23 118 ▶ return [];
Subroutine _build_items: called CC=1 SCAR=0.0
24 }
25  
26  
27  
28  
29  
30  
31  
32  
33  
34 sub add_range_object {
35 118 ▶ my ( $self, $range_object ) = @_;
Subroutine add_range_object: called CC=1 SCAR=0.0
Pod documented
36 118 push @{ $self->items }, $range_object;
37 118 return $self;
38 }
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53 sub add_range {
54 118 ▶ my ( $self, @args ) = @_;
Subroutine add_range: called CC=2 SCAR=7.1
Pod documented
55 118 my $config;
56 118 ▶ if ( 1 == @args ) {
Branch: 1 branch
BranchTrueFalseTotal
if (1 == @args) { } 118 0 118
57 118 $config = $args[0];
58 }
59 else {
60 0 $config = {@args};
61 }
62 118 require Git::Wrapper::Plus::Support::Range;
63 118 return $self->add_range_object( Git::Wrapper::Plus::Support::Range->new($config) );
64 }
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75 sub supports_version {
76 35 ▶ my ( $self, $version_object ) = @_;
Subroutine supports_version: called CC=3 SCAR=11.0
Pod documented
77 35 for my $item ( @{ $self->items } ) {
78 35 my $cmp = $item->supports_version($version_object);
79 35 ▶ return $cmp if defined $cmp;
Branch: 1 branch
BranchTrueFalseTotal
if defined $cmp 34 1 35
80 }
81 1 return;
82 }
83  
84 6 ▶no Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
85 6 1;
86  
87 __END__
« lib/Git/Wrapper/Plus/Support/Arguments.pm ↑ Summary lib/Git/Wrapper/Plus/Ref/Tag.pm »