| 1 | 10 | ▶ | use 5.008; # utf8 |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 2 | 10 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 10 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 10 | ▶ | use utf8; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | package Git::Wrapper::Plus::Versions; | ||
| 7 | 10 | $Git::Wrapper::Plus::Versions::VERSION = '0.004010'; | |
| 8 | # ABSTRACT: Analyze and compare git versions | ||
| 9 | |||
| 10 | 10 | our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY | |
| 11 | |||
| 12 | |||
| 13 | |||
| 14 | |||
| 15 | |||
| 16 | |||
| 17 | |||
| 18 | |||
| 19 | |||
| 20 | |||
| 21 | |||
| 22 | |||
| 23 | |||
| 24 | 10 | ▶ | use Moo qw( has ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 25 | 10 | ▶ | use Sort::Versions qw( versioncmp ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 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 | |||
| 52 | |||
| 53 | |||
| 54 | 10 | has git => required => 1, is => ro =>; | |
| 55 | |||
| 56 | |||
| 57 | |||
| 58 | |||
| 59 | |||
| 60 | |||
| 61 | |||
| 62 | sub current_version { | ||
| 63 | 38 | ▶ | my ($self) = @_; |
|
Subroutine
current_version: called CC=1 SCAR=0.0
Pod
documented
| |||
| 64 | 38 | return $self->git->version; | |
| 65 | } | ||
| 66 | |||
| 67 | |||
| 68 | |||
| 69 | |||
| 70 | |||
| 71 | |||
| 72 | |||
| 73 | |||
| 74 | |||
| 75 | |||
| 76 | |||
| 77 | sub newer_than { | ||
| 78 | 36 | ▶ | my ( $self, $v ) = @_; |
|
Subroutine
newer_than: called CC=1 SCAR=0.0
Pod
documented
| |||
| 79 | 36 | return versioncmp( $self->current_version, $v ) >= 0; | |
| 80 | } | ||
| 81 | |||
| 82 | |||
| 83 | |||
| 84 | |||
| 85 | |||
| 86 | |||
| 87 | |||
| 88 | |||
| 89 | |||
| 90 | |||
| 91 | |||
| 92 | sub older_than { | ||
| 93 | 1 | ▶ | my ( $self, $v ) = @_; |
|
Subroutine
older_than: called CC=1 SCAR=0.0
Pod
documented
| |||
| 94 | 1 | return versioncmp( $self->current_version, $v ) < 0; | |
| 95 | } | ||
| 96 | |||
| 97 | 10 | ▶ | no Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 98 | 10 | 1; | |
| 99 | |||
| 100 | __END__ | ||