Skip to content

Commit cabe3a0

Browse files
authored
Merge pull request #67 from kigster/dir.children
Adding method Dir.children when it's not found.
2 parents fe99221 + cc1d57f commit cabe3a0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ruby/private/binary_wrapper.tpl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@
2020

2121
require 'rbconfig'
2222

23+
# Ruby 2.4 and older does not have +.children+
24+
# So we define it.
25+
unless Dir.respond_to?(:children)
26+
Dir.define_method :children do |dir|
27+
Dir.entries(dir).reject { |entry| %w(. ..).include?(entry) }
28+
end
29+
end
30+
2331
def find_runfiles
2432
stub_filename = File.absolute_path($0)
2533
runfiles = "#{stub_filename}.runfiles"

0 commit comments

Comments
 (0)