File Coverage

blib/lib/Path/IsDev/Heuristic/Changelog.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 8     8   2780 use 5.008; # utf8
  8         17  
2 8     8   26 use strict;
  8         8  
  8         121  
3 8     8   32 use warnings;
  8         9  
  8         150  
4 8     8   482 use utf8;
  8         16  
  8         27  
5              
6             package Path::IsDev::Heuristic::Changelog;
7              
8             our $VERSION = '1.001003';
9              
10             # ABSTRACT: Determine if a path contains a Changelog (or similar)
11              
12             our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY
13              
14              
15              
16              
17              
18              
19              
20              
21              
22              
23              
24              
25              
26 8     8   769 use Role::Tiny::With qw( with );
  8         3500  
  8         1389  
27             with 'Path::IsDev::Role::Heuristic', 'Path::IsDev::Role::Matcher::Child::BaseName::MatchRegexp::File';
28              
29              
30              
31              
32              
33              
34              
35              
36              
37              
38              
39              
40             sub basename_regexp {
41             ## no critic (RegularExpressions::RequireLineBoundaryMatching)
42 9     9 1 49 return qr/\AChange(s|log)(|[.][^.\s]+)\z/isx;
43             }
44              
45              
46              
47              
48              
49              
50              
51             sub matches {
52 9     9 1 16 my ( $self, $result_object ) = @_;
53 9 100       24 if ( $self->child_basename_matchregexp_file( $result_object, $self->basename_regexp ) ) {
54 3         46 $result_object->result(1);
55 3         21 return 1;
56             }
57 6         21 return;
58             }
59              
60             1;
61              
62             __END__