Open JelF opened 8 years ago
fails in travis same as at master, porbably gemspec misconfiguration
I never replied on this but the problem is that this makes it a runtime check any time you load a memoized method.
There is no way to check this outside runtime
This seems like something we should merge.
I just got bit by a bug where I was passing a block to a memoized method and trying to figure out why it was not seeing it (block_given?
was false inside that method). If it had raised this error instead of silently ignoring (not passing on) my block, I would have found out about the problem immediately.
Personally, I think there should an option to let you pass blocks — useful if you can be sure you will pass the same block any time you pass the same arguments — but I can understand the reasoning behind this (Memoist can't be sure that you will pass the same block every time, and if you pass a different block that would have given a different result, it should not return the wrong result).
Implemented BlocksNotSupported extension to handle fact that blocks are not supported
closes https://github.com/matthewrudy/memoist/issues/39