From a5130824dea64200e28fd3a2886016ac1001b1d0 Mon Sep 17 00:00:00 2001 From: Samuel Giddins Date: Sat, 10 Mar 2018 15:41:51 -0800 Subject: Use Bundler.rubygems.inflate instead of the Gem::Util method directly --- lib/bundler/fetcher.rb | 4 ++-- lib/bundler/fetcher/index.rb | 4 ++-- spec/install/gems/resolving_spec.rb | 2 +- spec/support/artifice/compact_index.rb | 2 +- spec/support/artifice/endpoint.rb | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/bundler/fetcher.rb b/lib/bundler/fetcher.rb index 3538b668fa..444778b36b 100644 --- a/lib/bundler/fetcher.rb +++ b/lib/bundler/fetcher.rb @@ -96,11 +96,11 @@ module Bundler uri = URI.parse("#{remote_uri}#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}.rz") if uri.scheme == "file" - Bundler.load_marshal Gem::Util.inflate(Gem.read_binary(uri.path)) + Bundler.load_marshal Bundler.rubygems.inflate(Gem.read_binary(uri.path)) elsif cached_spec_path = gemspec_cached_path(spec_file_name) Bundler.load_gemspec(cached_spec_path) else - Bundler.load_marshal Gem::Util.inflate(downloader.fetch(uri).body) + Bundler.load_marshal Bundler.rubygems.inflate(downloader.fetch(uri).body) end rescue MarshalError raise HTTPError, "Gemspec #{spec} contained invalid data.\n" \ diff --git a/lib/bundler/fetcher/index.rb b/lib/bundler/fetcher/index.rb index 19b37ee548..1a8064624d 100644 --- a/lib/bundler/fetcher/index.rb +++ b/lib/bundler/fetcher/index.rb @@ -29,11 +29,11 @@ module Bundler uri = URI.parse("#{remote_uri}#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}.rz") if uri.scheme == "file" - Bundler.load_marshal Gem::Util.inflate(Gem.read_binary(uri.path)) + Bundler.load_marshal Bundler.rubygems.inflate(Gem.read_binary(uri.path)) elsif cached_spec_path = gemspec_cached_path(spec_file_name) Bundler.load_gemspec(cached_spec_path) else - Bundler.load_marshal Gem::Util.inflate(downloader.fetch(uri).body) + Bundler.load_marshal Bundler.rubygems.inflate(downloader.fetch(uri).body) end rescue MarshalError raise HTTPError, "Gemspec #{spec} contained invalid data.\n" \ diff --git a/spec/install/gems/resolving_spec.rb b/spec/install/gems/resolving_spec.rb index cf9f19980a..2925542d86 100644 --- a/spec/install/gems/resolving_spec.rb +++ b/spec/install/gems/resolving_spec.rb @@ -22,7 +22,7 @@ RSpec.describe "bundle install with install-time dependencies" do build_repo2 path = "#{gem_repo2}/#{Gem::MARSHAL_SPEC_DIR}/actionpack-2.3.2.gemspec.rz" - spec = Marshal.load(Gem::Util.inflate(File.read(path))) + spec = Marshal.load(Bundler.rubygems.inflate(File.read(path))) spec.dependencies.each do |d| d.instance_variable_set(:@type, :fail) end diff --git a/spec/support/artifice/compact_index.rb b/spec/support/artifice/compact_index.rb index d59f59831b..38559e2e23 100644 --- a/spec/support/artifice/compact_index.rb +++ b/spec/support/artifice/compact_index.rb @@ -10,7 +10,7 @@ class CompactIndexAPI < Endpoint def load_spec(name, version, platform, gem_repo) full_name = "#{name}-#{version}" full_name += "-#{platform}" if platform != "ruby" - Marshal.load(Gem::Util.inflate(File.open(gem_repo.join("quick/Marshal.4.8/#{full_name}.gemspec.rz")).read)) + Marshal.load(Bundler.rubygems.inflate(File.open(gem_repo.join("quick/Marshal.4.8/#{full_name}.gemspec.rz")).read)) end def etag_response diff --git a/spec/support/artifice/endpoint.rb b/spec/support/artifice/endpoint.rb index 84dbcfd345..9a0cfae8a2 100644 --- a/spec/support/artifice/endpoint.rb +++ b/spec/support/artifice/endpoint.rb @@ -68,7 +68,7 @@ class Endpoint < Sinatra::Base def load_spec(name, version, platform, gem_repo) full_name = "#{name}-#{version}" full_name += "-#{platform}" if platform != "ruby" - Marshal.load(Gem::Util.inflate(File.open(gem_repo.join("quick/Marshal.4.8/#{full_name}.gemspec.rz")).read)) + Marshal.load(Bundler.rubygems.inflate(File.open(gem_repo.join("quick/Marshal.4.8/#{full_name}.gemspec.rz")).read)) end end -- cgit v1.2.1