Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IDE with refactoring support for Ruby on Rails

I am a java developer and use the Eclipse IDE for developing java code. I use the built-in refactoring features a lot, since good refactoring support from the IDE helps to speed up and leads to higher code quality. I would not like to miss it and use a simple text editor instead. Now I am looking for an IDE for Ruby on Rails with good refactoring capabilities.

Basic refactorings

Wanted basic refactoring methods include:

  • Extract method
  • Extract variable
  • Rename (class, method, variable etc.)

and so on.

Aptana Studio 3, RadRails 2, RubyMine 3 and Netbeans 7

So far I've tried Aptana Studio 3 and was quite disappointed regarding its refactoring capabilities. Aptana RadRails 2 seemed much better for refactoring ruby code, but it lacks other nice features that the newer Aptana Studio 3 offers. Since Aptana Studio 3 seems to be RadRails' successor I would expect that it has at least the same refactorings as the older RadRails 2, but it does not. Using an old unmaintained IDE does not seem a good option. Receiving updates for the IDE should still be possible.

I've read that Jetbrains RubyMine 3 has decent ruby refactoring capabilities, but it costs money. I am rather looking for a free one. Netbeans 7 seems not to support Ruby on Rails anymore.

Are there good IDEs with refactoring support?

That confuses me, it seems like modern IDEs drop (refactoring) support for Ruby on Rails. What are nowadays (Jan 2012) the most powerful IDEs for refactoring Ruby on Rails code?

Update: Netbeans 7

As suggested by Jörg W Mittag I've tried Netbeans 7 with the ruby plugin provided by the community. I have to say that this combination is much better than Aptana RadRails 2 or Aptana Studio 3 for developing Ruby on Rails apps. The integration of css and html for views is well done and the integration of rails tests into the JUnit Netbeans view comes in handy.

However, the refactoring support seems to be too basic. It supports rename, move, copy and safely delete of methods. It does not support to select lines of code and extract a method out of it nor the similar behaviour for extracting variables.

Update: RubyMine 3

dynex suggested to use RubyMine. I've just played around with it and think its suitability as an Ruby on Rails IDE is at least as good as Netbeans'. The refactor capabilities are by far the best I've seen in a Ruby on Rails IDE so far.

From what I've discovered it features renaming, moving, copying, safe deletion, method extractation, variable introduction, constant introduction, field introduction, parameter introduction, inlining, pulling members up, pushing members doen, module extraction and superclass extraction.

My conclusion is that from the set of IDEs I tested RubyMine was the only one with decent refactoring capabilities. RubyMine costs money, but it seems worth it. The free ones cannot compete regarding refactorings.

Thanks for all answers and comments.

like image 319
kms Avatar asked Jan 02 '12 20:01

kms


People also ask

What is the best IDE for Ruby on Rails development?

Sublime Text is the code editor that is customizable, lightweight, and high-performing.Sublime Text the best IDE for Ruby on Rails development today. It is one of the most prevalent editors due to its beautiful user interface, performance, and capability to add plugins, which can turn it into a fully-featured IDE.

What can you do with RubyMine on rails?

In addition, RubyMine is installed with an integrated console so that you can launch the server and test WebServices/APIs without fuss. The UI of this Ruby on Rails IDE is pleasant for the eye and represents the progressions done in a record when compared to the last submit. What is the current state of Ruby on Rails in 2022?

What is the best way to get started with Ruby?

The Ruby on Rails IDEs are all you’ll need to get started programming with the Ruby on Rails web platform. Ruby on Rails is a sophisticated and popular backend framework for web development businesses, according to usage data. In comparison to other programming languages, Ruby makes it easier to write code.

What is Arcadia Ruby IDE?

Arcadia is a lightweight IDE for Ruby. It is also written completely in Ruby, using the classic tcl/tk GUI toolkit. Arcadia has some very good features such as script editing, running and debugging support. It also includes support for source browsing, syntax highlighting and code completion.


Video Answer


3 Answers

RubyMine was my choice and I use refactoring once in a while. When using 'rename' it's never complete, but better than global-search-replace. Extraction etc works well.

Overall it's a great tool, albeit a memory hog, but I use it all the time now, especially for debugging. I know, it costs money, but I wanted to put in a good word for them anyway...

like image 117
dynex Avatar answered Oct 19 '22 07:10

dynex


Netbeans 7 seems not to support Ruby on Rails anymore

That's not true. Quite the opposite actually. Yes, Oracle dropped support for the Ruby on Rails plugin and gave maintenance over to the Ruby community. But the plugin is still available from the same place it was before, the community is still using the same infrastructure to develop, maintain and distribute the plugin as before. And since most of the people who originally wrote the plugin work for Google now, they can now again work on the code, now that it is no longer owned by the company that is suing their employer.

like image 26
Jörg W Mittag Avatar answered Oct 19 '22 07:10

Jörg W Mittag


Thanks for this question firstly, coming from java platform I was not comfortable with the text editors or IDEs available for RoR. I just started using RubyMine for 2 days now and yes it has a reasonable support for refactoring compared to text mate editor. Apart from the other features mentioned here I like code formatting, column selection mode (especially for .haml files), I use Ctrl+Tab to browse between the tabs (as in Netbeans) and of course find usages. I am not yet comfortable with the git integration part yet, need to explore that. If I find anything amazing will update my post.

like image 3
nowRails Avatar answered Oct 19 '22 08:10

nowRails