lib/App/PRT/Collector/Files.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 13 | 13 | 100.0 |
branch | 2 | 2 | 100.0 |
condition | n/a | ||
subroutine | 4 | 4 | 100.0 |
pod | 0 | 2 | 0.0 |
total | 19 | 21 | 90.4 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package App::PRT::Collector::Files; | ||||||
2 | 2 | 2 | 1078 | use strict; | |||
2 | 2 | ||||||
2 | 43 | ||||||
3 | 2 | 2 | 4 | use warnings; | |||
2 | 2 | ||||||
2 | 185 | ||||||
4 | |||||||
5 | sub new { | ||||||
6 | 7 | 7 | 0 | 7364 | my ($class, @files) = @_; | ||
7 | |||||||
8 | 7 | 28 | bless { | ||||
9 | files => [@files], | ||||||
10 | }, $class; | ||||||
11 | } | ||||||
12 | |||||||
13 | sub collect { | ||||||
14 | 6 | 6 | 0 | 307 | my ($self) = @_; | ||
15 | |||||||
16 | 6 | 7 | for my $file (@{$self->{files}}) { | ||||
6 | 15 | ||||||
17 | 11 | 100 | 151 | die "$file does not exist" unless -f $file; | |||
18 | } | ||||||
19 | |||||||
20 | 5 | 19 | $self->{files}; | ||||
21 | } | ||||||
22 | |||||||
23 | 1; |