I am a Ruby encoder. For me, monkeypatching is to change at runtime, classes or modules of methods in an external project. I am interested in what mechanism you have that will protect you from some abuse of this nice feature. Follow some of the scenarios I came across where monkeypatching bit me.
Until I know Smalltalk, this language was long before Ruby. I did some research to find out if and how Smalltalk solved some of these problems, but didn't find much on Google. So here I am, asking Smalltalkers if they can share their wisdom.
Scenario A: Error Correction Conflict
Projects A and B depend on project C. Project C has an error. Project A and B versions contain a fix for project C.
If your code uses Project A and B, how can you find out that patches will not conflict?
Scenario B: Legacy Bug Fix
Project C releases a fixed small version of its project.
If you download Project A, will the patch still apply with potential breakdowns? I am interested to know if there is any mechanism in place, for example, so as not to download the patch if the code is fixed.
Scenario C: conflicting extensions
Projects A and B use a project of class C Foo. Both add a utility to Foo, say #toDate. The toDate version for A returns a date string, and the B object returns Date.
If you download both projects (using C dep), is there a mechanism that prevents / prevents conflict? Or do you have to wait until the runtime generates an error due to improper waiting in the method?
About updating a question
Reading the answers, I understand that my question was too broad and vague. So, here is the rewritten version.
ruby smalltalk monkeypatching
zimbatm
source share