summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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