/usr/share/perl5/Dist/Zilla/Plugin/FileFinder/Filter.pm is in libdist-zilla-perl 5.043-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | package Dist::Zilla::Plugin::FileFinder::Filter;
# ABSTRACT: filter matches from other FileFinders
$Dist::Zilla::Plugin::FileFinder::Filter::VERSION = '5.043';
use Moose;
with(
'Dist::Zilla::Role::FileFinder',
'Dist::Zilla::Role::FileFinderUser' => {
default_finders => [],
},
);
use namespace::autoclean;
#pod =head1 SYNOPSIS
#pod
#pod In your F<dist.ini>:
#pod
#pod [FileFinder::Filter / MyFiles]
#pod finder = :InstallModules ; find files from :InstallModules
#pod finder = :ExecFiles ; or :ExecFiles
#pod skip = ignore ; that don't have "ignore" in the path
#pod
#pod =head1 CREDITS
#pod
#pod This plugin was originally contributed by Christopher J. Madsen.
#pod
#pod =cut
use Moose::Util::TypeConstraints;
use MooseX::Types::Moose qw(ArrayRef RegexpRef Str);
{
my $type = subtype as ArrayRef[RegexpRef];
coerce $type, from ArrayRef[Str], via { [map { qr/$_/ } @$_] };
#pod =attr finder
#pod
#pod A FileFinder to supply the initial list of files.
#pod May occur multiple times.
#pod
#pod =attr skip
#pod
#pod The pathname must I<not> match any of these regular expressions.
#pod May occur multiple times.
#pod
#pod =cut
has skips => (
is => 'ro',
isa => $type,
coerce => 1,
default => sub { [] },
);
}
sub mvp_aliases { +{ qw(
skip skips
) } }
sub mvp_multivalue_args { qw(skips) }
sub find_files {
my $self = shift;
my $files = $self->found_files;
foreach my $re (@{ $self->skips }) {
@$files = grep { $_->name !~ $re } @$files;
}
$self->log_debug("No files found") unless @$files;
$self->log_debug("Found " . $_->name) for @$files;
$files;
}
__PACKAGE__->meta->make_immutable;
1;
#pod =head1 DESCRIPTION
#pod
#pod FileFinder::Filter is a L<FileFinder|Dist::Zilla::Role::FileFinder> that
#pod selects files by filtering the selections of other FileFinders.
#pod
#pod You specify one or more FileFinders to generate the initial list of
#pod files. Any file whose pathname matches any of the C<skip> regexs is
#pod removed from that list.
#pod
#pod =for Pod::Coverage
#pod mvp_aliases
#pod mvp_multivalue_args
#pod find_files
__END__
=pod
=encoding UTF-8
=head1 NAME
Dist::Zilla::Plugin::FileFinder::Filter - filter matches from other FileFinders
=head1 VERSION
version 5.043
=head1 SYNOPSIS
In your F<dist.ini>:
[FileFinder::Filter / MyFiles]
finder = :InstallModules ; find files from :InstallModules
finder = :ExecFiles ; or :ExecFiles
skip = ignore ; that don't have "ignore" in the path
=head1 DESCRIPTION
FileFinder::Filter is a L<FileFinder|Dist::Zilla::Role::FileFinder> that
selects files by filtering the selections of other FileFinders.
You specify one or more FileFinders to generate the initial list of
files. Any file whose pathname matches any of the C<skip> regexs is
removed from that list.
=head1 ATTRIBUTES
=head2 finder
A FileFinder to supply the initial list of files.
May occur multiple times.
=head2 skip
The pathname must I<not> match any of these regular expressions.
May occur multiple times.
=head1 CREDITS
This plugin was originally contributed by Christopher J. Madsen.
=for Pod::Coverage mvp_aliases
mvp_multivalue_args
find_files
=head1 AUTHOR
Ricardo SIGNES <rjbs@cpan.org>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2016 by Ricardo SIGNES.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
|