File Coverage

blib/lib/ExtUtils/Builder/FileSet.pm
Criterion Covered Total %
statement 26 30 86.6
branch 1 2 50.0
condition n/a
subroutine 6 7 85.7
pod 0 3 0.0
total 33 42 78.5


line stmt bran cond sub pod time code
1             package ExtUtils::Builder::FileSet;
2             $ExtUtils::Builder::FileSet::VERSION = '0.020';
3 9     9   240365 use strict;
  9         24  
  9         412  
4 9     9   52 use warnings;
  9         16  
  9         500  
5              
6 9     9   61 use Carp ();
  9         32  
  9         3382  
7              
8             sub new {
9 5     5 0 34 my ($class, %args) = @_;
10             my $self = bless {
11             entries => [],
12             dependents => [],
13             callback => $args{callback},
14 5         27 }, $class;
15 5         20 return $self;
16             }
17              
18             sub entries {
19 0     0 0 0 my $self = shift;
20 0         0 return @{ $self->{entries} };
  0         0  
21             }
22              
23             sub add_dependent {
24 2     2 0 5 my ($self, $dep) = @_;
25 2         4 push @{ $self->{dependents} }, $dep;
  2         6  
26 2         3 for my $file (@{ $self->{entries} }) {
  2         6  
27 0         0 $dep->add_input($file);
28             }
29 2         6 return;
30             }
31              
32             sub _pass_on {
33 15     15   31 my ($self, $entry) = @_;
34 15         32 push @{ $self->{entries} }, $entry;
  15         44  
35 15 50       72 $self->{callback}->($entry) if $self->{callback};
36 15         26 for my $dependent (@{ $self->{dependents} }) {
  15         39  
37 7         30 $dependent->add_input($entry);
38             }
39 15         49 return;
40             }
41              
42             1;