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

ruby-changes:60191

From: V=C3=ADt <ko1@a...>
Date: Wed, 26 Feb 2020 11:05:12 +0900 (JST)
Subject: [ruby-changes:60191] e087b029e5 (master): Use class variable `@src_dir` instead of local `path`.

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

From e087b029e54776afe2b120974932dd707fee6874 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@r...>
Date: Fri, 11 Oct 2019 17:56:28 +0200
Subject: Use class variable `@src_dir` instead of local `path`.

The local `path` variable does not provide any additional value and was
kept around just for clarity for easier review of the `extrac_files`
method move.

diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
index cbc7180..b6e75f9 100755
--- a/tool/rbinstall.rb
+++ b/tool/rbinstall.rb
@@ -719,12 +719,11 @@ module RbInstall https://github.com/ruby/ruby/blob/trunk/tool/rbinstall.rb#L719
     end
 
     def extract_files(destination_dir, pattern = "*")
-      path = @src_dir
-      return if path == destination_dir
+      return if @src_dir == destination_dir
       File.chmod(0700, destination_dir)
       mode = pattern == "bin/*" ? prog_mode : data_mode
       spec.files.each do |f|
-        src = File.join(path, f)
+        src = File.join(@src_dir, f)
         dest = File.join(without_destdir(destination_dir), f)
         makedirs(dest[/.*(?=\/)/m])
         install src, dest, :mode => mode
-- 
cgit v0.10.2


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

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