An open API service indexing awesome lists of open source software.

https://github.com/zimbatm/monkeypatch

Safe(er) monkey patching in Ruby
https://github.com/zimbatm/monkeypatch

Last synced: about 1 year ago
JSON representation

Safe(er) monkey patching in Ruby

Awesome Lists containing this project

README

          

= MonkeyPatch

*WARNING: This is alpha code, the API is not stable yet.*

Do you monkeys, patch ? If so, use this library, you won't regret it.

Why use a library when you could do all this by hand ? For two reasons:

1. We provide the mechanism to protect from patch collision
2. By including this gem as dependency, you declare your project is
monkeypatching.

Authors:: [ zimbatm ]

== Getting started

Example usage:

:include:example/patch_usage.rb

Look at the MonkeyPatch module to get an idea of the API.

Once you have a patch object, look at the MonkeyPatch::Patch definition to know how to use it.

----

==== Related projects

* http://github.com/coderrr/monkey_shield/ : provides sorts of namespaces to avoid patch collision

==== Ideas

* method re-definition or module/class extension could be detected, especially when using Gems. The load-path is not the same between the original definition and the new-one.
* load-path as namespace

==== TODO

* Rework the documentation
* Add reason string
* Add 'monkeywarn' that warns when a monkeypatch is applied