privinc/My/Builder.pm

filter: Statementstmt 72.1% 44 / 61 Branchbran 36.3% 8 / 22 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 90.0% 9 / 10 Podpod 0.0% 0 / 2 totaltotal 63.2% 62 / 98 CC 16 SCAR 25.5
CC
16
Cov
62%
ACTION_orig
30.0
process_man_files
13.5
BEGIN
1.0
CRAP 12.8
« blib/lib/App/KGB/Client/RelayMsg.pm ↑ Summary blib/lib/WWW/Shorten/Debli.pm »
1 package My::Builder;
2 1 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
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 base qw(Module::Build);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 0 ▶sub ACTION_orig {
Subroutine ACTION_orig: not called CC=5 SCAR=34.0
Pod undocumented
9 0 my $self = shift;
10 0 $self->ACTION_manifest();
11 0 $self->ACTION_dist();
12 0 my $dn = $self->dist_name;
13 0 my $ver = $self->dist_version;
14 0 my $pkg_name = 'kgb-bot';
15 0 my $target_dist = "../$dn-$ver.tar.gz";
16 0 my $target_orig = "../$pkg_name\_$ver.orig.tar.gz";
17  
18 0 ▶ rename "$dn-$ver.tar.gz", $target_orig or die $!;
Branch: 1 branch
BranchTrueFalseTotal
rename "$dn-$ver.tar.gz", $target_orig or die $! 0 0 0
19 0 ▶ if ( -e $target_dist ) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $target_dist) 0 0 0
20 0 ▶ unlink $target_dist or die "unlink($target_dist): $!\n";
Branch: 1 branch
BranchTrueFalseTotal
unlink $target_dist or die "unlink($target_dist): $!\n" 0 0 0
21 }
22 0 ▶ link $target_orig, $target_dist or die "link failed: $!\n";
Branch: 1 branch
BranchTrueFalseTotal
link $target_orig, $target_dist or die "link failed: $!\n" 0 0 0
23  
24 0 $self->ACTION_distclean;
25 0 unlink 'MANIFEST.bak';
26 0 print "$target_orig ready.\n";
27 0 print "with $target_dist linked to it.\n";
28 }
29  
30 1 ▶use Config;
Subroutine BEGIN: called CC=1 SCAR=0.0
31 1 ▶use File::Spec;
Subroutine BEGIN: called CC=1 SCAR=0.0
32 1 ▶use File::Copy;
Subroutine BEGIN: called CC=1 SCAR=0.0
33 1 ▶use Pod::Man;
Subroutine BEGIN: called CC=1 SCAR=0.0
34  
35 1 ▶sub process_man_files {
Subroutine process_man_files: called CC=12 SCAR=26.0
Pod undocumented
36 1 my $self = shift;
37  
38 1 for my $s ( 1 .. 9 ) {
39 9 ▶ $self->install_path( "man$s", "/usr/share/man/man$s" )
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->install_path("man$s") 9 0 9
40 unless defined $self->install_path("man$s");
41  
42 9 my $dir = File::Spec->catdir( 'blib', "man$s" );
43 9 ▶ my $files = $self->{"man${s}files"} // "man$s/*";
Condition50%1/2
$$self{"man${s}files"} // "man$s/*"
l!l
09
MC/DC0%0/1
$$self{"man${s}files"} // "man$s/*"
$$self{"man${s}files"}
Truth table50%1/2
A
A= $$self{"man${s}files"}
Aresult
11
00
44 9 ▶ $files = [$files] unless ref($files);
Branch: 1 branch
BranchTrueFalseTotal
unless ref $files 9 0 9
45 9 ▶ ref($files) eq 'ARRAY' or die "man${s}files is not scalar/arayref";
Branch: 1 branch
BranchTrueFalseTotal
ref $files eq "ARRAY" or die "man${s}files is not scalar/arayref" 9 0 9
46  
47 9 my $manner = Pod::Man->new( section => "${s}p" );
48 9 my $man_ext = $Config{"man${s}ext"};
49 9 ▶ unless ( defined($man_ext) ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $man_ext) 7 2 9
50 7 $man_ext = $Config{man1ext};
51 7 $man_ext =~ s/1/$s/;
52 }
53  
54 9 for my $pat (@$files) {
55 9 for my $f ( glob($pat) ) {
56 3 ▶ -d $dir or mkdir $dir;
Branch: 1 branch
BranchTrueFalseTotal
-d $dir or mkdir $dir 3 0 3
57  
58 3 ▶ if ( $f =~ /\.(p|p$s)$/ ) {
Branch: 2 branches
BranchTrueFalseTotal
if ($f =~ /\.(p|p$s)$/) { } 0 3 3
elsif ($f =~ /\.pod$/) { } 3 0 3
59 0 copy( $pat, $dir );
60 }
61 elsif ( $f =~ /\.pod$/ ) {
62  
63 3 my $manf = File::Spec->splitpath($f);
64 3 $manf =~ s/\.pod$/".$man_ext"/e;
65 3 $manner->parse_from_file( $f,
66 File::Spec->catfile( $dir, $manf ) );
67 }
68 }
69 }
70 }
71 }
72  
73 1 1;
74  
« blib/lib/App/KGB/Client/RelayMsg.pm ↑ Summary blib/lib/WWW/Shorten/Debli.pm »