File Coverage

_build/lib/My/Builder.pm
Criterion Covered Total %
statement 15 34 44.1
branch 0 10 0.0
condition n/a
subroutine 3 5 60.0
pod 0 3 0.0
total 18 52 34.6


line stmt bran cond sub pod time code
1             package My::Builder;
2 1     1   693 use Module::Build;
  1         76865  
  1         47  
3             our @ISA = qw(Module::Build);
4              
5             sub ACTION_code {
6 1     1   388 use File::Spec::Functions;
  1         639  
  1         507  
7 1     1 0 180 my $self = shift;
8 1         16 $self->SUPER::ACTION_code(@_);
9             # Copy the test scripts and then set the shebang line and make
10             # sure that they're executable.
11 1         3075 my $to_dir = $self->localize_file_path("t/scripts");
12 1         15 my $from = $self->localize_file_path("t/bin/psql");
13 1         15 my $to = $self->localize_file_path("$to_dir/psql");
14 1         22 $self->copy_if_modified(
15             from => $from,
16             to_dir => $to_dir,
17             flatten => 1,
18             );
19 1         91 $self->fix_shebang_line($to);
20 1         1046 $self->make_executable($to);
21 1         37 $self->add_to_cleanup($to_dir);
22             }
23 0     0 0   sub ACTION_tarball_name { print shift->dist_dir . ".tar.gz\n" }
24             sub ACTION_latest_changes {
25 0     0 0   my $self = shift;
26 0           (my $dv = $self->dist_version) =~ s/^v//;
27 0 0         open my $in, '<:raw', 'Changes' or die "Cannot open Changes: $!\n";
28 0 0         open my $out, '>:raw', 'latest_changes.md' or die "Cannot open latest_changes.md: $!\n";
29 0 0         while (<$in>) { last if /^\Q$dv\E\b/ }
  0            
30 0           print {$out} "Changes for v$dv\n";
  0            
31 0           while (<$in>) {
32 0 0         last if /^\s*$/;
33 0           chomp;
34 0 0         if (s/^\s+-/- /) {
35 0           print {$out} "\n";
  0            
36             } else {
37 0           s/^\s+/ /;
38             }
39 0           print {$out} $_;
  0            
40             }
41 0           $self->add_to_cleanup('latest_changes.md');
42             }
43            
44             1;