We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 89a83a0 + bc92c93 commit 7ca3d62Copy full SHA for 7ca3d62
1 file changed
lib/fileutils.rb
@@ -1276,8 +1276,15 @@ def door?
1276
def entries
1277
opts = {}
1278
opts[:encoding] = ::Encoding::UTF_8 if fu_windows?
1279
- Dir.children(path, opts)\
1280
- .map {|n| Entry_.new(prefix(), join(rel(), n.untaint)) }
+
+ 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)) }
1288
end
1289
1290
def stat
0 commit comments