summaryrefslogtreecommitdiff
path: root/lib/fileutils.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2021-01-17 11:52:03 +0900
committerNobuyoshi Nakada <[email protected]>2021-01-17 12:20:57 +0900
commit562b97e2f0abed2eb09db00e91e966e3fb3a4a09 ()
treec56d3ce8fb56adbd5a5688fbd864b5df2f289a5d /lib/fileutils.rb
parent905f58dc874a6d4b89da4212412d1f1ae133e985 (diff)
[ruby/fileutils] Removed code for dead versions
https://.com/ruby/fileutils/commit/1f707d8cc6
-rw-r--r--lib/fileutils.rb16
1 files changed, 3 insertions, 13 deletions
@@ -837,13 +837,8 @@ module FileUtils
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
begin
a.read(bsize, sa)
@@ -1292,12 +1287,7 @@ module FileUtils
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
untaint = RUBY_VERSION < '2.7'
files.map {|n| Entry_.new(prefix(), join(rel(), untaint ? n.untaint : n)) }