summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-04-11 10:31:56 +0200
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-04-12 18:27:04 +0200
commit0df0cc4662cceeaddeade53601fca40685688f48 (patch)
tree3dc1a333c45587238b2812a7e72e8819a9b11d88
parentdef98563027149a216f44b157e865549fa25d283 (diff)
downloadbundler-allow_local_install_on_jruby.tar.gz
Mock `man:build` task on jrubyallow_local_install_on_jruby
So that `rake install:local` at least works.
-rw-r--r--Rakefile98
1 files changed, 51 insertions, 47 deletions
diff --git a/Rakefile b/Rakefile
index 8b6541a9c9..2fcdbff816 100644
--- a/Rakefile
+++ b/Rakefile
@@ -199,68 +199,72 @@ task :rubocop do
end
namespace :man do
- ronn_dep = development_dependencies.find do |dep|
- dep.name == "ronn"
- end
-
- ronn_requirement = ronn_dep.requirement.to_s
+ if RUBY_ENGINE == "jruby"
+ task(:build) {}
+ else
+ ronn_dep = development_dependencies.find do |dep|
+ dep.name == "ronn"
+ end
- begin
- gem "ronn", ronn_requirement
+ ronn_requirement = ronn_dep.requirement.to_s
- require "ronn"
- rescue LoadError
- task(:build) { abort "We couln't activate ronn (#{ronn_requirement}). Try `gem install ronn:'#{ronn_requirement}'` to be able to build the help pages" }
- else
- directory "man"
+ begin
+ gem "ronn", ronn_requirement
- index = []
- sources = Dir["man/*.ronn"].map {|f| File.basename(f, ".ronn") }
- sources.map do |basename|
- ronn = "man/#{basename}.ronn"
- manual_section = ".1" unless basename =~ /\.(\d+)\Z/
- roff = "man/#{basename}#{manual_section}"
+ require "ronn"
+ rescue LoadError
+ task(:build) { abort "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 << [ronn, File.basename(roff)]
+ index = []
+ sources = Dir["man/*.ronn"].map {|f| File.basename(f, ".ronn") }
+ sources.map do |basename|
+ ronn = "man/#{basename}.ronn"
+ manual_section = ".1" unless basename =~ /\.(\d+)\Z/
+ roff = "man/#{basename}#{manual_section}"
- file roff => ["man", ronn] do
- sh "#{Gem.ruby} -S ronn --roff --pipe #{ronn} > #{roff}"
- end
+ index << [ronn, File.basename(roff)]
- file "#{roff}.txt" => roff do
- sh "groff -Wall -mtty-char -mandoc -Tascii #{roff} | col -b > #{roff}.txt"
- end
+ file roff => ["man", ronn] do
+ sh "#{Gem.ruby} -S ronn --roff --pipe #{ronn} > #{roff}"
+ end
- task :build_all_pages => "#{roff}.txt"
- end
+ file "#{roff}.txt" => roff do
+ sh "groff -Wall -mtty-char -mandoc -Tascii #{roff} | col -b > #{roff}.txt"
+ end
- file "index.txt" do
- index.map! do |(ronn, roff)|
- [File.read(ronn).split(" ").first, roff]
+ task :build_all_pages => "#{roff}.txt"
end
- index = index.sort_by(&:first)
- justification = index.map {|(n, _f)| n.length }.max + 4
- File.open("man/index.txt", "w") do |f|
- index.each do |name, filename|
- f << name.ljust(justification) << filename << "\n"
+
+ file "index.txt" do
+ index.map! do |(ronn, roff)|
+ [File.read(ronn).split(" ").first, roff]
+ end
+ index = index.sort_by(&:first)
+ justification = index.map {|(n, _f)| n.length }.max + 4
+ File.open("man/index.txt", "w") do |f|
+ index.each do |name, filename|
+ f << name.ljust(justification) << filename << "\n"
+ end
end
end
- end
- task :build_all_pages => "index.txt"
+ task :build_all_pages => "index.txt"
- task :clean do
- leftovers = Dir["man/*"].reject do |f|
- File.extname(f) == ".ronn"
+ task :clean do
+ leftovers = Dir["man/*"].reject do |f|
+ File.extname(f) == ".ronn"
+ end
+ rm leftovers if leftovers.any?
end
- rm leftovers if leftovers.any?
- end
- desc "Build the man pages"
- task :build => ["man:clean", "man:build_all_pages"]
+ desc "Build the man pages"
+ task :build => ["man:clean", "man:build_all_pages"]
- desc "Remove all built man pages"
- task :clobber do
- rm_rf "lib/bundler/man"
+ desc "Remove all built man pages"
+ task :clobber do
+ rm_rf "lib/bundler/man"
+ end
end
end
end