Eclipse Zone is brought to you in partnership with:

Mitch Pronschinske is a Senior Content Analyst at DZone. That means he writes and searches for the finest developer content in the land so that you don't have to. He often eats peanut butter and bananas, likes to make his own ringtones, enjoys card and board games, and is married to an underwear model. Mitch is a DZone Zone Leader and has posted 2576 posts at DZone. You can read more from them at their website. View Full User Profile

RubyMine 2.0 Shines with Refactoring

11.24.2009
| 10872 views |
  • submit to reddit
JetBrains gained a lot of attention when they released an open source version of thier IntelliJ IDEA development platform.  For Ruby and Ruby on Rails users, JetBrains created the RubyMine IDE, which is built on the principles of IntelliJ.  However, RubyMine did not start out as a plugin like comparable Ruby IDE's for Eclipse and NetBeans.  In an exclusive interview, DZone spoke with RubyMine's lead developer at JetBrains, Dmitry Jemerov.  The interview covers the recently introduced RubyMine 2.0, which features improved code refactoring and added support for popular Ruby/Rails technologies.  Although RubyMine hasn't been around for very long, it has quickly become the one of the most natural Ruby/Rails development environments.

New Features
Jemerov said, "In RubyMine 2.0, our main focus was on supporting the technologies which are widely used in modern Ruby/Rails projects, but which we didn't have time to fully support in the 1.0 release. The biggest one of those is Ruby 1.9."  Along with support for Ruby 1.9, Jemerov said that RubyMine 2.0 now fully supports:
  • HAML -  includes code completion support
  • SASS (Syntactically Awesome Style Sheets) - with syntax highlighting
  • Cucumber and Shoulda - with advanced code insight support when writing tests
  • Rails i18n - with navigation, code completion, and quickfixes for moving hard-coded strings into YAML bundles

New quick-fixes allow you to create many project elements from their usage, such as new method, action, partial, JavaScript, or CSS files.  Just refer a non-existing element in your code and invoke quick-fix on it using the hotkey.



You can also hide RubyMine's inspections warnings by adding suppress comments to your code.



Jemerov said, "In addition to that, there are the new refactoring tools, performance improvements (the main one is that the index building now happens in the background), 'Create from Usage' fixes, new TeamCity integration, and more."

Refactoring
DZone asked Jemerov to elaborate on RubyMine 2.0's enhanced refactoring capabilities.  Jemerov explained why refactoring is where RubyMine 2.0 really shines, "Refactoring support for Ruby and Ruby on Rails applications was available since RubyMine 1.0, which included refactorings like Rename (Rails-aware), Extract Method and a few others.  In RubyMine 2.0, we have added a number of refactorings focused on manipulating class/module hierarchies, such as Pull Up/Push Down and Extract Module.  In addition to that, there's a new set of Introduce refactorings (Introduce Field, Introduce Constant) and a new Inline Local refactoring which can be used to remove redundant intermediate variables."

Another highlight of RubyMine 2.0, which is related to refactorings, is duplicate code detection. Jemerov says RubyMine can find duplicate code even if the text of duplicated fragments doesn't match exactly.  One example is renamed variables. "This tool is very helpful for finding code that is in need of refactoring," Jemerov said.

Comparisons

RubyMine's two main competitors are the Ruby on Rails plugin for NetBeans and RadRails for Eclipse (or standalone with Actima Suite).  Similar capabilities between the IDEs might be judged on the basis of personal preference, so Jemerov listed for DZone the features that were only found in RubyMine.  

First of all, RubyMine can see the size of the Heap, generate a model dependency diagram, and insert code templates such as a template for an “if statement”.  Auto-testing is highly configurable and can be run from the Rake sub-menu.  RubyMine supports all Rake tasks.  In addition, you don't have to hit control-space to popup autocomplete after typing the period at the end of an object or class.  Jemerov says that there are many other things that RubyMine does better than its competitiors to provide the most natural Ruby/Rails development environment.

What's Next?
The next planned release of RubyMine is version 3.0, which is slated for Spring 2010.  Version upgrades for RubyMine are free within the first year of purchasing a commercial license.  Jemerov reveals, "In [RubyMine 3.0], we plan to invest significantly in improving the overall UI and the user experience of the product, as well as add a number of new features such as code coverage and metrics integration, SQL and database browsing integration, additional refactorings, inspections and quickfixes, and more."

IntelliJ IDEA 9.0, the next version of JetBeans' flagship product, is now available in beta and will be released before the end of November.  Jemerov believes that RubyMine will benefit from the efforts of the open-source community that is likely to spring up around IntelliJ's Community Editon.  JetBrains also plans to release TeamCity 5.0, a major update for their continuous integration server.  Lastly, Jemerov mentioned ReSharper 5.0, a new version of JetBrains' C#/Visual Basic intelligent coding plugin for Visual Studio, which will add Visual Studio 2010 support along with many other new productivity-enhancing features.  

A Commercial license for RubyMine is $99.  RubyMine is free for educational uses and for the purposes of developing open source projects