Skip to content

Commit

Permalink
Add missing requires
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
deivid-rodriguez committed Oct 21, 2021
1 parent 13b933f commit 8bedae4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bundler/lib/bundler/rubygems_integration.rb
Expand Up @@ -500,6 +500,7 @@ def plain_specs=(specs)
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
Expand All @@ -518,6 +519,7 @@ def fetch_all_remote_specs(remote)
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
Expand Down

0 comments on commit 8bedae4

Please sign in to comment.