| 1 | package Dist::Zilla::Role::FileFinder 6.040; | ||
| 2 | # ABSTRACT: something that finds files within the distribution | ||
| 3 | |||
| 4 | 51 | ▶ | use Moose::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 51 | with 'Dist::Zilla::Role::Plugin'; | |
| 6 | |||
| 7 | 51 | ▶ | use Dist::Zilla::Pragmas; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 51 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 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 | 51 | requires 'find_files'; | |
| 44 | |||
| 45 | 51 | 1; | |
| 46 | |||
| 47 | __END__ | ||