From bc92c930c7acd591ae99beafa6841700b4683bc1 Mon Sep 17 00:00:00 2001 From: Colby Swandale Date: Tue, 18 Dec 2018 19:18:02 +1100 Subject: [PATCH] fix breaking specs in CI due to undefined method in ruby < 2.5 --- lib/fileutils.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/fileutils.rb b/lib/fileutils.rb index dc72618..2b02c54 100644 --- a/lib/fileutils.rb +++ b/lib/fileutils.rb @@ -1274,8 +1274,15 @@ def door? def entries opts = {} opts[:encoding] = ::Encoding::UTF_8 if fu_windows? - Dir.children(path, opts)\ - .map {|n| Entry_.new(prefix(), join(rel(), n.untaint)) } + + files = if Dir.respond_to?(:children) + Dir.children(path, opts) + else + Dir.entries(path(), opts) + .reject {|n| n == '.' or n == '..' } + end + + files.map {|n| Entry_.new(prefix(), join(rel(), n.untaint)) } end def stat