summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThe Bundler Bot <bot@bundler.io>2018-07-12 09:42:50 +0000
committerThe Bundler Bot <bot@bundler.io>2018-07-12 09:42:50 +0000
commit8d53c82ab384a18ce0da0524fcbef275ce4683df (patch)
tree0ecee78a52d23fcb383ad6d63848ca94f9a1d32f
parent0c6048a47014bfb3485521c066a765960d8dcc10 (diff)
parentb998ee59492d84ed380ec77385f2687d1f64ea7b (diff)
downloadbundler-8d53c82ab384a18ce0da0524fcbef275ce4683df.tar.gz
Auto merge of #6624 - bundler:no-document, r=colby-swandale
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. * https://github.com/rubygems/rubygems/pull/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.
-rw-r--r--Rakefile2
-rw-r--r--spec/support/helpers.rb6
-rw-r--r--spec/support/rubygems_ext.rb6
3 files changed, 11 insertions, 3 deletions
diff --git a/Rakefile b/Rakefile
index 2f7db8253c..a4e4b19db2 100644
--- a/Rakefile
+++ b/Rakefile
@@ -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})
diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb
index fbc7cdadc6..e2b96f5d21 100644
--- a/spec/support/helpers.rb
+++ b/spec/support/helpers.rb
@@ -319,7 +319,11 @@ module Spec
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
diff --git a/spec/support/rubygems_ext.rb b/spec/support/rubygems_ext.rb
index 3627e5a71d..806933fe2f 100644
--- a/spec/support/rubygems_ext.rb
+++ b/spec/support/rubygems_ext.rb
@@ -59,7 +59,11 @@ module Spec
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