Skip to content

Commit b5af863

Browse files
committed
Example, how to use requires_by_perl on D::Z::PluginBundle::RJBS
1 parent b29ca71 commit b5af863

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

cpanfile

+6-10
Original file line numberDiff line numberDiff line change
@@ -120,16 +120,12 @@ if ( "$]" >= 5.020 ) {
120120
requires 'Dist::Zilla::PluginBundle::DROLSKY';
121121
requires 'Dist::Zilla::PluginBundle::Milla';
122122

123-
if ( "$]" < 5.026 ) {
124-
requires 'Dist::Zilla::PluginBundle::RJBS', '==5.023';
125-
}
126-
elsif ( "$]" < 5.034 ) {
127-
requires 'Dist::Zilla::PluginBundle::RJBS', '==5.025';
128-
}
129-
else {
130-
# 5.028 requires v5.36 whereas newer versions only v5.34
131-
requires 'Dist::Zilla::PluginBundle::RJBS', '>5.028';
132-
}
123+
requires_by_perl 'Dist::Zilla::PluginBundle::RJBS',
124+
prior 5.020 => do_not_install,
125+
prior 5.026 => '==5.023',
126+
prior 5.034 => '==5.025',
127+
otherwise '>5.028' # 5.028 requires v5.36 whereas following versions only v5.34, so omit it
128+
;
133129

134130
requires 'Dist::Zilla::PluginBundle::Starter::Git';
135131
requires 'Dist::Zilla::Plugin::CheckChangeLog';

0 commit comments

Comments
 (0)