_build/lib/Module/Build/Custom.pm

filter: Statementstmt 33.3% 11 / 33 Branchbran 0.0% 0 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 0.0% 0 / 1 totaltotal 29.1% 14 / 48 CC 8 SCAR 35.2
CC
8
Cov
26%
ACTION_install
46.2
BEGIN
1.0
BEGIN
1.0
CRAP 33.9
↑ Summary blib/lib/PDL/Parallel/threads.pm »
1 package Module::Build::Custom;
2 1 ▶use Module::Build;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 our @ISA = qw(Module::Build);
4  
5 sub ACTION_install {
6 0 ▶ my $self = shift;
Subroutine ACTION_install: not called CC=8 SCAR=38.3
Pod undocumented
7
8 # Install the files first
9 0 $self->SUPER::ACTION_install;
10
11 ##################################
12 # Twiddle with the docs database #
13 ##################################
14
15 1 ▶ use PDL::Doc;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 1 ▶ use File::Copy qw(copy);
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 # Find the pdl documentation
19 0 my ($dir,$file,$pdldoc);
20  
21 DIRECTORY:
22 0 for my $dir (@INC) {
23 0 $file = "$dir/PDL/pdldoc.db";
24 0 ▶ if (-f $file) {
Branch: 1 branch
BranchTrueFalseTotal
if (-f $file) 0 0 0
25 0 ▶ if (not -w "$dir/PDL") {
Branch: 1 branch
BranchTrueFalseTotal
unless (-w "$dir/PDL") 0 0 0
26 0 die "No write permission at $dir/PDL! Not updating docs database.\n";
27 }
28 0 print "Found docs database $file\n";
29 0 $pdldoc = new PDL::Doc ($file);
30 0 last DIRECTORY;
31 }
32 }
33  
34 0 ▶ die ("Unable to find docs database! Not updating docs database.\n") unless $pdldoc;
Branch: 1 branch
BranchTrueFalseTotal
unless $pdldoc 0 0 0
35  
36 0 for my $basedir(@INC) {
37 0 $dir = "$basedir/PDL/Parallel";
38 0 ▶ if (-d $dir) {
Branch: 1 branch
BranchTrueFalseTotal
if (-d $dir) 0 0 0
39 0 $pdldoc->ensuredb();
40 0 $pdldoc->scantree($dir);
41 0 eval { $pdldoc->savedb(); };
42 0 ▶ warn $@ if $@;
Branch: 1 branch
BranchTrueFalseTotal
if $@ 0 0 0
43  
44 0 print "PDL docs database updated.\n";
45 0 last;
46 }
47 }
48 }
49
50 1 1;
↑ Summary blib/lib/PDL/Parallel/threads.pm »