blib/lib/Alien/Build/Plugin/Core/CleanInstall.pm

filter: Statementstmt 100% 26 / 26 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 100% 1 / 1 totaltotal 100% 38 / 38 CC 4 SCAR 7.9
CC
4
Cov
100%
__ANON__
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.2
« blib/lib/Test/Alien/Synthetic.pm ↑ Summary blib/lib/Alien/Build/Plugin/Prefer/BadVersion.pm »
1 package Alien::Build::Plugin::Core::CleanInstall;
2  
3 57 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 57 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 57 ▶use 5.008004;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 57 ▶use Alien::Build::Plugin;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 57 ▶use Path::Tiny ();
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 # ABSTRACT: Implementation for clean_install hook.
10 57 our $VERSION = '2.88'; # VERSION
11  
12  
13 sub init
14 399 ▶{
Subroutine init: called CC=1 SCAR=0.0
Pod documented
15 399 my($self, $meta) = @_;
16  
17 $meta->default_hook(
18 3 ▶ clean_install => sub {
Subroutine __ANON__: called CC=4 SCAR=13.9
19 3 my($build) = @_;
20 my $root = Path::Tiny->new(
21 $build->runtime_prop->{prefix}
22 3 );
23 3 ▶ if(-d $root)
Branch: 1 branch
BranchTrueFalseTotal
if (-d $root) 2 1 3
24 {
25 2 foreach my $child ($root->children)
26 {
27 10 ▶ if($child->basename eq '_alien')
Branch: 1 branch
BranchTrueFalseTotal
if ($child->basename eq '_alien') { } 2 8 10
28 {
29 2 $build->log("keeping $child");
30 }
31 else
32 {
33 8 $build->log("removing $child");
34 8 $child->remove_tree({ safe => 0});
35 }
36 }
37 }
38 }
39 399 );
40 }
41  
42 57 1;
43  
44 __END__
« blib/lib/Test/Alien/Synthetic.pm ↑ Summary blib/lib/Alien/Build/Plugin/Prefer/BadVersion.pm »