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

ruby-changes:62452

From: David <ko1@a...>
Date: Fri, 31 Jul 2020 21:08:22 +0900 (JST)
Subject: [ruby-changes:62452] 985309ac38 (master): [rubygems/rubygems] Support PATH's using `File::ALT_SEPARATOR` in `Gem::Installer`

https://git.ruby-lang.org/ruby.git/commit/?id=985309ac38

From 985309ac38c212de327e419ad4a7bcf9e7b28267 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...>
Date: Tue, 14 Jul 2020 13:16:34 +0200
Subject: [rubygems/rubygems] Support PATH's using `File::ALT_SEPARATOR` in
 `Gem::Installer`

Co-authored-by: MSP-Greg <MSP-Greg@u...>

https://github.com/rubygems/rubygems/commit/710b969b60

diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb
index c9d87c5..0639672 100644
--- a/lib/rubygems/installer.rb
+++ b/lib/rubygems/installer.rb
@@ -707,6 +707,8 @@ class Gem::Installer https://github.com/ruby/ruby/blob/trunk/lib/rubygems/installer.rb#L707
     user_bin_dir = user_bin_dir.tr(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR
 
     path = ENV['PATH']
+    path = path.tr(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR
+
     if Gem.win_platform?
       path = path.downcase
       user_bin_dir = user_bin_dir.downcase
diff --git a/test/rubygems/test_gem_installer.rb b/test/rubygems/test_gem_installer.rb
index 766a4ee..49ecc54 100644
--- a/test/rubygems/test_gem_installer.rb
+++ b/test/rubygems/test_gem_installer.rb
@@ -207,6 +207,16 @@ gem 'other', version https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_installer.rb#L207
     end
 
     assert_empty @ui.error
+
+    return unless win_platform?
+
+    ENV['PATH'] = [orig_PATH, bin_dir.tr(File::SEPARATOR, File::ALT_SEPARATOR)].join(File::PATH_SEPARATOR)
+
+    use_ui @ui do
+      installer.check_that_user_bin_dir_is_in_path
+    end
+
+    assert_empty @ui.error
   ensure
     ENV['PATH'] = orig_PATH
   end
-- 
cgit v0.10.2


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

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