Skip to content

Commit

Permalink
Add two-arg version of Dir.children. #4876.
Browse files Browse the repository at this point in the history
Encoding is ignored currently due to a lack of encoding support
in the Dir.entries logic. This change is to allow find.rb to work
without argument errors.
  • Loading branch information
headius committed Mar 19, 2018
1 parent 4cf9456 commit b975c7a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/src/main/java/org/jruby/RubyDir.java
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,12 @@ public static RubyArray children(ThreadContext context, IRubyObject recv, IRubyO
return entries;
}

@JRubyMethod(name = "children", meta = true)
public static RubyArray children(ThreadContext context, IRubyObject recv, IRubyObject arg, IRubyObject encoding) {
// TODO: encoding unused due to lack of encoding support in entries
return children(context, recv, arg);
}

/**
* Deletes the directory specified by <code>path</code>. The directory must
* be empty.
Expand Down

0 comments on commit b975c7a

Please sign in to comment.