lib/Serge/Command/gendocs.pm

filter: Statementstmt 54.2% 19 / 35 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 66.6% 6 / 9 Podpod 0.0% 0 / 2 totaltotal 47.1% 25 / 53 SCAR 18.4
CC
4
Cov
48%
__ANON__
12.0
run
6.0
get_commands
2.0
CRAP 6.3
« lib/Serge/Engine/Plugin/Transform/tags.pm ↑ Summary lib/Serge/Engine/Plugin/process_if.pm »
1 package Serge::Command::gendocs;
2 1 ▶use parent Serge::Command;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use File::Basename;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use File::Find qw(find);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use File::Spec::Functions qw(rel2abs abs2rel catfile splitdir);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use Serge::Pod;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 sub get_commands {
12 return {
13 0 ▶ gendocs => {handler => \&run, info => 'Rebuild HTML from POD docs'},
Subroutine get_commands: not called CC=1 SCAR=6.9
Pod undocumented
14 }
15 }
16  
17 sub run {
18 0 ▶ my ($self, $command) = @_;
Subroutine run: not called CC=2 SCAR=17.9
Pod undocumented
19  
20 0 my $pod = Serge::Pod->new();
21  
22 0 my $pod_root = $pod->{pod_root};
23  
24 0 my @podfiles;
25  
26 0 print "Scanning .pod files in '$pod_root'...";
27 find(sub {
28 0 ▶ push @podfiles, catfile($File::Find::name) if (-f $_ && /\.pod$/);
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 1 branch
BranchTrueFalseTotal
if -f $_ and /\.pod$/ 0 0 0
Condition0%0/3
-f $_ and /\.pod$/
!ll&&!rl&&r
000
MC/DC0%0/2
-f $_ and /\.pod$/
-f $_ /\.pod$/
Truth table0%0/3
A and B
A= -f $_B= /\.pod$/
ABresult
0X0
100
111
29 0 }, $pod_root);
30  
31 0 my $n = scalar(@podfiles);
32 0 print " $n files found\n";
33  
34 0 foreach my $podfile (@podfiles) {
35 0 my $command = abs2rel($podfile, $pod_root);
36 0 $command =~ s/\.pod$//;
37  
38 0 my $htmlfile = $pod->save_html($command, $podfile);
39 0 print "Saved $htmlfile\n";
40 }
41  
42 0 return 0;
43 }
44  
45 1 1;
« lib/Serge/Engine/Plugin/Transform/tags.pm ↑ Summary lib/Serge/Engine/Plugin/process_if.pm »