summaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-03-04 18:22:11 +0100
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-03-20 14:22:38 +0100
commit5d196ef0eaa2f9ff64dcc648cc6d7a3ad701731e (patch)
tree7f008e4c273964966d66fd4021cc3e7d133b4760 /Rakefile
parent2fc242800a6239b9720856ba24277536737ca4d5 (diff)
downloadbundler-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.
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile22
1 files changed, 14 insertions, 8 deletions
diff --git a/Rakefile b/Rakefile
index 530e1249f5..e5b318858e 100644
--- a/Rakefile
+++ b/Rakefile
@@ -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