File Coverage

blib/lib/ExtUtils/Builder/FileSet/Subst.pm
Criterion Covered Total %
statement 23 23 100.0
branch 1 2 50.0
condition n/a
subroutine 7 7 100.0
pod 0 2 0.0
total 31 34 91.1


line stmt bran cond sub pod time code
1             package ExtUtils::Builder::FileSet::Subst;
2             $ExtUtils::Builder::FileSet::Subst::VERSION = '0.020';
3 6     6   285313 use strict;
  6         14  
  6         279  
4 6     6   36 use warnings;
  6         12  
  6         510  
5              
6 6     6   49 use base 'ExtUtils::Builder::FileSet';
  6         11  
  6         1373  
7              
8 6     6   79 use Carp ();
  6         17  
  6         166  
9 6     6   36 use Scalar::Util ();
  6         14  
  6         1315  
10              
11             sub new {
12 1     1 0 5 my ($class, %args) = @_;
13 1         7 my $self = $class->SUPER::new(%args);
14 1 50       9 $self->{subst} = $args{subst} or Carp::croak("No subst given");
15 1         4 return $self;
16             }
17              
18             sub add_input {
19 2     2 0 5 my ($self, $source) = @_;
20              
21 2         7 my $target = $self->{subst}->($source);
22 2         11 $self->_pass_on($target);
23 2         4 return $target;
24             }
25              
26             1;