Implement Dir.each_child #4953
Merged
Implement Dir.each_child #4953
Conversation
For more information, please see feature #11302.
Just curious about one thing but this look good. |
RubyClass dirClass = runtime.getDir(); | ||
RubyDir dir = (RubyDir) dirClass.newInstance(context, new IRubyObject[]{_path}, block); | ||
|
||
dir.each_child(context, block); |
enebo
Jan 10, 2018
Member
Does this path (block passed in) in MRI really ignore encoding param?
Does this path (block passed in) in MRI really ignore encoding param?
nomadium
Jan 10, 2018
Author
Contributor
Good observation. I'm not really sure about MRI on this, but Dir::foreach
JRuby method implementation is currently doing something similar if I'm not mistaken: https://github.com/jruby/jruby/blob/ruby-2.5/core/src/main/java/org/jruby/RubyDir.java#L481
I'll get back to this later with my findings.
Good observation. I'm not really sure about MRI on this, but Dir::foreach
JRuby method implementation is currently doing something similar if I'm not mistaken: https://github.com/jruby/jruby/blob/ruby-2.5/core/src/main/java/org/jruby/RubyDir.java#L481
I'll get back to this later with my findings.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Hi folks,
This is another feature targeting Ruby 2.5 [1]: Dir.each_child (feature #11302).
Note: The test is copied from MRI.
Thanks for your review and feedback.