File Coverage

lib/CPAN/Audit/Discover.pm
Criterion Covered Total %
statement 20 22 90.9
branch 2 4 50.0
condition n/a
subroutine 6 6 100.0
pod 0 2 0.0
total 28 34 82.3


line stmt bran cond sub pod time code
1             package CPAN::Audit::Discover;
2 13     13   84 use strict;
  13         41  
  13         519  
3 13     13   62 use warnings;
  13         32  
  13         673  
4 13     13   6234 use CPAN::Audit::Discover::Cpanfile;
  13         72  
  13         593  
5 13     13   6550 use CPAN::Audit::Discover::CpanfileSnapshot;
  13         45  
  13         2946  
6              
7             our $VERSION = "1.001";
8              
9             sub new {
10 8     8 0 23 my $class = shift;
11              
12 8         18 my $self = {};
13 8         46 bless $self, $class;
14              
15 8         24 return $self;
16             }
17              
18             sub discover {
19 3     3 0 21 my $self = shift;
20 3         12 my ($path) = @_;
21              
22 3 50       201 if ( -f "$path/cpanfile.snapshot" ) {
    50          
23 0         0 return CPAN::Audit::Discover::CpanfileSnapshot->new->discover("$path/cpanfile.snapshot");
24             }
25             elsif ( -f "$path/cpanfile" ) {
26 3         44 return CPAN::Audit::Discover::Cpanfile->new->discover("$path/cpanfile");
27             }
28             else {
29             }
30              
31 0           return;
32             }
33              
34             1;