File Coverage

blib/lib/Dist/Zilla/Role/FileFinder.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             # ABSTRACT: something that finds files within the distribution
2              
3             use Moose::Role;
4 50     50   27631 with 'Dist::Zilla::Role::Plugin';
  50         153  
  50         462  
5              
6             use Dist::Zilla::Pragmas;
7 50     50   264258  
  50         143  
  50         361  
8             use namespace::autoclean;
9 50     50   389  
  50         145  
  50         372  
10             #pod =head1 DESCRIPTION
11             #pod
12             #pod A FileFinder plugin locates files within the distribution. This role exists so
13             #pod that sets of files can be easily described in one configuration section and
14             #pod then used by one or more other plugin.
15             #pod
16             #pod Plugins implementing this role must provide a C<find_files> method which will
17             #pod be called with no arguments and must return an arrayref of files. (This
18             #pod arrayref should not be re-used, as it may be altered once returned.)
19             #pod
20             #pod For example, imagine a simple glob-like FileFinder that expects configuration
21             #pod like this:
22             #pod
23             #pod [Glob / RootModules]
24             #pod glob = *.pm
25             #pod
26             #pod This sets up a FileFinder named "RootModules" which will contain all F<pm>
27             #pod files in the root directory.
28             #pod
29             #pod Another plugin that knows how to use FileFinder plugins might be configured
30             #pod like this:
31             #pod
32             #pod [ModuleRelocator]
33             #pod finder = RootModules
34             #pod relocate_to = attic
35             #pod
36             #pod Finders may operate on any rules they like, checking file size, content, name,
37             #pod or other properties. They should re-perform their "finding" on each call to
38             #pod C<find_files> as the files in the distribution may have changed.
39             #pod
40             #pod =cut
41              
42             requires 'find_files';
43              
44             1;
45              
46              
47             =pod
48              
49             =encoding UTF-8
50              
51             =head1 NAME
52              
53             Dist::Zilla::Role::FileFinder - something that finds files within the distribution
54              
55             =head1 VERSION
56              
57             version 6.028
58              
59             =head1 DESCRIPTION
60              
61             A FileFinder plugin locates files within the distribution. This role exists so
62             that sets of files can be easily described in one configuration section and
63             then used by one or more other plugin.
64              
65             Plugins implementing this role must provide a C<find_files> method which will
66             be called with no arguments and must return an arrayref of files. (This
67             arrayref should not be re-used, as it may be altered once returned.)
68              
69             For example, imagine a simple glob-like FileFinder that expects configuration
70             like this:
71              
72             [Glob / RootModules]
73             glob = *.pm
74              
75             This sets up a FileFinder named "RootModules" which will contain all F<pm>
76             files in the root directory.
77              
78             Another plugin that knows how to use FileFinder plugins might be configured
79             like this:
80              
81             [ModuleRelocator]
82             finder = RootModules
83             relocate_to = attic
84              
85             Finders may operate on any rules they like, checking file size, content, name,
86             or other properties. They should re-perform their "finding" on each call to
87             C<find_files> as the files in the distribution may have changed.
88              
89             =head1 PERL VERSION
90              
91             This module should work on any version of perl still receiving updates from
92             the Perl 5 Porters. This means it should work on any version of perl released
93             in the last two to three years. (That is, if the most recently released
94             version is v5.40, then this module should work on both v5.40 and v5.38.)
95              
96             Although it may work on older versions of perl, no guarantee is made that the
97             minimum required version will not be increased. The version may be increased
98             for any reason, and there is no promise that patches will be accepted to lower
99             the minimum required perl.
100              
101             =head1 AUTHOR
102              
103             Ricardo SIGNES 😏 <cpan@semiotic.systems>
104              
105             =head1 COPYRIGHT AND LICENSE
106              
107             This software is copyright (c) 2022 by Ricardo SIGNES.
108              
109             This is free software; you can redistribute it and/or modify it under
110             the same terms as the Perl 5 programming language system itself.
111              
112             =cut