mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/fileutils] Removed code for dead versions
https://github.com/ruby/fileutils/commit/1f707d8cc6
This commit is contained in:
parent
905f58dc87
commit
562b97e2f0
1 changed files with 3 additions and 13 deletions
|
@ -837,13 +837,8 @@ module FileUtils
|
||||||
def compare_stream(a, b)
|
def compare_stream(a, b)
|
||||||
bsize = fu_stream_blksize(a, b)
|
bsize = fu_stream_blksize(a, b)
|
||||||
|
|
||||||
if RUBY_VERSION > "2.4"
|
sa = String.new(capacity: bsize)
|
||||||
sa = String.new(capacity: bsize)
|
sb = String.new(capacity: bsize)
|
||||||
sb = String.new(capacity: bsize)
|
|
||||||
else
|
|
||||||
sa = String.new
|
|
||||||
sb = String.new
|
|
||||||
end
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
a.read(bsize, sa)
|
a.read(bsize, sa)
|
||||||
|
@ -1292,12 +1287,7 @@ module FileUtils
|
||||||
opts = {}
|
opts = {}
|
||||||
opts[:encoding] = fu_windows? ? ::Encoding::UTF_8 : path.encoding
|
opts[:encoding] = fu_windows? ? ::Encoding::UTF_8 : path.encoding
|
||||||
|
|
||||||
files = if Dir.respond_to?(:children)
|
files = Dir.children(path, **opts)
|
||||||
Dir.children(path, **opts)
|
|
||||||
else
|
|
||||||
Dir.entries(path(), **opts)
|
|
||||||
.reject {|n| n == '.' or n == '..' }
|
|
||||||
end
|
|
||||||
|
|
||||||
untaint = RUBY_VERSION < '2.7'
|
untaint = RUBY_VERSION < '2.7'
|
||||||
files.map {|n| Entry_.new(prefix(), join(rel(), untaint ? n.untaint : n)) }
|
files.map {|n| Entry_.new(prefix(), join(rel(), untaint ? n.untaint : n)) }
|
||||||
|
|
Loading…
Reference in a new issue