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 delegation on Ruby 2.7 #52

Merged
merged 1 commit into from Dec 22, 2020
Merged

Fix delegation on Ruby 2.7 #52

merged 1 commit into from Dec 22, 2020

Conversation

eregon
Copy link
Contributor

@eregon eregon commented Dec 22, 2020

  • (*args, **kwargs)-delegation does not work on Ruby 2.7.

See https://eregon.me/blog/2019/11/10/the-delegation-challenge-of-ruby27.html#ruby-3-style-delegation
and https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/#a-compatible-delegation for more details.

Addresses #45 (comment)
and properly fixes #44.

Also fixes jwt/ruby-jwt#396 and in general many SimpleCov usages.

@taichi-ishitani I wonder, was https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/ confusing? It intends to say "use ruby2_keywords; (*args, **kwargs)-delegation does not work on Ruby 2.7". But maybe it needs to be clarified further?

* (*args, **kwargs)-delegation does not work on Ruby 2.7.
@codecov-io
Copy link

Codecov Report

Merging #52 (c1080f7) into master (f065fc3) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #52   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines           82        83    +1     
=========================================
+ Hits            82        83    +1     
Impacted Files Coverage Δ
lib/docile/fallback_context_proxy.rb 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f065fc3...c1080f7. Read the comment docs.

@taichi-ishitani
Copy link
Contributor

@eregon ,
Thank you for fixing a bug caused by my PR.
I misread the article.

@eregon
Copy link
Contributor Author

eregon commented Dec 22, 2020

@taichi-ishitani No worry. Do you have any suggestion how to improve the article to be clearer? It seems at least a few people got confused by it.

@ms-ati
Copy link
Owner

ms-ati commented Dec 22, 2020

Thank you for this fix @eregon ! I will make a release that includes this

@ms-ati ms-ati merged commit 7d0f83d into ms-ati:master Dec 22, 2020
@eregon
Copy link
Contributor Author

eregon commented Dec 22, 2020

Thanks!

@ms-ati
Copy link
Owner

ms-ati commented Dec 22, 2020

@eregon I've just released v1.3.4 to rubygems, which includes this PR. Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

truffleruby-head build is failing Warning related to key word argument
4 participants