_build/lib/Evented/Configuration/Builder.pm

filter: Statementstmt 14.2% 5 / 35 Branchbran 0.0% 0 / 12 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 1 / 2 Podpod 0.0% 0 / 1 totaltotal 12.0% 6 / 50 CC 9 SCAR 44.0
CC
9
Cov
11%
ACTION_distmeta
90.0
BEGIN
1.0
CRAP 81.1
↑ Summary blib/lib/Evented/Configuration.pm »
1 package Evented::Configuration::Builder;
2 1 ▶use Module::Build;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 our @ISA = qw(Module::Build);
4  
5 sub ACTION_distmeta {
6 0 ▶ my $self = shift;
Subroutine ACTION_distmeta: not called CC=9 SCAR=45.0
Pod undocumented
7 0 ▶ if (eval { require Pod::Markdown; 1 }) {
Branch: 1 branch
BranchTrueFalseTotal
if (eval { do { require Pod::Markdown; 1 } }) { } 0 0 0
8  
9 0 $self->log_info("Creating README.md using Pod::Markdown\n");
10 0 ▶ open my $fh, '>', 'README.md' or return $self->SUPER::ACTION_distmeta(@_);
Branch: 1 branch
BranchTrueFalseTotal
open my $fh, ">", "README.md" or return $self->SUPER::ACTION_distmeta(@_) 0 0 0
11  
12 0 my $p = Pod::Markdown->new;
13 0 my $markdown;
14 0 $p->output_string(\$markdown);
15 0 ▶ $p->parse_file('lib/Evented/Configuration.pm') or return $self->SUPER::ACTION_distmeta(@_);
Branch: 1 branch
BranchTrueFalseTotal
$p->parse_file("lib/Evented/Configuration.pm") or return $self->SUPER::ACTION_distmeta(@_) 0 0 0
16  
17 0 my (@lines, $in_block);
18 0 foreach my $line (split "\n", $markdown) {
19  
20 # indented code.
21 0 ▶ if (substr($line, 0, 4) eq ' ') {
Branch: 1 branch
BranchTrueFalseTotal
if (substr($line, 0, 4) eq " ") 0 0 0
22 0 my $code = substr($line, 4, length($line) - 4);
23 0 ▶ if ($in_block) {
Branch: 1 branch
BranchTrueFalseTotal
if ($in_block) 0 0 0
24 0 push @lines, $code;
25 0 next;
26 }
27  
28 0 push @lines, '````perl', $code;
29 0 $in_block = 1;
30 0 next;
31 }
32  
33 # not indented.
34 0 ▶ if ($in_block) {
Branch: 1 branch
BranchTrueFalseTotal
if ($in_block) 0 0 0
35 0 push @lines, '```', $line;
36 0 $in_block = 0;
37 0 next;
38 }
39  
40 0 push @lines, $line;
41 }
42  
43 0 print $fh $_, "\n" foreach @lines;
44 0 close $fh;
45 0 $self->_add_to_manifest('MANIFEST', 'README.md');
46 }
47 else {
48 0 $self->log_warn("Cannot create README.md; Pod::Markdown unavailable\n");
49 }
50 0 return $self->SUPER::ACTION_distmeta(@_);
51 }
52
53 1 1;
↑ Summary blib/lib/Evented/Configuration.pm »