Skip to content

Commit bc92c93

Browse files
author
Colby Swandale
committed
fix breaking specs in CI due to undefined method in ruby < 2.5
1 parent d8c665c commit bc92c93

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lib/fileutils.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,8 +1274,15 @@ def door?
12741274
def entries
12751275
opts = {}
12761276
opts[:encoding] = ::Encoding::UTF_8 if fu_windows?
1277-
Dir.children(path, opts)\
1278-
.map {|n| Entry_.new(prefix(), join(rel(), n.untaint)) }
1277+
1278+
files = if Dir.respond_to?(:children)
1279+
Dir.children(path, opts)
1280+
else
1281+
Dir.entries(path(), opts)
1282+
.reject {|n| n == '.' or n == '..' }
1283+
end
1284+
1285+
files.map {|n| Entry_.new(prefix(), join(rel(), n.untaint)) }
12791286
end
12801287

12811288
def stat

0 commit comments

Comments
 (0)