| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
1
|
|
|
1
|
|
1912462
|
use v5.10; |
|
|
1
|
|
|
|
|
4
|
|
|
|
1
|
|
|
|
|
54
|
|
|
2
|
1
|
|
|
1
|
|
4
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
33
|
|
|
3
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
62
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Dist::Zilla::Plugin::Prereqs::Floor; |
|
6
|
|
|
|
|
|
|
# ABSTRACT: Dist::Zilla plugin to set a minimum allowed version for prerequisites |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.001'; |
|
9
|
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
5
|
use Moose; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
9
|
|
|
11
|
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
5695
|
use Dist::Zilla 5; |
|
|
1
|
|
|
|
|
31
|
|
|
|
1
|
|
|
|
|
385
|
|
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
with 'Dist::Zilla::Role::PrereqSource'; |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
has _floor => ( |
|
17
|
|
|
|
|
|
|
is => 'ro', |
|
18
|
|
|
|
|
|
|
isa => 'HashRef', |
|
19
|
|
|
|
|
|
|
default => sub { {} }, |
|
20
|
|
|
|
|
|
|
); |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub BUILDARGS { |
|
23
|
1
|
|
|
1
|
1
|
2
|
my ( $class, @arg ) = @_; |
|
24
|
1
|
50
|
|
|
|
5
|
my %copy = ref $arg[0] ? %{ $arg[0] } : @arg; |
|
|
1
|
|
|
|
|
7
|
|
|
25
|
|
|
|
|
|
|
|
|
26
|
1
|
|
|
|
|
4
|
my $zilla = delete $copy{zilla}; |
|
27
|
1
|
|
|
|
|
2
|
my $name = delete $copy{plugin_name}; |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
return { |
|
30
|
1
|
|
|
|
|
34
|
zilla => $zilla, |
|
31
|
|
|
|
|
|
|
plugin_name => $name, |
|
32
|
|
|
|
|
|
|
_floor => \%copy, |
|
33
|
|
|
|
|
|
|
}; |
|
34
|
|
|
|
|
|
|
} |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub register_prereqs { |
|
37
|
1
|
|
|
1
|
0
|
353865
|
my ($self) = @_; |
|
38
|
|
|
|
|
|
|
|
|
39
|
1
|
|
|
|
|
6
|
$self->log("Checking module prerequisites against minimum floor"); |
|
40
|
|
|
|
|
|
|
|
|
41
|
1
|
|
|
|
|
421
|
my $zilla = $self->zilla; |
|
42
|
1
|
|
|
|
|
68
|
my $floor = $self->_floor; |
|
43
|
|
|
|
|
|
|
|
|
44
|
1
|
50
|
|
|
|
3
|
return unless %$floor; |
|
45
|
|
|
|
|
|
|
|
|
46
|
1
|
|
|
|
|
22
|
my $prereqs = $zilla->prereqs->cpan_meta_prereqs->as_string_hash; |
|
47
|
|
|
|
|
|
|
|
|
48
|
1
|
|
|
|
|
612
|
foreach my $phase ( sort keys %$prereqs ) { |
|
49
|
3
|
|
|
|
|
7
|
foreach my $rel ( sort keys %{ $prereqs->{$phase} } ) { |
|
|
3
|
|
|
|
|
8
|
|
|
50
|
4
|
|
|
|
|
210
|
foreach my $mod ( sort keys %{ $prereqs->{$phase}{$rel} } ) { |
|
|
4
|
|
|
|
|
40
|
|
|
51
|
8
|
50
|
|
|
|
365
|
next if $mod eq 'perl'; # obvious |
|
52
|
8
|
100
|
|
|
|
22
|
if ( my $ver = $floor->{$mod} ) { |
|
53
|
4
|
|
|
|
|
21
|
$self->log_debug("$phase/$rel: $mod minimum set to $ver"); |
|
54
|
4
|
|
|
|
|
1268
|
$self->zilla->register_prereqs( |
|
55
|
|
|
|
|
|
|
{ |
|
56
|
|
|
|
|
|
|
phase => $phase, |
|
57
|
|
|
|
|
|
|
type => $rel, |
|
58
|
|
|
|
|
|
|
}, |
|
59
|
|
|
|
|
|
|
$mod => $ver, |
|
60
|
|
|
|
|
|
|
); |
|
61
|
|
|
|
|
|
|
} |
|
62
|
|
|
|
|
|
|
} |
|
63
|
|
|
|
|
|
|
} |
|
64
|
|
|
|
|
|
|
} |
|
65
|
1
|
|
|
|
|
164
|
return; |
|
66
|
|
|
|
|
|
|
} |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
|
69
|
|
|
|
|
|
|
1; |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
# vim: ts=4 sts=4 sw=4 et tw=75: |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
__END__ |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=pod |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=encoding UTF-8 |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 NAME |
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
Dist::Zilla::Plugin::Prereqs::Floor - Dist::Zilla plugin to set a minimum allowed version for prerequisites |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head1 VERSION |
|
85
|
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
version 0.001 |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
; in dist.ini |
|
91
|
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
[Prereqs::Floor] |
|
93
|
|
|
|
|
|
|
File::Temp = 0.19 |
|
94
|
|
|
|
|
|
|
Test::More = 0.86 |
|
95
|
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
This prereq provider sets a minimum allowed version for the specified |
|
99
|
|
|
|
|
|
|
modules. |
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
If the module has been listed as a prerequisite for any phase ('runtime', |
|
102
|
|
|
|
|
|
|
'test', etc.) or type ('requires', 'recommends', etc.), the listed minimum |
|
103
|
|
|
|
|
|
|
version will be applied to that phase and type. |
|
104
|
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
The prereqs will B<only> be applied if they already exist. This will not |
|
106
|
|
|
|
|
|
|
add any new prerequisites. |
|
107
|
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
This prereq provider should run B<last>. Any prerequisites added after it |
|
109
|
|
|
|
|
|
|
runs won't be updated. |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=for Pod::Coverage BUILDARGS register_prereqs mvp_multivalue_args |
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
114
|
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=over 4 |
|
116
|
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=item * |
|
118
|
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
L<Prereqs::Upgrade|Dist::Zilla::Plugin::Prereqs::Upgrade> â similar concept with very flexible phase and type mapping, but harder to apply universally across all phases/types at once |
|
120
|
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=back |
|
122
|
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=for :stopwords cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan |
|
124
|
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=head1 SUPPORT |
|
126
|
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=head2 Bugs / Feature Requests |
|
128
|
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
Please report any bugs or feature requests through the issue tracker |
|
130
|
|
|
|
|
|
|
at L<https://github.com/dagolden/Dist-Zilla-Plugin-Prereqs-Floor/issues>. |
|
131
|
|
|
|
|
|
|
You will be notified automatically of any progress on your issue. |
|
132
|
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=head2 Source Code |
|
134
|
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
This is open source software. The code repository is available for |
|
136
|
|
|
|
|
|
|
public review and contribution under the terms of the license. |
|
137
|
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
L<https://github.com/dagolden/Dist-Zilla-Plugin-Prereqs-Floor> |
|
139
|
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
git clone https://github.com/dagolden/Dist-Zilla-Plugin-Prereqs-Floor.git |
|
141
|
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
=head1 AUTHOR |
|
143
|
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
David Golden <dagolden@cpan.org> |
|
145
|
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
147
|
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
This software is Copyright (c) 2015 by David Golden. |
|
149
|
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
This is free software, licensed under: |
|
151
|
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
The Apache License, Version 2.0, January 2004 |
|
153
|
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
=cut |