Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Auto merge of #6624 - bundler:no-document, r=colby-swandale
Browse files Browse the repository at this point in the history
Prefer to use `--no-document` option in spec

### What was the end-user problem that led to this PR?

RubyGems will remove `--no-ri` and `--no-rdoc` options at RubyGems 3.0. But bundler spec is also broken when removing them.

* rubygems/rubygems#2354
* https://travis-ci.org/rubygems/rubygems/jobs/402911887

### What is your fix for the problem, implemented in this PR?

To use --no-document option after RubyGems 2.0.
  • Loading branch information
bundlerbot committed Jul 12, 2018
2 parents 0c6048a + b998ee5 commit 8d53c82
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace :spec do
sh %(#{Gem.ruby} -S gem #{gem_install_command})
end
else
gem_install_command = "install --no-ri --no-rdoc --conservative " + deps.sort_by {|name, _| name }.map do |name, version|
gem_install_command = "install --no-document --conservative " + deps.sort_by {|name, _| name }.map do |name, version|
"'#{name}:#{version}'"
end.join(" ")
sh %(#{Gem.ruby} -S gem #{gem_install_command})
Expand Down
6 changes: 5 additions & 1 deletion spec/support/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,11 @@ def install_gems(*gems)

raise "OMG `#{path}` does not exist!" unless File.exist?(path)

gem_command! :install, "--no-rdoc --no-ri --ignore-dependencies '#{path}'"
if Gem::VERSION < "2.0.0"
gem_command! :install, "--no-rdoc --no-ri --ignore-dependencies '#{path}'"
else
gem_command! :install, "--no-document --ignore-dependencies '#{path}'"
end
bundler_path && bundler_path.rmtree
end
end
Expand Down
6 changes: 5 additions & 1 deletion spec/support/rubygems_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ def self.install_gems(gems)
no_reqs.map!(&:first)
reqs.map! {|name, req| "'#{name}:#{req}'" }
deps = reqs.concat(no_reqs).join(" ")
cmd = "gem install #{deps} --no-rdoc --no-ri --conservative"
cmd = if Gem::VERSION < "2.0.0"
"gem install #{deps} --no-rdoc --no-ri --conservative"
else
"gem install #{deps} --no-document --conservative"
end
puts cmd
system(cmd) || raise("Installing gems #{deps} for the tests to use failed!")
end
Expand Down

0 comments on commit 8d53c82

Please sign in to comment.