Open dark-panda opened 3 years ago
👍
I think https://github.com/matthewrudy/memoist/pull/92 is a better solution
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:
- https://github.com/makandra/memoized
- https://github.com/honzasterba/memoist
- https://github.com/AlexWayfer/alt_memery
[!TIP]
Seriously though, read the important note above.[!WARNING]
If you must continue - be aware that this is unmaintained software.
This isn't exactly ideal, as a more proper fix would involve checking the
Method#parameters
values forrest
andkwargs
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 theruby2_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.)