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