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

ruby-changes:64913

From: Nobuyoshi <ko1@a...>
Date: Sun, 17 Jan 2021 12:21:49 +0900 (JST)
Subject: [ruby-changes:64913] 562b97e2f0 (master): [ruby/fileutils] Removed code for dead versions

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

From 562b97e2f0abed2eb09db00e91e966e3fb3a4a09 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sun, 17 Jan 2021 11:52:03 +0900
Subject: [ruby/fileutils] Removed code for dead versions

https://github.com/ruby/fileutils/commit/1f707d8cc6

diff --git a/lib/fileutils.rb b/lib/fileutils.rb
index a2ad0c0..69de458 100644
--- a/lib/fileutils.rb
+++ b/lib/fileutils.rb
@@ -837,13 +837,8 @@ module FileUtils https://github.com/ruby/ruby/blob/trunk/lib/fileutils.rb#L837
   def compare_stream(a, b)
     bsize = fu_stream_blksize(a, b)
 
-    if RUBY_VERSION > "2.4"
-      sa = String.new(capacity: bsize)
-      sb = String.new(capacity: bsize)
-    else
-      sa = String.new
-      sb = String.new
-    end
+    sa = String.new(capacity: bsize)
+    sb = String.new(capacity: bsize)
 
     begin
       a.read(bsize, sa)
@@ -1292,12 +1287,7 @@ module FileUtils https://github.com/ruby/ruby/blob/trunk/lib/fileutils.rb#L1287
       opts = {}
       opts[:encoding] = fu_windows? ? ::Encoding::UTF_8 : path.encoding
 
-      files = if Dir.respond_to?(:children)
-        Dir.children(path, **opts)
-      else
-        Dir.entries(path(), **opts)
-           .reject {|n| n == '.' or n == '..' }
-      end
+      files = Dir.children(path, **opts)
 
       untaint = RUBY_VERSION < '2.7'
       files.map {|n| Entry_.new(prefix(), join(rel(), untaint ? n.untaint : n)) }
-- 
cgit v0.10.2


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

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