Skip to content

Commit 7ca3d62

Browse files
authored
Merge pull request #29 from colby-swandale/colby/breaking-ci
fix breaking specs in CI due to undefined method in ruby MRI < 2.5
2 parents 89a83a0 + bc92c93 commit 7ca3d62

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
@@ -1276,8 +1276,15 @@ def door?
12761276
def entries
12771277
opts = {}
12781278
opts[:encoding] = ::Encoding::UTF_8 if fu_windows?
1279-
Dir.children(path, opts)\
1280-
.map {|n| Entry_.new(prefix(), join(rel(), n.untaint)) }
1279+
1280+
files = if Dir.respond_to?(:children)
1281+
Dir.children(path, opts)
1282+
else
1283+
Dir.entries(path(), opts)
1284+
.reject {|n| n == '.' or n == '..' }
1285+
end
1286+
1287+
files.map {|n| Entry_.new(prefix(), join(rel(), n.untaint)) }
12811288
end
12821289

12831290
def stat

0 commit comments

Comments
 (0)