Skip to content

zimbatm/monkeypatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MonkeyPatch

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

<INSERT NICE INTRO HERE>

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.

</INSERT NICE INTRO HERE>
Authors
zimbatm <zimbatm@oree.ch>

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

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

About

Safe(er) monkey patching in Ruby

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages