| 1 | package Minilla::CLI::Release; | ||||||||||||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 1 | ▶ | use utf8; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 1 | ▶ | use ExtUtils::MakeMaker qw(prompt); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 1 | ▶ | use Minilla::Util qw(edit_file require_optional parse_options); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | 1 | ▶ | use Minilla::WorkDir; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | 1 | ▶ | use Minilla::Logger; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 10 | 1 | ▶ | use Minilla::Project; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 11 | |||||||||||||||||||||
| 12 | 0 | ▶ | sub run { | ||||||||||||||||||
|
Subroutine
run: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||
| 13 | 0 | my ($self, @args) = @_; | |||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | 0 | my $opts = { | |||||||||||||||||||
| 16 | test => 1, | ||||||||||||||||||||
| 17 | trial => 0, | ||||||||||||||||||||
| 18 | dry_run => 0, | ||||||||||||||||||||
| 19 | skip_prepare => 0, | ||||||||||||||||||||
| 20 | }; | ||||||||||||||||||||
| 21 | parse_options( | ||||||||||||||||||||
| 22 | \@args, | ||||||||||||||||||||
| 23 | 'test!' => \$opts->{test}, | ||||||||||||||||||||
| 24 | 'trial!' => \$opts->{trial}, | ||||||||||||||||||||
| 25 | 'dry-run!' => \$opts->{dry_run}, | ||||||||||||||||||||
| 26 | 'skip-prepare!' => \$opts->{skip_prepare}, | ||||||||||||||||||||
| 27 | 'pause-config=s' => \$opts->{pause_config}, | ||||||||||||||||||||
| 28 | 0 | ); | |||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | my $project = Minilla::Project->new( | ||||||||||||||||||||
| 31 | skip_prepare => $opts->{skip_prepare}, | ||||||||||||||||||||
| 32 | 0 | ); | |||||||||||||||||||
| 33 | 0 | ▶ | errorf("Project validation failed.\n") unless $project->validate(); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 34 | |||||||||||||||||||||
| 35 | 0 | my @steps = _steps($project); | |||||||||||||||||||
| 36 | 0 | my @klasses; | |||||||||||||||||||
| 37 | # Load all step classes. | ||||||||||||||||||||
| 38 | 0 | for (@steps) { | |||||||||||||||||||
| 39 | 0 | my $klass = "Minilla::Release::$_"; | |||||||||||||||||||
| 40 | 0 | ▶ | if (eval "require ${klass}; 1") { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 41 | 0 | push @klasses, $klass; | |||||||||||||||||||
| 42 | 0 | ▶ | $klass->init() if $klass->can('init'); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 43 | } else { | ||||||||||||||||||||
| 44 | 0 | errorf("Error while loading %s: %s\n", $_, $@); | |||||||||||||||||||
| 45 | } | ||||||||||||||||||||
| 46 | } | ||||||||||||||||||||
| 47 | # And run all steps. | ||||||||||||||||||||
| 48 | 0 | for my $klass (@klasses) { | |||||||||||||||||||
| 49 | 0 | $klass->run($project, $opts); | |||||||||||||||||||
| 50 | } | ||||||||||||||||||||
| 51 | } | ||||||||||||||||||||
| 52 | |||||||||||||||||||||
| 53 | 0 | ▶ | sub _steps { | ||||||||||||||||||
|
Subroutine
_steps: not called CC=3 SCAR=24.8
| |||||||||||||||||||||
| 54 | 0 | my $project = shift; | |||||||||||||||||||
| 55 | |||||||||||||||||||||
| 56 | 0 | my @steps = qw( | |||||||||||||||||||
| 57 | CheckUntrackedFiles | ||||||||||||||||||||
| 58 | CheckOrigin | ||||||||||||||||||||
| 59 | CheckReleaseBranch | ||||||||||||||||||||
| 60 | BumpVersion | ||||||||||||||||||||
| 61 | CheckChanges | ||||||||||||||||||||
| 62 | RegenerateFiles | ||||||||||||||||||||
| 63 | RunHooks | ||||||||||||||||||||
| 64 | DistTest | ||||||||||||||||||||
| 65 | MakeDist | ||||||||||||||||||||
| 66 | |||||||||||||||||||||
| 67 | UploadToCPAN | ||||||||||||||||||||
| 68 | |||||||||||||||||||||
| 69 | RewriteChanges | ||||||||||||||||||||
| 70 | Commit | ||||||||||||||||||||
| 71 | Tag | ||||||||||||||||||||
| 72 | ); | ||||||||||||||||||||
| 73 | |||||||||||||||||||||
| 74 | 0 | ▶ | return @steps if $project->manage_changes; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 75 | 0 | ▶ | return grep { $_ ne 'CheckChanges' && $_ ne 'RewriteChanges' } @steps; | ||||||||||||||||||
|
Condition0%0/3
$_ ne 'CheckChanges' && $_ ne 'RewriteChanges'
MC/DC0%0/2
$_ ne 'CheckChanges' && $_ ne 'RewriteChanges'
$_ ne 'CheckChanges'
$_ ne 'RewriteChanges'
Truth table0%0/3
A && B
A= $_ ne 'CheckChanges'B= $_ ne 'RewriteChanges'
| |||||||||||||||||||||
| 76 | } | ||||||||||||||||||||
| 77 | |||||||||||||||||||||
| 78 | 1 | 1; | |||||||||||||||||||
| 79 | __END__ | ||||||||||||||||||||