File Coverage

blib/lib/Path/IsDev/Heuristic/META.pm
Criterion Covered Total %
statement 20 20 100.0
branch 2 2 100.0
condition n/a
subroutine 7 7 100.0
pod 2 2 100.0
total 31 31 100.0


line stmt bran cond sub pod time code
1 9     9   3076 use 5.008; # utf8
  9         21  
2 9     9   27 use strict;
  9         9  
  9         137  
3 9     9   25 use warnings;
  9         9  
  9         182  
4 9     9   565 use utf8;
  9         14  
  9         33  
5              
6             package Path::IsDev::Heuristic::META;
7              
8             our $VERSION = '1.001003';
9              
10              
11              
12              
13              
14              
15              
16              
17              
18              
19              
20              
21              
22              
23              
24              
25             # ABSTRACT: Determine if a path contains META.(json|yml)
26              
27             our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY
28              
29 9     9   877 use Role::Tiny::With qw( with );
  9         3757  
  9         1004  
30             with 'Path::IsDev::Role::Heuristic', 'Path::IsDev::Role::Matcher::Child::Exists::Any::File';
31              
32              
33              
34              
35              
36              
37              
38              
39              
40              
41             sub files {
42 10     10 1 29 return qw( META.json META.yml );
43             }
44              
45              
46              
47              
48              
49              
50              
51             sub matches {
52 10     10 1 14 my ( $self, $result_object ) = @_;
53 10 100       23 if ( $self->child_exists_any_file( $result_object, $self->files ) ) {
54 1         15 $result_object->result(1);
55 1         6 return 1;
56             }
57 9         30 return;
58             }
59              
60             1;
61              
62             __END__