使用textmate重构rails应用程序时如何查找参考?
我已经在 C# 中实践 TDD 几年了,最近全职转向 Ruby on Rails。我将继续使用 RSpec 进行 TDD 实践。我的问题是关于重构时查找参考的过程。在 Visual Studio 中,我在重命名或替换方法时沉迷于 Resharper 的“查找所有引用”。
ruby 中的测试驱动实践者在替换/重命名等时如何找到对方法的引用?
我意识到,因为 ruby 是一种动态语言,所以“查找所有引用”IDE 功能将无法工作,因此我正在寻找一种思维转变,就像一个简单的解决方案一样。
谢谢 - 李
I have been practicing TDD in C# for several years now and recently have moved to Ruby on Rails full time. I am continuing the practice of TDD with RSpec. My question is regarding the process of finding references while refactoring. In Visual Studio I was addicted to Resharper's "find all references" when renaming or replacing methods.
How do test driven practitioners in ruby find references to methods when replacing/renaming/etc?
I realize because ruby is a dynamic language a "find all references" IDE function would not work, so any I am looking for a shift in thinking as much as a simple solution.
Thanks
- Lee
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试过“在项目中搜索”? (Cmd+Shift+F)。它允许您搜索和替换,并具有正则表达式支持和工作方式,并且应该按照您需要的方式工作(如果我没记错的话 Resharper 过去是如何工作的)。
不过,对于大型项目来说,它可能会有点慢,所以一定要检查项目中的 Awk 或 项目中的 Grep (尽管 - 至少对于最后一个 - 不确定他们是否只处理搜索)
Have you tried doing a "Search in Project"? (Cmd+Shift+F). It allows you to search and replace, with regexp support and works, and should work just how you need (if I recall correctly how Resharper used to work).
It can get kinda slow with big projects, though, so be sure to checkout both Awk in Project or Grep in Project (although -at least for the last one- not sure if they deal only with searching)