File Coverage

inc/Module/Build/My.pm
Criterion Covered Total %
statement 15 24 62.5
branch 0 4 0.0
condition 0 3 0.0
subroutine 5 6 83.3
pod 0 1 0.0
total 20 38 52.6


line stmt bran cond sub pod time code
1             package Module::Build::My;
2              
3 1     1   7 use strict;
  1         13  
  1         78  
4 1     1   6 use warnings;
  1         15  
  1         129  
5              
6 1     1   7 use base 'Module::Build';
  1         2  
  1         971  
7              
8 1     1   108532 use File::Spec;
  1         1  
  1         188  
9              
10             # Replace *.pl files with ones without suffix
11              
12             sub process_script_files {
13 1     1 0 2915 my $self = shift;
14              
15             local *copy_if_modified = sub {
16 0     0   0 my $self = shift;
17 0 0       0 my %args = (@_ > 3 ? (@_) : (from => shift, to_dir => shift, flatten => shift));
18              
19             # Only for script/*.pl files
20 0 0 0     0 if ($args{from} =~ /\bscript\/.*\.pl$/ and $args{to_dir}) {
21 0         0 my (undef, undef, $file) = File::Spec->splitpath($args{from});
22 0         0 $file =~ s/\.pl$//;
23 0         0 $args{to} = File::Spec->catfile($args{to_dir}, $file);
24 0         0 delete $args{to_dir};
25 0         0 return $self->SUPER::copy_if_modified(%args);
26             }
27 0         0 return $self->SUPER::copy_if_modified(%args);
28 1         13 };
29              
30 1         12 $self->SUPER::process_script_files;
31             }
32              
33             1;