I've noticed that a few ruby gems that 开发者_高级运维I use ship with a folder named ext
or core_ext
which contains a set of monkey patches to the core library that is used in their code. However, when I require
those gems I get those monkey patches as well.
Is it possible for gem authors or for gem users to isolate those monkey patches such that they are only visible in the Modules that the gem defines/exports?
It won't be possible until refinements are implemented, see Shugo Maeda's proposal.
精彩评论