Instead, it’s much better to wrap your patch in a module and apply it using Module#prepend. Doing so leaves you free to call the original implementation, and a quick call to Module#ancestors will show the patch in the inheritance hierarchy so it’s easier to find if things go wrong.
Finally, a simple prepend statement is easy to comment out if you need to disable the patch for some reason.
Responsible Monkeypatching in Ruby | AppSignal Blog
from blog.appsignal.com
Filed under:
Related Notes
- Dependencies (coupling) is an important concern to address, but it&...from kbouck
- By replacing integration tests with unit tests, we're losing al...from Computer Things
- I propose that there is one problem chief among them, an impetus fo...from George Hosu
- When software -- or idea-ware for that matter -- fails to be access...from gist.github.com
- Any software is considered free software so long as it upholds the ...from writefreesoftware.org
- Nathan's four Laws of Software: 1. **Software is a gas** ...from Jeff Atwood
- > Any sufficiently complicated [C](https://en.wikipedia.org/wiki...from From Wikipedia, the free
- Ad-hoc validation leads to a phenomenon that the [language-theoreti...from Alexis King