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

ruby-changes:69419

From: David <ko1@a...>
Date: Mon, 25 Oct 2021 20:55:07 +0900 (JST)
Subject: [ruby-changes:69419] 38542cfffc (master): [rubygems/rubygems] Extract a `default_cache_path` helper

https://git.ruby-lang.org/ruby.git/commit/?id=38542cfffc

From 38542cfffc02216eb9de7e470f3e1574dee1aeea Mon Sep 17 00:00:00 2001
From: David Rodriguez <deivid.rodriguez@r...>
Date: Wed, 20 Oct 2021 19:02:21 +0200
Subject: [rubygems/rubygems] Extract a `default_cache_path` helper

https://github.com/rubygems/rubygems/commit/8319305d58
---
 lib/bundler/source/rubygems.rb | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb
index dca1d725771..fb5234cbb4c 100644
--- a/lib/bundler/source/rubygems.rb
+++ b/lib/bundler/source/rubygems.rb
@@ -461,7 +461,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/source/rubygems.rb#L461
 
         download_path = requires_sudo? ? Bundler.tmp(spec.full_name) : rubygems_dir
         download_cache_path = "#{download_path}/cache"
-        gem_path = "#{rubygems_dir}/cache/#{spec.full_name}.gem"
+        gem_path = "#{default_cache_path}/#{spec.full_name}.gem"
 
         SharedHelpers.filesystem_access(download_cache_path) do |p|
           FileUtils.mkdir_p(p)
@@ -469,7 +469,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/source/rubygems.rb#L469
         download_gem(spec, download_cache_path)
 
         if requires_sudo?
-          SharedHelpers.filesystem_access("#{rubygems_dir}/cache") do |p|
+          SharedHelpers.filesystem_access(default_cache_path) do |p|
             Bundler.mkdir_p(p)
           end
           Bundler.sudo "mv #{download_cache_path}/#{spec.full_name}.gem #{gem_path}"
@@ -492,6 +492,10 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/source/rubygems.rb#L492
         Bundler.rubygems.gem_dir
       end
 
+      def default_cache_path
+        "#{rubygems_dir}/cache"
+      end
+
       def cache_path
         Bundler.app_cache
       end
-- 
cgit v1.2.1


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

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