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

Use ruby2_keywords for Ruby 3.0.0 compatibility #90

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dark-panda
Copy link

This isn't exactly ideal, as a more proper fix would involve checking the Method#parameters values for rest and kwargs arguments, but the basic idea is this patch gets Memoist working with Ruby 3.0.0's more distinct separation of argument types by reverting back to Ruby 2-style memoized methods. It would be much better to support this new style of arguments, but in the meantime, this will work with the caveat that only Ruby 2-style methods can be memoized using Ruby 3+, and even then only temporarily, as the ruby2_keywords method is only a temporary fix according to their docs. (See https://ruby-doc.org/core-3.0.0/Module.html#method-i-ruby2_keywords.)

@Galathius
Copy link

👍

@honzasterba
Copy link

I think #92 is a better solution

@pboling
Copy link
Contributor

pboling commented Jun 4, 2024

FYI: Added this alert to the new memoist repo

Important

Recommendation

Consider using MemoWise instead, as it is maintained, fully tested, provides thread safety guarantees, and is much, much faster.

Other Alternatives

In case you need a tool with this feature set that is currently maintained, check out:

Tip

Seriously though, read the important note above.

Warning

If you must continue - be aware that this is unmaintained software.

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.

4 participants