| 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
| |||||||||||||||
| 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
| |||||||||||||||
| 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
| |||||||||||||||
| 22 | 0 | chmod 0666, $to; | |||||||||||||
| 23 | 0 | ▶ | open my $out, '>:utf8', $to or die "Cannot open $to: $!\n"; | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 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
| |||||||||||||||
| 37 | 0 | ▶ | open my $out, '>:raw', 'latest_changes.md' or die "Cannot open latest_changes.md: $!\n"; | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 38 | 0 | ▶ | while (<$in>) { last if /^\Q$dv\E\b/ } | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 39 | 0 | print {$out} "Changes for v$dv\n"; | |||||||||||||
| 40 | 0 | ▶ | while (<$in>) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 41 | 0 | ▶ | last if /^\s*$/; | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 42 | 0 | chomp; | |||||||||||||
| 43 | 0 | ▶ | if (s/^\s+-/- /) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 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; | |||||||||||||