From 1239c8c7818e067502e2df2b300be948d385d173 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Thu, 14 Mar 2019 17:41:22 +0100 Subject: [PATCH] Opt in to the new public method if available --- lib/bundler/rubygems_integration.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index 865bbc1f762..79ff277bbe3 100644 --- a/lib/bundler/rubygems_integration.rb +++ b/lib/bundler/rubygems_integration.rb @@ -512,7 +512,7 @@ def replace_entrypoints(specs) h end - Gem::Specification.send(:default_stubs, "*.gemspec").each do |stub| + Bundler.rubygems.default_stubs.each do |stub| default_spec = stub.to_spec default_spec_name = default_spec.name next if specs_by_name.key?(default_spec_name) @@ -857,6 +857,16 @@ def find_name(name) end end + if Gem::Specification.respond_to?(:default_stubs) + def default_stubs + Gem::Specification.default_stubs("*.gemspec") + end + else + def default_stubs + Gem::Specification.send(:default_stubs, "*.gemspec") + end + end + def use_gemdeps(gemfile) ENV["BUNDLE_GEMFILE"] ||= File.expand_path(gemfile) require "bundler/gemdeps"