diff options
author | Colby Swandale <hello@colby.fyi> | 2018-07-16 23:11:56 +1000 |
---|---|---|
committer | Colby Swandale <hello@colby.fyi> | 2018-07-17 00:31:15 +1000 |
commit | 9f672b9c946df83cee2720a0ecd4c1b7859cb17a (patch) | |
tree | 72a4d67555c3d6db9507950a3ddf3519c4853175 | |
parent | 11bac37225abd3e0dee8e9ea18cf16d68d610a80 (diff) | |
download | bundler-9f672b9c946df83cee2720a0ecd4c1b7859cb17a.tar.gz |
remove any bundler gemspec in travis-ci that rvm installs
-rw-r--r-- | spec/spec_helper.rb | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index e50be54f6f..90a88fac5b 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -28,12 +28,16 @@ require "bundler/vendored_fileutils" require "uri" require "digest" -# Delete any copies of Bundler that have been dumped into site_ruby without -# a gemspec. RubyGems cannot manage that Bundler, and so our tricks to make -# sure that the correct version of Bundler loads will stop working. +# Delete the default copy of Bundler that RVM installs for us when running in CI require "fileutils" -Dir.glob(File.join(RbConfig::CONFIG["sitelibdir"], "bundler*")).each do |file| - FileUtils.rm_rf(file) +if ENV.select {|k, _v| k =~ /TRAVIS/ }.any? && Gem::Version.new(Gem::VERSION) > Gem::Version.new("2.0") + Dir.glob(File.join(Gem::Specification.default_specifications_dir, "bundler*.gemspec")).each do |file| + FileUtils.rm_rf(file) + end + + Dir.glob(File.join(RbConfig::CONFIG["sitelibdir"], "bundler*")).each do |file| + FileUtils.rm_rf(file) + end end if File.expand_path(__FILE__) =~ %r{([^\w/\.-])} |