Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Rails 应用程序中将简单补丁应用到 Ruby gem 的最佳方法是什么?
是否可以保持原始 gem 代码不变?
是的,这是可能的。只需打开该类,为有问题的方法设置别名,并提供您自己的实现即可。此页面显示了一个示例。
只要您添加了必要的包含,您就可以从任何课程中打开该课程。物理上,原始代码将保持不变。