| 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::Range; | ||||||||||||||||||||||||||||
| 7 | 6 | $Git::Wrapper::Plus::Support::Range::VERSION = '0.004010'; | |||||||||||||||||||||||||||
| 8 | # ABSTRACT: A record describing a range of supported versions | ||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 6 | our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY | |||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 6 | ▶ | use Moo qw( has ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 6 | our @CARP_NOT; | |||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | 6 | has 'min' => ( is => ro =>, predicate => 'has_min' ); | |||||||||||||||||||||||||||
| 61 | 6 | has 'max' => ( is => ro =>, predicate => 'has_max' ); | |||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||
| 63 | 6 | has 'min_tag' => ( is => ro =>, predicate => 'has_min_tag' ); | |||||||||||||||||||||||||||
| 64 | 6 | has 'max_tag' => ( is => ro =>, predicate => 'has_max_tag' ); | |||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | 6 | has 'min_sha1' => ( is => ro =>, predicate => 'has_min_sha1' ); | |||||||||||||||||||||||||||
| 67 | 6 | has 'max_sha1' => ( is => ro =>, predicate => 'has_max_sha1' ); | |||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||
| 74 | sub BUILD { | ||||||||||||||||||||||||||||
| 75 | 118 | ▶ | my ($self) = @_; | ||||||||||||||||||||||||||
|
Subroutine
BUILD: called CC=3 SCAR=16.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 76 | 118 | ▶ | if ( not $self->min and not $self->max ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$self->min || $self->max
MC/DC0%0/2
$self->min || $self->max
$self->min
$self->max
Truth table33%1/3
A || B
A= $self->minB= $self->max
| |||||||||||||||||||||||||||||
| 77 | 0 | require Carp; | |||||||||||||||||||||||||||
| 78 | ## no critic (Variables::ProhibitLocalVars) | ||||||||||||||||||||||||||||
| 79 | 0 | local (@CARP_NOT) = ('Git::Wrapper::Plus::Support::Range'); | |||||||||||||||||||||||||||
| 80 | 0 | Carp::croak('Invalid range, must specify either min or max, or both'); | |||||||||||||||||||||||||||
| 81 | } | ||||||||||||||||||||||||||||
| 82 | } | ||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||
| 97 | sub supports_version { | ||||||||||||||||||||||||||||
| 98 | 35 | ▶ | my ( $self, $versions_object ) = @_; | ||||||||||||||||||||||||||
|
Subroutine
supports_version: called CC=9 SCAR=28.4
Pod
documented
| |||||||||||||||||||||||||||||
| 99 | 35 | ▶ | if ( $self->has_min and not $self->has_max ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$self->has_min and not $self->has_max
MC/DC50%1/2
$self->has_min and not $self->has_max
$self->has_min
not $self->has_max
Truth table66%2/3
A and not(B)
A= $self->has_minB= not $self->has_max
| |||||||||||||||||||||||||||||
| 100 | 34 | ▶ | return 1 if $versions_object->newer_than( $self->min ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 101 | 0 | return; | |||||||||||||||||||||||||||
| 102 | } | ||||||||||||||||||||||||||||
| 103 | 1 | ▶ | if ( $self->has_max and not $self->has_min ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$self->has_max and not $self->has_min
MC/DC0%0/2
$self->has_max and not $self->has_min
$self->has_max
not $self->has_min
Truth table33%1/3
A and not(B)
A= $self->has_maxB= not $self->has_min
| |||||||||||||||||||||||||||||
| 104 | 0 | ▶ | return 1 if $versions_object->older_than( $self->max ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 105 | 0 | return; | |||||||||||||||||||||||||||
| 106 | } | ||||||||||||||||||||||||||||
| 107 | 1 | ▶ | return unless $versions_object->newer_than( $self->min ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 108 | 1 | ▶ | return unless $versions_object->older_than( $self->max ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 109 | 0 | return 1; | |||||||||||||||||||||||||||
| 110 | } | ||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||
| 112 | 6 | ▶ | no Moo; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 113 | 6 | 1; | |||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||
| 115 | __END__ | ||||||||||||||||||||||||||||