从 Ruby 中生成/修改 Ruby 源文件
从 ruby 中生成和/或解析和修改 Ruby 源文件的最可靠方法是什么?
也就是说,我想创建一个新的 ruby 源文件或更改源文件中的类中的几行代码,例如添加或删除方法或调用或其他任何内容。
也许有一个图书馆吗?
What is the most reliable way to generate and/or parse and modify a Ruby source file from within ruby?
That is, I want to e.g. create a new ruby source file or change a few lines of code in a class in a source file to e.g. add or remove methods or calls or whatever.
Is there a library for this perhaps?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Ruby2Ruby 就是这样的宝石。可能还有其他人。从自述文件中:
Ruby2Ruby is one such gem. There may be others. From the readme file: