[前][次][番号順一覧][スレッド一覧]

ruby-changes:69421

From: David <ko1@a...>
Date: Mon, 25 Oct 2021 20:55:07 +0900 (JST)
Subject: [ruby-changes:69421] 7b821bc9b5 (master): [rubygems/rubygems] Add missing requires

https://git.ruby-lang.org/ruby.git/commit/?id=7b821bc9b5

From 7b821bc9b5c4505d4202536d6cbaa6df60c7e737 Mon Sep 17 00:00:00 2001
From: David Rodriguez <deivid.rodriguez@r...>
Date: Wed, 20 Oct 2021 20:58:51 +0200
Subject: [rubygems/rubygems] Add missing requires

These methods rescue a constant defined by `rubygems/remote_fetcher`,
so they should technically require it.

The require is provided by `gem_remote_fetcher` anyways but I was
running a unit spec that stubs that method, so I was getting an
undefined constant error hiding another error.

https://github.com/rubygems/rubygems/commit/8bedae4034
---
 lib/bundler/rubygems_integration.rb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb
index ba4317775ed..81050a6e58f 100644
--- a/lib/bundler/rubygems_integration.rb
+++ b/lib/bundler/rubygems_integration.rb
@@ -488,6 +488,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/rubygems_integration.rb#L488
     end
 
     def fetch_specs(remote, name)
+      require "rubygems/remote_fetcher"
       path = remote.uri.to_s + "#{name}.#{Gem.marshal_version}.gz"
       fetcher = gem_remote_fetcher
       fetcher.headers = { "X-Gemfile-Source" => remote.original_uri.to_s } if remote.original_uri
@@ -506,6 +507,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/rubygems_integration.rb#L507
     end
 
     def download_gem(spec, uri, path)
+      require "rubygems/remote_fetcher"
       uri = Bundler.settings.mirror_for(uri)
       fetcher = gem_remote_fetcher
       fetcher.headers = { "X-Gemfile-Source" => spec.remote.original_uri.to_s } if spec.remote.original_uri
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]