diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-03-04 18:22:11 +0100 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-03-20 14:22:38 +0100 |
commit | 5d196ef0eaa2f9ff64dcc648cc6d7a3ad701731e (patch) | |
tree | 7f008e4c273964966d66fd4021cc3e7d133b4760 | |
parent | 2fc242800a6239b9720856ba24277536737ca4d5 (diff) | |
download | bundler-5d196ef0eaa2f9ff64dcc648cc6d7a3ad701731e.tar.gz |
Improve `ronn` activation
Previously having another gem with a `ronn` executable would silently
work and fail later with a cryptic error. Now we activate the proper
version, and give a proper error if it fails.
-rw-r--r-- | Rakefile | 22 |
1 files changed, 14 insertions, 8 deletions
@@ -227,10 +227,21 @@ task :rubocop do sh("bin/rubocop --parallel") end -begin - require "ronn" +namespace :man do + ronn_dep = bundler_spec.development_dependencies.find do |dep| + dep.name == "ronn" + end + + ronn_requirement = ronn_dep.requirement.to_s - namespace :man do + begin + gem "ronn", ronn_requirement + + require "ronn" + rescue LoadError + task(:require) { abort "We couln't activate ronn (#{ronn_requirement}). Try `gem install ronn:'#{ronn_requirement}'` to be able to release!" } + task(:build) { warn "We couln't activate ronn (#{ronn_requirement}). Try `gem install ronn:'#{ronn_requirement}'` to be able to build the help pages" } + else directory "man" index = [] @@ -284,11 +295,6 @@ begin task(:require) {} end -rescue LoadError - namespace :man do - task(:require) { abort "Install the ronn gem to be able to release!" } - task(:build) { warn "Install the ronn gem to build the help pages" } - end end begin |