summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBundlerbot <bot@bundler.io>2019-12-17 20:52:51 +0000
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-12-17 22:34:45 +0100
commit56939f62ec1f2e13c58267b8629e965891f6b252 (patch)
tree121edda0cc195d652352fea0f3450428e65b12e8
parent47b79c3cc15a2fbf2e0ba2ee6c9ed403cd506510 (diff)
downloadbundler-56939f62ec1f2e13c58267b8629e965891f6b252.tar.gz
Merge #7498
7498: Add compatibility methods for `rubygems-bundler` gem r=deivid-rodriguez a=deivid-rodriguez ### What was the end-user problem that led to this PR? The problem was that `bundler install` on a `ruby` installation using `rvm` is broken by default. ### What was your diagnosis of the problem? My diagnosis was that during 2.1.0 development phase I removed some stuff I thought it was internal and nobody would be using. ### What is your fix for the problem, implemented in this PR? My fix is to restore a minimal compatibility layer so that this stuff works again. ### Why did you choose this fix out of the possible options? I chose this fix because I think this is the minimum set of additions that gets stuff working again. Fixes #7488. Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net> (cherry picked from commit f3f34bc5e62c513190f7608edab5818414ee9669)
-rw-r--r--.travis.yml3
-rw-r--r--Rakefile9
-rw-r--r--lib/bundler/rubygems_integration.rb8
3 files changed, 19 insertions, 1 deletions
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 eb37dffd9a..4fd9a5179a 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"
@@ -123,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 bb63209632..88fcd4d9e0 100644
--- a/lib/bundler/rubygems_integration.rb
+++ b/lib/bundler/rubygems_integration.rb
@@ -525,6 +525,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