line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: Stop CPAN from indexing stuff |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
use Moose; |
4
|
2
|
|
|
2
|
|
2076
|
with 'Dist::Zilla::Role::MetaProvider'; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
16
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use Dist::Zilla::Pragmas; |
7
|
2
|
|
|
2
|
|
14105
|
|
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
19
|
|
8
|
|
|
|
|
|
|
use namespace::autoclean; |
9
|
2
|
|
|
2
|
|
35
|
|
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
26
|
|
10
|
|
|
|
|
|
|
#pod =encoding utf8 |
11
|
|
|
|
|
|
|
#pod |
12
|
|
|
|
|
|
|
#pod =head1 SYNOPSIS |
13
|
|
|
|
|
|
|
#pod |
14
|
|
|
|
|
|
|
#pod In your F<dist.ini>: |
15
|
|
|
|
|
|
|
#pod |
16
|
|
|
|
|
|
|
#pod [MetaNoIndex] |
17
|
|
|
|
|
|
|
#pod |
18
|
|
|
|
|
|
|
#pod directory = t/author |
19
|
|
|
|
|
|
|
#pod directory = examples |
20
|
|
|
|
|
|
|
#pod |
21
|
|
|
|
|
|
|
#pod file = lib/Foo.pm |
22
|
|
|
|
|
|
|
#pod |
23
|
|
|
|
|
|
|
#pod package = My::Module |
24
|
|
|
|
|
|
|
#pod |
25
|
|
|
|
|
|
|
#pod namespace = My::Module |
26
|
|
|
|
|
|
|
#pod |
27
|
|
|
|
|
|
|
#pod =head1 DESCRIPTION |
28
|
|
|
|
|
|
|
#pod |
29
|
|
|
|
|
|
|
#pod This plugin allows you to prevent PAUSE/CPAN from indexing files you don't |
30
|
|
|
|
|
|
|
#pod want indexed. This is useful if you build test classes or example classes |
31
|
|
|
|
|
|
|
#pod that are used for those purposes only, and are not part of the distribution. |
32
|
|
|
|
|
|
|
#pod It does this by adding a C<no_index> block to your F<META.json> (or |
33
|
|
|
|
|
|
|
#pod F<META.yml>) file in your distribution. |
34
|
|
|
|
|
|
|
#pod |
35
|
|
|
|
|
|
|
#pod =for Pod::Coverage mvp_aliases mvp_multivalue_args |
36
|
|
|
|
|
|
|
#pod |
37
|
|
|
|
|
|
|
#pod =cut |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
my %ATTR_ALIAS = ( |
40
|
|
|
|
|
|
|
directories => [ qw(directory dir folder) ], |
41
|
|
|
|
|
|
|
files => [ qw(file) ], |
42
|
|
|
|
|
|
|
packages => [ qw(package class module) ], |
43
|
|
|
|
|
|
|
namespaces => [ qw(namespace) ], |
44
|
|
|
|
|
|
|
); |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
my %alias_for; |
47
|
|
|
|
|
|
|
|
48
|
1
|
|
|
1
|
0
|
144
|
for my $key (keys %ATTR_ALIAS) { |
49
|
|
|
|
|
|
|
$alias_for{ $_ } = $key for @{ $ATTR_ALIAS{$key} }; |
50
|
1
|
|
|
|
|
4
|
} |
51
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
23
|
|
52
|
|
|
|
|
|
|
return \%alias_for; |
53
|
|
|
|
|
|
|
} |
54
|
1
|
|
|
|
|
26
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
#pod =attr directories |
57
|
1
|
|
|
1
|
0
|
220
|
#pod |
58
|
|
|
|
|
|
|
#pod Exclude folders and everything in them, for example: F<author.t> |
59
|
|
|
|
|
|
|
#pod |
60
|
|
|
|
|
|
|
#pod Aliases: C<folder>, C<dir>, C<directory> |
61
|
|
|
|
|
|
|
#pod |
62
|
|
|
|
|
|
|
#pod =attr files |
63
|
|
|
|
|
|
|
#pod |
64
|
|
|
|
|
|
|
#pod Exclude a specific file, for example: F<lib/Foo.pm> |
65
|
|
|
|
|
|
|
#pod |
66
|
|
|
|
|
|
|
#pod Alias: C<file> |
67
|
|
|
|
|
|
|
#pod |
68
|
|
|
|
|
|
|
#pod =attr packages |
69
|
|
|
|
|
|
|
#pod |
70
|
|
|
|
|
|
|
#pod Exclude by package name, for example: C<My::Package> |
71
|
|
|
|
|
|
|
#pod |
72
|
|
|
|
|
|
|
#pod Aliases: C<class>, C<module>, C<package> |
73
|
|
|
|
|
|
|
#pod |
74
|
|
|
|
|
|
|
#pod =attr namespaces |
75
|
|
|
|
|
|
|
#pod |
76
|
|
|
|
|
|
|
#pod Exclude everything under a specific namespace, for example: C<My::Package> |
77
|
|
|
|
|
|
|
#pod |
78
|
|
|
|
|
|
|
#pod Alias: C<namespace> |
79
|
|
|
|
|
|
|
#pod |
80
|
|
|
|
|
|
|
#pod B<NOTE:> This will not exclude the package C<My::Package>, only everything |
81
|
|
|
|
|
|
|
#pod under it like C<My::Package::Foo>. |
82
|
|
|
|
|
|
|
#pod |
83
|
|
|
|
|
|
|
#pod =cut |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
for my $attr (keys %ATTR_ALIAS) { |
86
|
|
|
|
|
|
|
has $attr => ( |
87
|
|
|
|
|
|
|
is => 'ro', |
88
|
|
|
|
|
|
|
isa => 'ArrayRef[Str]', |
89
|
|
|
|
|
|
|
init_arg => $attr, |
90
|
|
|
|
|
|
|
predicate => "_has_$attr", |
91
|
|
|
|
|
|
|
); |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
#pod =method metadata |
95
|
|
|
|
|
|
|
#pod |
96
|
|
|
|
|
|
|
#pod Returns a reference to a hash containing the distribution's no_index metadata. |
97
|
|
|
|
|
|
|
#pod |
98
|
|
|
|
|
|
|
#pod =cut |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
my $self = shift; |
101
|
|
|
|
|
|
|
return { |
102
|
|
|
|
|
|
|
no_index => { |
103
|
|
|
|
|
|
|
map {; my $reader = $_->[0]; ($_->[1] => [ sort @{ $self->$reader } ]) } |
104
|
1
|
|
|
1
|
1
|
3
|
grep {; my $pred = "_has_$_->[0]"; $self->$pred } |
105
|
|
|
|
|
|
|
map {; [ $_ => $ATTR_ALIAS{$_}[0] ] } |
106
|
|
|
|
|
|
|
keys %ATTR_ALIAS |
107
|
4
|
|
|
|
|
10
|
} |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
127
|
|
108
|
4
|
|
|
|
|
12
|
}; |
|
4
|
|
|
|
|
150
|
|
109
|
1
|
|
|
|
|
7
|
} |
|
4
|
|
|
|
|
14
|
|
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
112
|
|
|
|
|
|
|
1; |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
#pod =head1 SEE ALSO |
115
|
|
|
|
|
|
|
#pod |
116
|
|
|
|
|
|
|
#pod Dist::Zilla roles: L<MetaProvider|Dist::Zilla::Role::MetaProvider>. |
117
|
|
|
|
|
|
|
#pod |
118
|
|
|
|
|
|
|
#pod =cut |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=pod |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=encoding UTF-8 |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=head1 NAME |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
Dist::Zilla::Plugin::MetaNoIndex - Stop CPAN from indexing stuff |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=head1 VERSION |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
version 6.028 |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=head1 SYNOPSIS |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
In your F<dist.ini>: |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
[MetaNoIndex] |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
directory = t/author |
140
|
|
|
|
|
|
|
directory = examples |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
file = lib/Foo.pm |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
package = My::Module |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
namespace = My::Module |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
=head1 DESCRIPTION |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
This plugin allows you to prevent PAUSE/CPAN from indexing files you don't |
151
|
|
|
|
|
|
|
want indexed. This is useful if you build test classes or example classes |
152
|
|
|
|
|
|
|
that are used for those purposes only, and are not part of the distribution. |
153
|
|
|
|
|
|
|
It does this by adding a C<no_index> block to your F<META.json> (or |
154
|
|
|
|
|
|
|
F<META.yml>) file in your distribution. |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
=head1 PERL VERSION |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
This module should work on any version of perl still receiving updates from |
159
|
|
|
|
|
|
|
the Perl 5 Porters. This means it should work on any version of perl released |
160
|
|
|
|
|
|
|
in the last two to three years. (That is, if the most recently released |
161
|
|
|
|
|
|
|
version is v5.40, then this module should work on both v5.40 and v5.38.) |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
Although it may work on older versions of perl, no guarantee is made that the |
164
|
|
|
|
|
|
|
minimum required version will not be increased. The version may be increased |
165
|
|
|
|
|
|
|
for any reason, and there is no promise that patches will be accepted to lower |
166
|
|
|
|
|
|
|
the minimum required perl. |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
=head2 directories |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
Exclude folders and everything in them, for example: F<author.t> |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
Aliases: C<folder>, C<dir>, C<directory> |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
=head2 files |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
Exclude a specific file, for example: F<lib/Foo.pm> |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
Alias: C<file> |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
=head2 packages |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
Exclude by package name, for example: C<My::Package> |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
Aliases: C<class>, C<module>, C<package> |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
=head2 namespaces |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
Exclude everything under a specific namespace, for example: C<My::Package> |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
Alias: C<namespace> |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
B<NOTE:> This will not exclude the package C<My::Package>, only everything |
195
|
|
|
|
|
|
|
under it like C<My::Package::Foo>. |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
=head1 METHODS |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
=head2 metadata |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
Returns a reference to a hash containing the distribution's no_index metadata. |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
=for Pod::Coverage mvp_aliases mvp_multivalue_args |
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
=head1 SEE ALSO |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
Dist::Zilla roles: L<MetaProvider|Dist::Zilla::Role::MetaProvider>. |
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
=head1 AUTHOR |
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
Ricardo SIGNES 😏 <cpan@semiotic.systems> |
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
This software is copyright (c) 2022 by Ricardo SIGNES. |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
218
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
=cut |