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 | 2807 | use strict; | |||
2 | 8 | ||||||
2 | 100 | ||||||
3 | 2 | 2 | 21 | use warnings; | |||
2 | 3 | ||||||
2 | 614 | ||||||
4 | |||||||
5 | sub new { | ||||||
6 | 7 | 7 | 0 | 34562 | my ($class, @files) = @_; | ||
7 | |||||||
8 | 7 | 96 | bless { | ||||
9 | files => [@files], | ||||||
10 | }, $class; | ||||||
11 | } | ||||||
12 | |||||||
13 | sub collect { | ||||||
14 | 6 | 6 | 0 | 1063 | my ($self) = @_; | ||
15 | |||||||
16 | 6 | 12 | for my $file (@{$self->{files}}) { | ||||
6 | 30 | ||||||
17 | 11 | 100 | 322 | die "$file does not exist" unless -f $file; | |||
18 | } | ||||||
19 | |||||||
20 | 5 | 38 | $self->{files}; | ||||
21 | } | ||||||
22 | |||||||
23 | 1; |