File Coverage

lib/Path/IsDev/Heuristic/Makefile.pm
Criterion Covered Total %
statement 19 21 90.4
branch 1 2 50.0
condition n/a
subroutine 7 7 100.0
pod 2 2 100.0
total 29 32 90.6


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