From a03dd65152775c93e939aedff58c09827d72357f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Tue, 17 Dec 2019 12:42:06 +0100 Subject: Avoid some redefinition warnings Sometimes `rake` will load the default version of `bundler` and then the `Rakefile` will change the LOAD_PATH and require the same code again using the version of `bundler` in `lib`. The only `bundler` code that gets used by the `Rakefile` is `bundler/gem_tasks`. This is used, for example, for releasing. I think it's fine to use an installed version of `bundler` for this in any case., --- Rakefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Rakefile b/Rakefile index eb37dffd9a..841563bc79 100644 --- a/Rakefile +++ b/Rakefile @@ -1,6 +1,5 @@ # frozen_string_literal: true -$:.unshift File.expand_path("../lib", __FILE__) require "benchmark" require_relative "spec/support/rubygems_ext" -- cgit v1.2.1 From a9e819aa5a4021c8e29dcdc8da3aae34963bdbfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Tue, 17 Dec 2019 12:11:24 +0100 Subject: Add compatibility methods for `rubygems-bundler` gem Hopefully `rvm` won't install this gem by default, but for now I'm adding the following two methods for compatibility with it. --- .travis.yml | 3 +++ Rakefile | 8 ++++++++ lib/bundler/rubygems_integration.rb | 8 ++++++++ 3 files changed, 19 insertions(+) diff --git a/.travis.yml b/.travis.yml index 47e775cba7..e7828fd4af 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,6 +48,9 @@ jobs: - rvm: 2.6.5 script: bin/rake rubocop stage: linting + - rvm: 2.6.5 + script: bin/rake check_rvm_integration + stage: linting # Ruby 2.3 also tested in 2.x mode - rvm: 2.3.8 env: RGV=master diff --git a/Rakefile b/Rakefile index 841563bc79..4fd9a5179a 100644 --- a/Rakefile +++ b/Rakefile @@ -122,6 +122,14 @@ task :rubocop do sh("bin/rubocop --parallel") end +desc "Check RVM integration" +task :check_rvm_integration do + # The rubygems-bundler gem is installed by RVM by default and it could easily + # break when we change bundler. Make sure that binstubs still run with it + # installed. + sh("bin/rake install && gem install rubygems-bundler && rake -T") +end + namespace :man do if RUBY_ENGINE == "jruby" task(:build) {} diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index 3ca1831dee..17f2d7d9fa 100644 --- a/lib/bundler/rubygems_integration.rb +++ b/lib/bundler/rubygems_integration.rb @@ -496,6 +496,14 @@ module Bundler end end + def plain_specs + Gem::Specification._all + end + + def plain_specs=(specs) + Gem::Specification.all = specs + end + def fetch_specs(remote, name) path = remote.uri.to_s + "#{name}.#{Gem.marshal_version}.gz" fetcher = gem_remote_fetcher -- cgit v1.2.1