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

ruby-changes:72138

From: David <ko1@a...>
Date: Sat, 11 Jun 2022 18:43:56 +0900 (JST)
Subject: [ruby-changes:72138] 52cc76d134 (master): [rubygems/rubygems] `Gem::Specification.loaded_from` is already set by the installer

https://git.ruby-lang.org/ruby.git/commit/?id=52cc76d134

From 52cc76d134e963a9943d0379f5bc2991a01f7d1e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...>
Date: Wed, 8 Jun 2022 22:29:37 +0200
Subject: [rubygems/rubygems] `Gem::Specification.loaded_from` is already set
 by the installer

https://github.com/rubygems/rubygems/commit/796eebfdbf
---
 lib/bundler/source/rubygems.rb | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb
index 55fde3ad3a..b5f7296243 100644
--- a/lib/bundler/source/rubygems.rb
+++ b/lib/bundler/source/rubygems.rb
@@ -139,13 +139,9 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/source/rubygems.rb#L139
         force = options[:force]
         ensure_builtin_gems_cached = options[:ensure_builtin_gems_cached]
 
-        if ensure_builtin_gems_cached && spec.default_gem?
-          if !cached_path(spec)
-            cached_built_in_gem(spec) unless spec.remote
-            force = true
-          else
-            spec.loaded_from = loaded_from(spec)
-          end
+        if ensure_builtin_gems_cached && spec.default_gem? && !cached_path(spec)
+          cached_built_in_gem(spec) unless spec.remote
+          force = true
         end
 
         if installed?(spec) && !force
@@ -201,6 +197,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/source/rubygems.rb#L197
           :bundler_extension_cache_path => extension_cache_path(spec)
         ).install
         spec.full_gem_path = installed_spec.full_gem_path
+        spec.loaded_from = installed_spec.loaded_from
 
         # SUDO HAX
         if requires_sudo?
@@ -226,8 +223,6 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/source/rubygems.rb#L223
             Bundler.sudo "cp -R #{install_path}/bin/#{exe} #{Bundler.system_bindir}/"
           end
         end
-        installed_spec.loaded_from = loaded_from(spec)
-        spec.loaded_from = loaded_from(spec)
 
         spec.post_install_message
       ensure
@@ -345,10 +340,6 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/source/rubygems.rb#L340
         end
       end
 
-      def loaded_from(spec)
-        "#{rubygems_dir}/specifications/#{spec.full_name}.gemspec"
-      end
-
       def cached_gem(spec)
         if spec.default_gem?
           cached_built_in_gem(spec)
-- 
cgit v1.2.1


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

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