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

Fix Enumerable#each_cons and each_slice to return a receiver #1509

Merged
merged 6 commits into from
Oct 25, 2021

Conversation

makenowjust
Copy link
Contributor

Why not?

I think Enumerable#each_cons and Enumerable#each_slice are extensions of each method, so to return a receiver looks a natural behavior.

test/ruby/test_enum.rb Outdated Show resolved Hide resolved
@makenowjust
Copy link
Contributor Author

makenowjust commented Jan 5, 2017

What should I make CI successful for?

@nobu
Copy link
Member

nobu commented Jan 5, 2017

Make a branch with version guards and send a pull request to https://github.com/ruby/spec.
Then check out that branch before make update-rubyspec at the end of before_script section in .travis.yml file.

@k0kubun k0kubun changed the base branch from trunk to master August 15, 2019 17:38
@junaruga
Copy link
Member

Then check out that branch before make update-rubyspec at the end of before_script section in .travis.yml file.

Note that the Travis was revived by 9d4266f , only managing non-x86 cases.

enum.c Outdated
* a # => [[1, 2, 3], [2, 3, 4], [3, 4, 5]]
*
* a = []
* h = {foo: 0, bar: 1, baz: 2, bam: 3}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* h = {foo: 0, bar: 1, baz: 2, bam: 3}
* h = {foo: 0, bar: 1, baz: 2, bam: 3}

Copy link
Member

@knu knu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm the original author of these methods and this is fine with me.

@nobu nobu merged commit dfb47bb into ruby:master Oct 25, 2021
@makenowjust makenowjust deleted the fix/enum/each-cons-slice-return-self branch October 25, 2021 05:53
koic added a commit to koic/rubocop that referenced this pull request Oct 26, 2021
This PR fixes the following build error.

```console
% bundle exec rspec ./spec/rubocop/cop/layout/block_alignment_spec.rb:222
(snip)

      # ./lib/rubocop/cop/layout/block_alignment.rb:97:in `start_for_block_node'
      # ./lib/rubocop/cop/layout/block_alignment.rb:82:in `on_block'
      # ./lib/rubocop/cop/commissioner.rb:100:in `public_send'
      # ./lib/rubocop/cop/commissioner.rb:100:in `block (2 levels) in trigger_responding_cops'
      # ./lib/rubocop/cop/commissioner.rb:160:in `with_cop_error_handling'
      # ./lib/rubocop/cop/commissioner.rb:99:in `block in trigger_responding_cops'
```

https://app.circleci.com/pipelines/github/rubocop/rubocop/5414/workflows/4a7e4b81-7380-41e5-8ede-e28d9160010d/jobs/201236

I reported on this change of behavior.
https://bugs.ruby-lang.org/issues/18268

And it was due to the following change.
ruby/ruby#1509

This PR will be changed to the cop logic that is not affected by the above Ruby 3.1.0-dev change.
soutaro added a commit to ruby/rbs that referenced this pull request Feb 1, 2022
soutaro added a commit to ruby/rbs that referenced this pull request Feb 1, 2022
jcmfernandes added a commit to jcmfernandes/truffleruby that referenced this pull request Jan 13, 2023
jcmfernandes added a commit to jcmfernandes/truffleruby that referenced this pull request Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
6 participants