File Coverage

blib/lib/Path/IsDev/Role/HeuristicSet/Simple.pm
Criterion Covered Total %
statement 22 22 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 1 1 100.0
total 29 29 100.0


line stmt bran cond sub pod time code
1 13     13   38744 use 5.008; # utf8
  13         58  
  13         586  
2 13     13   71 use strict;
  13         30  
  13         567  
3 13     13   73 use warnings;
  13         33  
  13         378  
4 13     13   1083 use utf8;
  13         33  
  13         102  
5              
6             package Path::IsDev::Role::HeuristicSet::Simple;
7              
8             our $VERSION = '1.001002';
9              
10             # ABSTRACT: Simple excludes/includes set
11              
12             our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY
13              
14              
15              
16              
17              
18              
19              
20              
21              
22              
23              
24              
25              
26              
27              
28              
29              
30              
31              
32              
33              
34              
35              
36              
37              
38              
39              
40              
41              
42              
43              
44              
45              
46 13     13   2334 use Role::Tiny qw( with requires );
  13         4717  
  13         93  
47              
48             with 'Path::IsDev::Role::HeuristicSet';
49             requires 'heuristics', 'negative_heuristics';
50              
51              
52              
53              
54              
55              
56              
57              
58              
59              
60             sub modules {
61 16     16 1 36 my ($self) = @_;
62 16         33 my @out;
63 16         165 for my $heur ( $self->negative_heuristics ) {
64 48         1829 push @out, $self->_expand_negative_heuristic($heur);
65             }
66 16         548 for my $heur ( $self->heuristics ) {
67 160         5731 push @out, $self->_expand_heuristic($heur);
68             }
69 16         567 return @out;
70             }
71              
72             1;
73              
74             __END__
75              
76             =pod
77              
78             =encoding UTF-8
79              
80             =head1 NAME
81              
82             Path::IsDev::Role::HeuristicSet::Simple - Simple excludes/includes set
83              
84             =head1 VERSION
85              
86             version 1.001002
87              
88             =head1 ROLE REQUIRES
89              
90             =head2 C<heuristics>
91              
92             Consuming classes must provide this method,
93             and return a list of shorthand Heuristics.
94              
95             sub heuristics {
96             return qw( MYMETA )
97             }
98              
99             =head2 C<negative_heuristics>
100              
101             Consuming classes must provide this method,
102             and return a list of shorthand Negative Heuristics.
103              
104             sub negative_heuristics {
105             return qw( IsDev::IgnoreFile )
106             }
107              
108             =head1 METHODS
109              
110             =head2 C<modules>
111              
112             Returns the list of fully qualified module names that comprise this heuristic.
113              
114             expands results from C<< ->heuristics >> and C<< ->negative_heuristics >>,
115             with negative ones preceding positive.
116              
117             =begin MetaPOD::JSON v1.1.0
118              
119             {
120             "namespace":"Path::IsDev::Role::HeuristicSet::Simple",
121             "interface":"role",
122             "does":"Path::IsDev::Role::HeuristicSet"
123             }
124              
125              
126             =end MetaPOD::JSON
127              
128             =head1 AUTHOR
129              
130             Kent Fredric <kentfredric@gmail.com>
131              
132             =head1 COPYRIGHT AND LICENSE
133              
134             This software is copyright (c) 2014 by Kent Fredric <kentfredric@gmail.com>.
135              
136             This is free software; you can redistribute it and/or modify it under
137             the same terms as the Perl 5 programming language system itself.
138              
139             =cut