_build/lib/PGXN/Build.pm

filter: Statementstmt 30.9% 13 / 42 Branchbran 13.6% 3 / 22 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 40.0% 2 / 5 Podpod 0.0% 0 / 4 totaltotal 24.6% 18 / 73 SCAR 42.9
CC
12
Cov
25%
ACTION_latest_changes
72.0
process_mmd_files
9.4
valid_licenses
2.0
CRAP 72.8
« blib/lib/PGXN/Site/Controller.pm ↑ Summary blib/lib/PGXN/Site/Templates.pm »
1 package PGXN::Build;
2 1 ▶use Module::Build;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 our @ISA = qw(Module::Build);
4  
5 0 ▶ sub valid_licenses { { postgresql => 'PostgreSQL' } }
Subroutine valid_licenses: not called CC=1 SCAR=6.9
Pod undocumented
6 sub process_mmd_files {
7 1 ▶ require Text::MultiMarkdown;
Subroutine process_mmd_files: called CC=5 SCAR=22.4
Pod undocumented
8 1 my $self = shift;
9 1 my $m = Text::MultiMarkdown->new(
10 img_ids => 0,
11 heading_ids => 0,
12 );
13 1 my $files = $self->_find_file_by_type('mmd', 'lib');
14  
15 1 ▶ while (my ($file, $to) = each %$files) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %$files) 5 1 6
16 5 $to =~ s{[.]mmd$}{.html};
17 5 $to = File::Spec->catfile($self->blib, $to);
18 5 ▶ unless ($self->up_to_date( $file, $to )) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->up_to_date($file, $to)) 0 5 5
19 0 File::Path::mkpath(File::Basename::dirname($to), 0, oct(777));
20 0 $self->log_verbose("Converting $file -> $to\n");
21 0 ▶ open my $in, '<:utf8', $file or die "Cannot open $file: $!\n";
Branch: 1 branch
BranchTrueFalseTotal
open my $in, "<:utf8", $file or die "Cannot open ${file}: $!\n" 0 0 0
22 0 chmod 0666, $to;
23 0 ▶ open my $out, '>:utf8', $to or die "Cannot open $to: $!\n";
Branch: 1 branch
BranchTrueFalseTotal
open my $out, ">:utf8", $to or die "Cannot open ${to}: $!\n" 0 0 0
24 0 local $/;
25 0 print $out $m->markdown(<$in>);
26 0 close $in;
27 0 chmod 0444, $to;
28  
29 }
30 }
31 }
32 0 ▶ sub ACTION_tarball_name { print shift->dist_dir . ".tar.gz\n" }
Subroutine ACTION_tarball_name: not called CC=1 SCAR=6.9
Pod undocumented
33 sub ACTION_latest_changes {
34 0 ▶ my $self = shift;
Subroutine ACTION_latest_changes: not called CC=8 SCAR=42.8
Pod undocumented
35 0 (my $dv = $self->dist_version) =~ s/^v//;
36 0 ▶ open my $in, '<:raw', 'Changes' or die "Cannot open Changes: $!\n";
Branch: 1 branch
BranchTrueFalseTotal
open my $in, "<:raw", "Changes" or die "Cannot open Changes: $!\n" 0 0 0
37 0 ▶ open my $out, '>:raw', 'latest_changes.md' or die "Cannot open latest_changes.md: $!\n";
Branch: 1 branch
BranchTrueFalseTotal
open my $out, ">:raw", "latest_changes.md" or die "Cannot open latest_changes.md: $!\n" 0 0 0
38 0 ▶ while (<$in>) { last if /^\Q$dv\E\b/ }
Branch: 2 branches
BranchTrueFalseTotal
if (defined($_ = readline $in)) 0 0 0
if /^\Q$dv\E\b/ 0 0 0
39 0 print {$out} "Changes for v$dv\n";
40 0 ▶ while (<$in>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline $in)) 0 0 0
41 0 ▶ last if /^\s*$/;
Branch: 1 branch
BranchTrueFalseTotal
if /^\s*$/ 0 0 0
42 0 chomp;
43 0 ▶ if (s/^\s+-/- /) {
Branch: 1 branch
BranchTrueFalseTotal
if (s/^\s+-/- /) { } 0 0 0
44 0 print {$out} "\n";
45 } else {
46 0 s/^\s+/ /;
47 }
48 0 print {$out} $_;
49 }
50 0 $self->add_to_cleanup('latest_changes.md');
51 }
52
53 1 1;
« blib/lib/PGXN/Site/Controller.pm ↑ Summary blib/lib/PGXN/Site/Templates.pm »