matthewrudy / memoist

ActiveSupport::Memoizable with a few enhancements
MIT License
920 stars 99 forks source link

Use ruby2_keywords for Ruby 3.0.0 compatibility #90

Open dark-panda opened 3 years ago

dark-panda commented 3 years ago

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 commented 3 years ago

👍

honzasterba commented 2 years ago

I think https://github.com/matthewrudy/memoist/pull/92 is a better solution

pboling commented 3 months ago

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.