diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2022-03-26 09:34:25 +0100 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2022-06-11 18:43:28 +0900 |
commit | 7f9eb888a3f86e286b5bc51705716b22ad02854c (patch) | |
tree | cf502bc09564edadea9d6d4ca041375e4b95117f /lib/bundler/rubygems_integration.rb | |
parent | 965c314e34d05b196c8e079f868e79633076ad4c (diff) | |
download | ruby-7f9eb888a3f86e286b5bc51705716b22ad02854c.tar.gz |
[rubygems/rubygems] Reuse package from the installer for extracting the specification
Previously we would instantiate two different packages and extract the
specification from the package twice for each gem installed. We can
reuse the installer for this so that we just need to do it once.
https://github.com/rubygems/rubygems/commit/e454f850b1
Diffstat (limited to 'lib/bundler/rubygems_integration.rb')
-rw-r--r-- | lib/bundler/rubygems_integration.rb | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index bf93c57e0b..08af0610c6 100644 --- a/lib/bundler/rubygems_integration.rb +++ b/lib/bundler/rubygems_integration.rb @@ -203,8 +203,9 @@ module Bundler EXT_LOCK end - def spec_from_gem(path, policy = nil) - gem_from_path(path, security_policies[policy]).spec + def spec_from_gem(path) + require "rubygems/package" + Gem::Package.new(path).spec end def build_gem(gem_dir, spec) @@ -498,13 +499,6 @@ module Bundler Gem::RemoteFetcher.new(proxy) end - def gem_from_path(path, policy = nil) - require "rubygems/package" - p = Gem::Package.new(path) - p.security_policy = policy if policy - p - end - def build(spec, skip_validation = false) require "rubygems/package" Gem::Package.build(spec, skip_validation) |