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

Enumerable#any?, all?, none? and one? now accept a pattern argument #5096

Conversation

@nomadium
Copy link
Contributor

@nomadium nomadium commented Mar 20, 2018

Hi folks,

This is another change adding Ruby 2.5 support [1]: Enumerable#any?, all?, none? and one? now accept a pattern argument (feature #11286 [2]).

All associated MRI and ruby/spec tests (except one [3] for #any?) are passing.

Thanks for your review and feedback.

  1. #4876
  2. https://bugs.ruby-lang.org/issues/11286
  3. it "calls the pattern with gathered array when yielded with multiple arguments" do
nomadium added 4 commits Mar 20, 2018
For more information, please see feature #11286.
For more information, please see feature #11286.
For more information, please see feature #11286.
For more information, please see feature #11286.
@nomadium
Copy link
Contributor Author

@nomadium nomadium commented Mar 20, 2018

Fixed. I'll get back to the failed test in

it "calls the pattern with gathered array when yielded with multiple arguments" do
later.

All Enumerable tests in ruby-2.5 branch should work with this PR.

I still would like to research and understand why that specific test was failing when each with a block built with JavaInternalBlockBody class is passed but not with one built with BlockCallback.

Replace each call + JavaInternalBlockBody with callEach + BlockCallback
as is implemented Enumerable#all? as well.

The failed test was:
https://github.com/jruby/jruby/blob/3813f0a53c22af8122e8c2b70c7d87ae35323109/spec/ruby/core/enumerable/any_spec.rb#L214
@nomadium
Copy link
Contributor Author

@nomadium nomadium commented Mar 21, 2018

@headius headius merged commit 0d9ec85 into jruby:ruby-2.5 Mar 21, 2018
1 check failed
1 check failed
continuous-integration/travis-ci/pr The Travis CI build failed
Details
@headius headius added this to the JRuby 9.2.0.0 milestone Mar 21, 2018
@nomadium nomadium deleted the nomadium:enumerable-methods-one-none-any-and-all-now-accept-pattern-argument branch Mar 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.