Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rails and refactoring, suggested tools and techniques specific to vim users?

Being a fairly new rails developer, I had my first taste of refactoring last week where I had to rename a controller and model to better reflect the domain we were working with. I used .NET for many years and took tools like Resharper for granted where it is simple to rename classes. I'm wondering how folks in the rails world mitigate the problem of refactoring? I'm mostly interested in those that mostly use vim (or anything other than an IDE).

I'm mostly interested in:

  • effective vim plugins that are specific to rails that may help with process
  • inbuilt vim tools that may also help with the process

I spent close to two hours doing the refactor and would like to be efficient, so any advice from rails experts would be great. Cheers.

Note, I realize that this question is similar to What tools are available for Ruby refactoring? but I'm already aware of IDE's like ruby mine, I'm mostly interested in how people who use vim with this kind of task.

like image 562
stantona Avatar asked Apr 30 '12 16:04

stantona


2 Answers

take a look at this vim pluggin: https://github.com/sandeepravi/refactor-rails.vim

the famous tim pope's rails.vim, has some refactoring helpers: http://www.vim.org/scripts/script.php?script_id=1567

this is a ruby gem for refactoring: https://github.com/jcrisp/rails_refactor

this is a Refactoring tool for Ruby but i think it will be usefull for rails projects too: https://github.com/ecomba/vim-ruby-refactoring

here you can find some help to use it: http://justinram.wordpress.com/2010/12/30/vim-ruby-refactoring-series/

like image 129
amalrik maia Avatar answered Nov 06 '22 02:11

amalrik maia


I am actually the author of https://github.com/sandeepravi/refactor-rails.vim and the plugin is still under development (although usable) and I plan to add quite a few new features - mostly the features which RubyMine gives.

RubyMine is also an excellent tool for refactoring but it hogs a lot of memory and it pretty slow; although the functionalities are pretty good. I basically want to have those features on vim as well.

Although I am biased ;) , the vim plugin is pretty good and it's only going to improve. Also, it's fast (duh!) compared to anything else.

like image 32
sandeep Avatar answered Nov 06 '22 04:11

sandeep