lib/App/Netdisco/Builder.pm

filter: Statementstmt 53.4% 23 / 43 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 70.0% 7 / 10 Podpod 0.0% 0 / 3 totaltotal 44.7% 30 / 67 CC 5 SCAR 24.4
CC
5
Cov
44%
ACTION_distmeta
30.0
ACTION_python
2.0
ACTION_install
2.0
CRAP 11.5
« blib/lib/App/Netdisco/DB/SchemaCheck.pm ↑ Summary blib/lib/App/Netdisco/SSHCollector/Platform/Clavister.pm »
1 package App::Netdisco::Builder;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use File::Spec; # core
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use Module::Build;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use CPAN::Changes;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use Perl::Version;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use Module::Metadata;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 1 @App::Netdisco::Builder::ISA = qw(Module::Build);
13  
14 0 ▶sub ACTION_distmeta {
Subroutine ACTION_distmeta: not called CC=5 SCAR=34.0
Pod undocumented
15 0 my $self = shift;
16  
17 # delete the old MANIFEST file if it exists
18 0 ▶ if (-e 'MANIFEST') {
Branch: 1 branch
BranchTrueFalseTotal
if (-e "MANIFEST") 0 0 0
19 0 print "Removing old MANIFEST...\n";
20 0 ▶ unlink 'MANIFEST' or print STDERR "Could not remove MANIFEST: $!";
Branch: 1 branch
BranchTrueFalseTotal
unlink "MANIFEST" or print STDERR "Could not remove MANIFEST: $!" 0 0 0
21 }
22  
23 # run the internal manifest action to generate a fresh one
24 0 print "Generating fresh MANIFEST...\n";
25 0 $self->depends_on('manifest');
26  
27 0 print "Bumping version from Changes...\n";
28 0 my $changes = CPAN::Changes->load("Changes");
29 0 my ($latest_release) = reverse $changes->releases;
30 0 ▶ my $version = ($latest_release->version || $ENV{NETDISCO_RELEASE_VERSION});
Condition0%0/3
$latest_release->version || $ENV{'NETDISCO_RELEASE_VERSION'}
l!l&&r!l&&!r
000
MC/DC0%0/2
$latest_release->version || $ENV{'NETDISCO_RELEASE_VERSION'}
$latest_release->version $ENV{'NETDISCO_RELEASE_VERSION'}
Truth table0%0/3
A || B
A= $latest_release->versionB= $ENV{'NETDISCO_RELEASE_VERSION'}
ABresult
1X1
011
000
31 0 ▶ die "failed to find version in Changes file or environment\n" unless $version;
Branch: 1 branch
BranchTrueFalseTotal
unless $version 0 0 0
32 0 system('perl-reversion', '-set', $version, 'lib/App/Netdisco.pm');
33  
34 # Also force Module::Build to refresh its internal version property
35 # so the generated META files use the new bumped value.
36 $self->{properties}{dist_version}
37 0 = Module::Metadata->new_from_file('lib/App/Netdisco.pm')->version;
38  
39 0 $self->SUPER::ACTION_distmeta(@_);
40 }
41  
42 0 ▶sub ACTION_python {
Subroutine ACTION_python: not called CC=1 SCAR=6.9
Pod undocumented
43 0 my $self = shift;
44 0 require App::Netdisco::Util::Python;
45 0 $self->do_system( App::Netdisco::Util::Python::py_install() );
46 }
47  
48 0 ▶sub ACTION_install {
Subroutine ACTION_install: not called CC=1 SCAR=6.9
Pod undocumented
49 0 my $self = shift;
50 0 $self->SUPER::ACTION_install;
51 0 $self->ACTION_python;
52 }
53  
54 1 1;
« blib/lib/App/Netdisco/DB/SchemaCheck.pm ↑ Summary blib/lib/App/Netdisco/SSHCollector/Platform/Clavister.pm »