开发者

Isolating monkey patches in a ruby gem?

开发者 https://www.devze.com 2023-04-07 17:02 出处:网络
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, wh

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号