Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Dir.each_child #4953

Merged
merged 2 commits into from Jan 10, 2018
Merged

Implement Dir.each_child #4953

merged 2 commits into from Jan 10, 2018

Conversation

@nomadium
Copy link
Contributor

@nomadium nomadium commented Jan 8, 2018

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.

  1. #4876
nomadium added 2 commits Jan 5, 2018
For more information, please see feature #11302.
@enebo
enebo approved these changes Jan 10, 2018
Copy link
Member

@enebo enebo left a comment

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);

This comment has been minimized.

@enebo

enebo Jan 10, 2018
Member

Does this path (block passed in) in MRI really ignore encoding param?

This comment has been minimized.

@nomadium

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.

@enebo enebo merged commit 19a43e1 into jruby:ruby-2.5 Jan 10, 2018
1 check failed
1 check failed
continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
@nomadium nomadium deleted the nomadium:implement-dir-each-child branch Jan 10, 2018
@enebo enebo added this to the JRuby 9.3.0.0 milestone Feb 21, 2018
@enebo enebo modified the milestones: JRuby 9.3.0.0, JRuby 9.2.0.0 Apr 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.