Skip to content

Commit 6f08698

Browse files
authored
Merge pull request #75 from lalten/lalten-ruby_2.3_compatibility
Ruby 2.3 compatibility for binary_wrapper
2 parents efe4389 + e37cfd4 commit 6f08698

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ruby/private/binary_wrapper.tpl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ require 'rbconfig'
2323
# Ruby 2.4 and older does not have +.children+
2424
# So we define it.
2525
unless Dir.respond_to?(:children)
26-
Dir.define_method :children do |dir|
26+
Dir.class.send :define_method, :children do |dir|
2727
Dir.entries(dir).reject { |entry| %w(. ..).include?(entry) }
2828
end
2929
end
@@ -52,7 +52,8 @@ def create_loadpath_entries(custom, runfiles)
5252
end
5353

5454
def get_repository_imports(runfiles)
55-
Dir.children(runfiles).map {|d|
55+
children = Dir.entries(runfiles) - [".", ".."]
56+
children.map {|d|
5657
File.join(runfiles, d)
5758
}.select {|d|
5859
File.directory? d

0 commit comments

Comments
 (0)