line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
4
|
|
|
4
|
|
2143589
|
use 5.006; |
|
4
|
|
|
|
|
13
|
|
|
4
|
|
|
|
|
142
|
|
2
|
4
|
|
|
4
|
|
17
|
use strict; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
123
|
|
3
|
4
|
|
|
4
|
|
17
|
use warnings; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
306
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Dist::Zilla::Plugin::Prereqs::Plugins; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '1.003002'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# ABSTRACT: Add all Dist::Zilla plugins presently in use as prerequisites. |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY |
12
|
|
|
|
|
|
|
|
13
|
4
|
|
|
4
|
|
1875
|
use Moose qw( with has around ); |
|
4
|
|
|
|
|
355092
|
|
|
4
|
|
|
|
|
41
|
|
14
|
4
|
|
|
4
|
|
21813
|
use Dist::Zilla::Util::ConfigDumper qw( config_dumper ); |
|
4
|
|
|
|
|
4715
|
|
|
4
|
|
|
|
|
29
|
|
15
|
4
|
|
|
4
|
|
689
|
use Dist::Zilla::Util; |
|
4
|
|
|
|
|
8986
|
|
|
4
|
|
|
|
|
106
|
|
16
|
4
|
|
|
4
|
|
411
|
use MooseX::Types::Moose qw( HashRef ArrayRef Str ); |
|
4
|
|
|
|
|
38552
|
|
|
4
|
|
|
|
|
62
|
|
17
|
4
|
|
|
4
|
|
20096
|
use Dist::Zilla::Util::BundleInfo; |
|
4
|
|
|
|
|
67352
|
|
|
4
|
|
|
|
|
165
|
|
18
|
4
|
|
|
4
|
|
2354
|
use Dist::Zilla::Util::ExpandINI::Reader; |
|
4
|
|
|
|
|
31525
|
|
|
4
|
|
|
|
|
142
|
|
19
|
4
|
|
|
4
|
|
28
|
use Module::Runtime qw( require_module ); |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
41
|
|
20
|
4
|
|
|
4
|
|
959
|
use Path::Tiny qw( path ); |
|
4
|
|
|
|
|
9787
|
|
|
4
|
|
|
|
|
2098
|
|
21
|
|
|
|
|
|
|
with 'Dist::Zilla::Role::PrereqSource'; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
has phase => ( is => ro =>, isa => Str, lazy => 1, default => sub { 'develop' }, ); |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
has relation => ( is => ro =>, isa => Str, lazy => 1, default => sub { 'requires' }, ); |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
has exclude => ( is => ro =>, isa => ArrayRef [Str], lazy => 1, default => sub { [] } ); |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
has _exclude_hash => ( is => ro =>, isa => HashRef [Str], lazy => 1, builder => '_build__exclude_hash' ); |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
|
95
|
3
|
|
|
3
|
1
|
992
|
sub mvp_multivalue_args { return qw(exclude) } |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
sub _build__exclude_hash { |
102
|
3
|
|
|
3
|
|
4
|
my ( $self, ) = @_; |
103
|
3
|
|
|
|
|
8
|
return { map { ( $_ => 1 ) } @{ $self->exclude } }; |
|
0
|
|
|
|
|
0
|
|
|
3
|
|
|
|
|
99
|
|
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
around 'dump_config' => config_dumper( __PACKAGE__, qw( phase relation exclude ) ); |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
sub _register_plugin_prereq { |
109
|
9
|
|
|
9
|
|
36
|
my ( $self, $package, $lines ) = @_; |
110
|
9
|
50
|
|
|
|
310
|
return if exists $self->_exclude_hash->{$package}; |
111
|
9
|
|
|
|
|
207
|
$self->zilla->register_prereqs( { phase => $self->phase, type => $self->relation }, $package, 0 ); |
112
|
9
|
50
|
|
|
|
2211
|
return unless @{ $lines || [] }; |
|
9
|
100
|
|
|
|
34
|
|
113
|
7
|
|
|
|
|
7
|
while ( @{$lines} ) { |
|
29
|
|
|
|
|
608
|
|
114
|
22
|
|
|
|
|
18
|
my $key = shift @{$lines}; |
|
22
|
|
|
|
|
27
|
|
115
|
22
|
|
|
|
|
13
|
my $value = shift @{$lines}; |
|
22
|
|
|
|
|
25
|
|
116
|
22
|
100
|
|
|
|
43
|
next unless q[:version] eq $key; |
117
|
4
|
|
|
|
|
119
|
$self->zilla->register_prereqs( { phase => $self->phase, type => $self->relation }, $package, $value ); |
118
|
|
|
|
|
|
|
} |
119
|
7
|
|
|
|
|
29
|
return; |
120
|
|
|
|
|
|
|
} |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
sub register_prereqs { |
129
|
3
|
|
|
3
|
1
|
361236
|
my ($self) = @_; |
130
|
3
|
|
|
|
|
34
|
my $reader = Dist::Zilla::Util::ExpandINI::Reader->new(); |
131
|
3
|
|
|
|
|
179
|
my $ini = path( $self->zilla->root )->child('dist.ini'); |
132
|
3
|
50
|
|
|
|
368
|
if ( not $ini->exists ) { |
133
|
0
|
|
|
|
|
0
|
$self->log_fatal(q[Prereqs::Plugins only works on dist.ini due to :version hidden since 5.032]); |
134
|
0
|
|
|
|
|
0
|
return; |
135
|
|
|
|
|
|
|
} |
136
|
3
|
|
|
|
|
108
|
my (@sections) = @{ $reader->read_file("$ini") }; |
|
3
|
|
|
|
|
11
|
|
137
|
3
|
|
|
|
|
3074
|
while (@sections) { |
138
|
8
|
|
|
|
|
15
|
my ($section) = shift @sections; |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
# Special case for Dzil |
141
|
8
|
100
|
50
|
|
|
35
|
if ( '_' eq ( $section->{name} || q[] ) ) { |
142
|
3
|
|
|
|
|
17
|
$self->_register_plugin_prereq( q[Dist::Zilla], $section->{lines} ); |
143
|
3
|
|
|
|
|
7
|
next; |
144
|
|
|
|
|
|
|
} |
145
|
5
|
|
|
|
|
31
|
my $package_expanded = Dist::Zilla::Util->expand_config_package_name( $section->{package} ); |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
# Standard plugin. |
148
|
5
|
100
|
|
|
|
331
|
if ( $section->{package} !~ /\A\@/msx ) { |
149
|
4
|
|
|
|
|
10
|
$self->_register_plugin_prereq( $package_expanded, $section->{lines} ); |
150
|
4
|
|
|
|
|
8
|
next; |
151
|
|
|
|
|
|
|
} |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
# Bundle |
154
|
|
|
|
|
|
|
# TODO: Maybe register the bundle itself? |
155
|
1
|
50
|
|
|
|
34
|
next if exists $self->_exclude_hash->{$package_expanded}; |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
# Handle bundle |
158
|
1
|
|
|
|
|
11
|
my $bundle = Dist::Zilla::Util::BundleInfo->new( |
159
|
|
|
|
|
|
|
bundle_name => $section->{package}, |
160
|
|
|
|
|
|
|
bundle_payload => $section->{lines}, |
161
|
|
|
|
|
|
|
); |
162
|
|
|
|
|
|
|
|
163
|
1
|
|
|
|
|
1394
|
for my $plugin ( $bundle->plugins ) { |
164
|
2
|
|
|
|
|
6689
|
$self->_register_plugin_prereq( $plugin->module, [ $plugin->payload_list ] ); |
165
|
|
|
|
|
|
|
} |
166
|
|
|
|
|
|
|
} |
167
|
3
|
|
|
|
|
82
|
return $self->zilla->prereqs; |
168
|
|
|
|
|
|
|
} |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
171
|
4
|
|
|
4
|
|
26
|
no Moose; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
36
|
|
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
1; |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
__END__ |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
=pod |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
=encoding UTF-8 |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
=head1 NAME |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
Dist::Zilla::Plugin::Prereqs::Plugins - Add all Dist::Zilla plugins presently in use as prerequisites. |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
=head1 VERSION |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
version 1.003002 |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
=head1 SYNOPSIS |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
[Prereqs::Plugins] |
192
|
|
|
|
|
|
|
; all plugins are now develop.requires deps |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
[Prereqs::Plugins] |
195
|
|
|
|
|
|
|
phase = runtime ; all plugins are now runtime.requires deps |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
=head1 DESCRIPTION |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
This is mostly because I am lazy, and the lengthy list of hand-updated dependencies |
200
|
|
|
|
|
|
|
on my C<@Author::> bundle started to get overwhelming, and I'd periodically miss something. |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
This module is kinda C<AutoPrereqs>y, but in ways that I can't imagine being plausible with |
203
|
|
|
|
|
|
|
a generic C<AutoPrereqs> tool, at least, not without requiring some nasty re-implementation |
204
|
|
|
|
|
|
|
of how C<dist.ini> is parsed. |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
=head1 METHODS |
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
=head2 C<mvp_multivalue_args> |
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
The list of attributes that can be specified multiple times |
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
exclude |
213
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
=head2 C<register_prereqs> |
215
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
See L<<< C<< Dist::Zilla::Role::B<PrereqSource> >>|Dist::Zilla::Role::PrereqSource >>> |
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
=head2 C<phase> |
221
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
The target installation phase to inject into: |
223
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
=over 4 |
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
=item * C<runtime> |
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
=item * C<configure> |
229
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
=item * C<build> |
231
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
=item * C<test> |
233
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
=item * C<develop> |
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
=back |
237
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
=head2 C<relation> |
239
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
The type of dependency relation to create: |
241
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
=over 4 |
243
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
=item * C<requires> |
245
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
=item * C<recommends> |
247
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
=item * C<suggests> |
249
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
=item * C<conflicts> |
251
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
Though think incredibly hard before using this last one ;) |
253
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
=back |
255
|
|
|
|
|
|
|
|
256
|
|
|
|
|
|
|
=head2 C<exclude> |
257
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
Specify anything you want excluded here. |
259
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
May Be specified multiple times. |
261
|
|
|
|
|
|
|
|
262
|
|
|
|
|
|
|
[Prereqs::Plugins] |
263
|
|
|
|
|
|
|
exclude = Some::Module::Thingy |
264
|
|
|
|
|
|
|
exclude = Some::Other::Module::Thingy |
265
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
=head1 PRIVATE ATTRIBUTES |
267
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
=head2 C<_exclude_hash> |
269
|
|
|
|
|
|
|
|
270
|
|
|
|
|
|
|
=head1 PRIVATE METHODS |
271
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
=head2 C<_build__exclude_hash> |
273
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
=head1 LIMITATIONS |
275
|
|
|
|
|
|
|
|
276
|
|
|
|
|
|
|
=over 4 |
277
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
=item * This module will B<NOT> report C<@Bundles> as dependencies at present. |
279
|
|
|
|
|
|
|
|
280
|
|
|
|
|
|
|
=item * This module will B<NOT> I<necessarily> include B<ALL> dependencies, but is only intended to include the majority of them. |
281
|
|
|
|
|
|
|
|
282
|
|
|
|
|
|
|
=item * This module will not report I<injected> dependencies, only dependencies that can be discovered from the parse tree directly, or from the return values of any indicated bundles. |
283
|
|
|
|
|
|
|
|
284
|
|
|
|
|
|
|
=back |
285
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
=head1 AUTHOR |
287
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
Kent Fredric <kentnl@cpan.org> |
289
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
291
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
This software is copyright (c) 2015 by Kent Fredric <kentfredric@gmail.com>. |
293
|
|
|
|
|
|
|
|
294
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
295
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
296
|
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
=cut |