File Coverage

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


line stmt bran cond sub pod time code
1 9     9   7494 use 5.008; # utf8
  9         42  
  9         383  
2 9     9   53 use strict;
  9         19  
  9         309  
3 9     9   44 use warnings;
  9         18  
  9         233  
4 9     9   922 use utf8;
  9         41  
  9         73  
5              
6             package Path::IsDev::Heuristic::META;
7              
8             our $VERSION = '1.001002';
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   1549 use Role::Tiny::With qw( with );
  9         6397  
  9         1612  
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 54 return qw( META.json META.yml );
43             }
44              
45              
46              
47              
48              
49              
50              
51             sub matches {
52 10     10 1 27 my ( $self, $result_object ) = @_;
53 10 100       33 if ( $self->child_exists_any_file( $result_object, $self->files ) ) {
54 1         27 $result_object->result(1);
55 1         10 return 1;
56             }
57 9         45 return;
58             }
59              
60             1;
61              
62             __END__
63              
64             =pod
65              
66             =encoding UTF-8
67              
68             =head1 NAME
69              
70             Path::IsDev::Heuristic::META - Determine if a path contains META.(json|yml)
71              
72             =head1 VERSION
73              
74             version 1.001002
75              
76             =head1 METHODS
77              
78             =head2 C<files>
79              
80             files relevant to this heuristic:
81              
82             META.json
83             META.yml
84              
85             =head2 C<matches>
86              
87             Matches if any of the files in C<files> exist as children of the C<path>
88              
89             =begin MetaPOD::JSON v1.1.0
90              
91             {
92             "namespace":"Path::IsDev::Heuristic::META",
93             "interface":"single_class",
94             "does":[
95             "Path::IsDev::Role::Heuristic",
96             "Path::IsDev::Role::Matcher::Child::Exists::Any::File"
97             ]
98             }
99              
100              
101             =end MetaPOD::JSON
102              
103             =head1 AUTHOR
104              
105             Kent Fredric <kentfredric@gmail.com>
106              
107             =head1 COPYRIGHT AND LICENSE
108              
109             This software is copyright (c) 2014 by Kent Fredric <kentfredric@gmail.com>.
110              
111             This is free software; you can redistribute it and/or modify it under
112             the same terms as the Perl 5 programming language system itself.
113              
114             =cut