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