lib/Git/Wrapper/Plus/Ref/Tag.pm

filter: Statementstmt 77.7% 28 / 36 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 8 / 10 Podpod 100% 4 / 4 totaltotal 77.7% 42 / 54 SCAR 11.4
CC
3
Cov
75%
new_from_Ref
3.9
verify
2.0
delete
2.0
CRAP 3.1
« lib/Git/Wrapper/Plus/Support/RangeSet.pm ↑ Summary blib/lib/Git/Wrapper/Plus/Support/Behaviors.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::Ref::Tag;
7 2 $Git::Wrapper::Plus::Ref::Tag::VERSION = '0.004010';
8 # ABSTRACT: A single tag object
9  
10 2 our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24 2 ▶use Moo qw( extends );
Subroutine BEGIN: called CC=1 SCAR=0.0
25 2 extends 'Git::Wrapper::Plus::Ref';
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51 ## no critic(NamingConventions::ProhibitMixedCaseSubs)
52 sub new_from_Ref {
53 10 ▶ my ( $class, $source_object ) = @_;
Subroutine new_from_Ref: called CC=3 SCAR=13.6
Pod documented
54 10 ▶ if ( not $source_object->can('name') ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($source_object->can("name")) 0 10 10
55 0 require Carp;
56 0 return Carp::croak("Object $source_object does not respond to ->name, cannot Ref -> Tag");
57 }
58 10 my $name = $source_object->name;
59 ## no critic ( Compatibility::PerlMinimumVersionAndWhy )
60 10 ▶ if ( $name =~ qr{\Arefs/tags/(.+\z)}msx ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($name =~ qr"\Arefs/tags/(.+\z)"msx) 10 0 10
61 10 return $class->new(
62 git => $source_object->git,
63 name => $1,
64 );
65 }
66 0 require Carp;
67 0 Carp::croak("Path $name is not in refs/tags/*, cannot convert to Tag object");
68 }
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80 sub refname {
81 10 ▶ my ($self) = @_;
Subroutine refname: called CC=1 SCAR=0.0
Pod documented
82 10 return 'refs/tags/' . $self->name;
83 }
84  
85  
86  
87  
88  
89 sub verify {
90 0 ▶ my ( $self, ) = @_;
Subroutine verify: not called CC=1 SCAR=6.9
Pod documented
91 0 return $self->git->tag( '-v', $self->name );
92 }
93  
94  
95  
96  
97  
98 ## no critic (ProhibitBuiltinHomonyms)
99  
100 sub delete {
101 0 ▶ my ( $self, ) = @_;
Subroutine delete: not called CC=1 SCAR=6.9
Pod documented
102 0 return $self->git->tag( '-d', $self->name );
103 }
104  
105 2 ▶no Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
106 2 1;
107  
108 __END__
« lib/Git/Wrapper/Plus/Support/RangeSet.pm ↑ Summary blib/lib/Git/Wrapper/Plus/Support/Behaviors.pm »