diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-12-06 13:25:31 +0100 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-12-06 23:52:10 +0100 |
commit | 34d7fa5462c50701cdae896d9cf004c050f5bfe2 (patch) | |
tree | 5f2eab9a716c6e1366d49e3857199fff8e123909 | |
parent | 25595896eb0f8dfd004d941093bf1d8f4a39aeeb (diff) | |
download | bundler-34d7fa5462c50701cdae896d9cf004c050f5bfe2.tar.gz |
Remove unnecessary parameter to `fetch_specs`
-rw-r--r-- | lib/bundler/rubygems_integration.rb | 10 | ||||
-rw-r--r-- | spec/bundler/rubygems_integration_spec.rb | 2 |
2 files changed, 5 insertions, 7 deletions
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index 9b23a5c4c8..0d4dc75dbd 100644 --- a/lib/bundler/rubygems_integration.rb +++ b/lib/bundler/rubygems_integration.rb @@ -502,8 +502,8 @@ module Bundler end end - def fetch_specs(source, remote, name) - path = source + "#{name}.#{Gem.marshal_version}.gz" + def fetch_specs(remote, name) + 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 string = fetcher.fetch_path(path) @@ -514,10 +514,8 @@ module Bundler end def fetch_all_remote_specs(remote) - source = remote.uri.is_a?(URI) ? remote.uri : URI.parse(source.to_s) - - specs = fetch_specs(source, remote, "specs") - pres = fetch_specs(source, remote, "prerelease_specs") || [] + specs = fetch_specs(remote, "specs") + pres = fetch_specs(remote, "prerelease_specs") || [] specs.concat(pres) end diff --git a/spec/bundler/rubygems_integration_spec.rb b/spec/bundler/rubygems_integration_spec.rb index 26cbaa630b..ce2b100088 100644 --- a/spec/bundler/rubygems_integration_spec.rb +++ b/spec/bundler/rubygems_integration_spec.rb @@ -67,7 +67,7 @@ RSpec.describe Bundler::RubygemsIntegration do end describe "#fetch_all_remote_specs" do - let(:uri) { URI("https://example.com") } + let(:uri) { "https://example.com" } let(:fetcher) { double("gem_remote_fetcher") } let(:specs_response) { Marshal.dump(["specs"]) } let(:prerelease_specs_response) { Marshal.dump(["prerelease_specs"]) } |