| 1 | package App::Changelord::Command::Version; | ||||||||||||||||||||||||||||
| 2 | 3 | our $AUTHORITY = 'cpan:YANICK'; | |||||||||||||||||||||||||||
| 3 | # SYNOPSIS: output the latest / next version | ||||||||||||||||||||||||||||
| 4 | 3 | $App::Changelord::Command::Version::VERSION = '0.0.2'; | |||||||||||||||||||||||||||
| 5 | 3 | ▶ | use 5.36.0; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 3 | ▶ | use Moo; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | use CLI::Osprey | ||||||||||||||||||||||||||||
| 9 | 3 | ▶ | desc => 'output the latest/next version'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 3 | ▶ | use Path::Tiny; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | 3 | ▶ | use JSON; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | 3 | ▶ | use YAML::XS; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | 3 | ▶ | use List::AllUtils qw/ first min /; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 15 | 3 | ▶ | use Version::Dotted::Semantic; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 3 | with 'App::Changelord::Role::Changelog'; | |||||||||||||||||||||||||||
| 18 | 3 | with 'App::Changelord::Role::ChangeTypes'; | |||||||||||||||||||||||||||
| 19 | 3 | with 'App::Changelord::Role::Versions'; | |||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | 0 | ▶ | sub run($self) { | ||||||||||||||||||||||||||
|
Subroutine
run: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 22 | 0 | my $param = shift @ARGV; | |||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | die "invalid parameter '$param', needs to be nothing, 'next' or 'latest'\n" | ||||||||||||||||||||||||||||
| 25 | 0 | ▶ | if $param and not grep { $param eq $_ } qw/ next latest /; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$param and not grep({$param eq $_;} "next", "latest")
MC/DC0%0/2
$param and not grep({$param eq $_;} "next", "latest")
$param
not grep({$param eq $_;} "next", "latest")
Truth table0%0/3
A and not(B)
A= $paramB= not grep({$param eq $_;} "next", "latest")
| |||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | 0 | ▶ | if(!$param) { | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 28 | 0 | say "latest version: ", $self->latest_version; | |||||||||||||||||||||||||||
| 29 | 0 | say "next version: ", $self->next_version; | |||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||
| 31 | elsif( $param eq 'next' ) { | ||||||||||||||||||||||||||||
| 32 | 0 | say $self->next_version; | |||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||
| 34 | else { | ||||||||||||||||||||||||||||
| 35 | 0 | say $self->latest_version; | |||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | 3 | 'end of App::Changelog::Command::Version'; | |||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | __END__ | ||||||||||||||||||||||||||||