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

ruby-changes:69425

From: David <ko1@a...>
Date: Mon, 25 Oct 2021 20:55:08 +0900 (JST)
Subject: [ruby-changes:69425] 9b1b171866 (master): [rubygems/rubygems] Use `Gem::Specification#file_name` consistently

https://git.ruby-lang.org/ruby.git/commit/?id=9b1b171866

From 9b1b1718666ab73bb2a9200a074b8c836cde8b30 Mon Sep 17 00:00:00 2001
From: David Rodriguez <deivid.rodriguez@r...>
Date: Wed, 20 Oct 2021 19:27:06 +0200
Subject: [rubygems/rubygems] Use `Gem::Specification#file_name` consistently

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

diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb
index fb5234cbb4c..12b7a941f1d 100644
--- a/lib/bundler/source/rubygems.rb
+++ b/lib/bundler/source/rubygems.rb
@@ -238,7 +238,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/source/rubygems.rb#L238
         else
           cached_path = cached_gem(spec)
         end
-        raise GemNotFound, "Missing gem file '#{spec.full_name}.gem'." unless cached_path
+        raise GemNotFound, "Missing gem file '#{spec.file_name}'." unless cached_path
         return if File.dirname(cached_path) == Bundler.app_cache.to_s
         Bundler.ui.info "  * #{File.basename(cached_path)}"
         FileUtils.cp(cached_path, Bundler.app_cache(custom_path))
@@ -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 = "#{default_cache_path}/#{spec.full_name}.gem"
+        gem_path = "#{default_cache_path}/#{spec.file_name}"
 
         SharedHelpers.filesystem_access(download_cache_path) do |p|
           FileUtils.mkdir_p(p)
@@ -472,7 +472,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/source/rubygems.rb#L472
           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}"
+          Bundler.sudo "mv #{download_cache_path}/#{spec.file_name} #{gem_path}"
         end
 
         gem_path
@@ -512,7 +512,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/source/rubygems.rb#L512
       #         the local directory the .gem will end up in.
       #
       def download_gem(spec, download_cache_path)
-        local_path = File.join(download_cache_path, "#{spec.full_name}.gem")
+        local_path = File.join(download_cache_path, spec.file_name)
 
         if (cache_path = download_cache_path(spec)) && cache_path.file?
           SharedHelpers.filesystem_access(local_path) do
-- 
cgit v1.2.1


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

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