On 20/06/2012, at 12:23 PM, Avdi Grimm wrote:

> Please do not monkey patch core libraries in gems, unless the *purpose* of your library is to add functionality to core, eg a library of extensions like activesupport. Yes, this goes for additions as well as overrides. I cannot tell you how many times I've seen a "harmless addition" mess things up in confusing and hard to debug ways.

<rant>
While I understand it, I really disagree with this sentiment. Sure monkey patching can cause problems, but so can a lot of things. With great power comes great responsibility.
I really don't like this prevailing view that we should dumb down the language to the level of the least skilled developers. Banning unless/else and 'and/or', predicates returning true/false, inheritance is bad, etc. This is the wrong approach.
Instead we should be raising the skills of the developers to enable them to use the language to it's fullest.
</rant>

I think the OP's question has shown the right approach. He understands the dangers so, in an effort to improve his skills, he has asked the question, how can he use this technique in a way that will cause the least amount of problems. We should be encouraging this.

Henry