Minilla/CLI/Dist.pm

filter: Statementstmt 67.3% 31 / 46 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 90.9% 10 / 11 Podpod 0.0% 0 / 1 totaltotal 64.0% 41 / 64 CC 4 SCAR 18.6
CC
4
Cov
60%
run
20.0
BEGIN
1.0
BEGIN
1.0
CRAP 6.4
« Minilla/Release/DistTest.pm ↑ Summary Minilla/Gitignore.pm »
1 package Minilla::CLI::Dist;
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  
6 1 ▶use File::Spec::Functions qw(abs2rel catfile);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use File::Basename qw(basename);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use File::Copy qw(copy);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 ▶use Minilla::Logger;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use Minilla::Project;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use Minilla::WorkDir;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 ▶use Minilla::Util qw(check_git parse_options);
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 0 ▶sub run {
Subroutine run: not called CC=4 SCAR=30.0
Pod undocumented
16 0 my ($self, @args) = @_;
17  
18 0 my $test = 1;
19 0 my $skip_prepare = 0;
20  
21 0 check_git;
22  
23 0 parse_options(
24 \@args,
25 'test!' => \$test,
26 'skip-prepare!' => \$skip_prepare,
27 );
28  
29 0 my $project = Minilla::Project->new();
30 0 ▶ errorf("Project validation failed.\n") unless $project->validate();
Branch: 1 branch
BranchTrueFalseTotal
unless $project->validate 0 0 0
31 0 my $work_dir = Minilla::WorkDir->new(
32 project => $project,
33 file_modes => $project->file_modes,
34 skip_prepare => $skip_prepare,
35 );
36 0 ▶ if ($test) {
Branch: 1 branch
BranchTrueFalseTotal
if ($test) 0 0 0
37 0 local $ENV{RELEASE_TESTING} = 1;
38 0 $work_dir->dist_test();
39 }
40 0 my $tar = $work_dir->dist();
41 0 my $dst = catfile($project->dir, basename($tar));
42 0 ▶ copy($tar, $dst) or errorf("Failed to copy %s to %s: %s\n", $tar, $dst, $!);
Branch: 1 branch
BranchTrueFalseTotal
copy($tar, $dst) or errorf("Failed to copy %s to %s: %s\n", $tar, $dst, $!) 0 0 0
43 0 slog({ dist => abs2rel($dst) });
44 }
45  
46 1 1;
47 __END__
« Minilla/Release/DistTest.pm ↑ Summary Minilla/Gitignore.pm »