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 HelperProxy keyword argument passing for Ruby 3 #894

Closed

Conversation

tbuehlmann
Copy link
Contributor

@tbuehlmann tbuehlmann commented Jan 12, 2021

It seems Ruby 3 doesn't recognize passed hash arguments as keyword arguments like it did in Ruby 2.7. That's why we need to properly pass keyword arguments.

Fixes #884.

Copy link

@brian-kephart brian-kephart left a comment

Choose a reason for hiding this comment

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

Unfortunately this approach is not backwards compatible with all recent Rubies. There is already a PR #885 that fixes this issue in a backwards-compatible way. It is waiting on moderator approval to merge, but hasn't received attention so far.

More info about argument forwarding in different Ruby versions.

@tbuehlmann
Copy link
Contributor Author

@brian-kephart: Have an example of a Ruby version that wouldn't work with the fix?

@n-rodriguez
Copy link
Contributor

There is already a PR #885 that fixes this issue in a backwards-compatible way. It is waiting on moderator approval to merge, but hasn't received attention so far.

I don't know which PR works best, but I thinks this (https://travis-ci.org/github/drapergem/draper/jobs/754121898) should be fixed.

And why not merge this (#893) before to have a faster CI.

@tbuehlmann
Copy link
Contributor Author

@n-rodriguez: Fixed in #895.

@brian-kephart
Copy link

@tbuehlmann the compatibility issues are detailed in the article I linked, specifically at this heading: https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/#a-compatible-delegation

@tbuehlmann
Copy link
Contributor Author

Fine with me.

@n-rodriguez
Copy link
Contributor

@tbuehlmann can you please rebase your branch on master? thank you!

@tbuehlmann tbuehlmann force-pushed the ruby-3-keyword-arguments branch from 9bf8737 to cbf7893 Compare January 26, 2021 10:59
@tbuehlmann
Copy link
Contributor Author

@n-rodriguez: Sure, done.

@n-rodriguez
Copy link
Contributor

Unfortunately this approach is not backwards compatible with all recent Rubies.

I agree. See: https://github.com/drapergem/draper/pull/894/checks

@tbuehlmann
Copy link
Contributor Author

Fine with me! Let's close this PR then?

@codebycliff
Copy link
Collaborator

@tbuehlmann I apologize. Had I been quicker to merge #885, I don't think you would have wasted your time. Either way, your contribution is appreciated. I'm going to close this in favor of the other pull request.

@tbuehlmann
Copy link
Contributor Author

@codebycliff : Oh don't worry, it's fine.

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.

Draper is incompatible with Ruby 3
4 participants