Refactoring Tool

RubyMine is famous for its outstanding code analysis routines, which underpin smart code inspections and automatic refactorings and help you eliminate code smells.

Smart and Easy Coding

Code styling

  • Use a consistent code style, by having RubyMine automatically apply the configured code style as you write code, or by reformatting whole files at once.
  • Configure your code style for any language, including indents, spaces, aligning rules, and so forth, and share it with your teammates.
  • RubyMine can also automatically apply the code style specified in the .editorconfig project file.

Code inspections

  • Inspired by the best community practices, RubyMine verifies your code for many types of possible errors and code smells: unreachable code, incorrect call argument count, unused local variable, etc.
  • Rails inspections warn you about wrong usages of model methods in a view, view helper or controller action; deprecated Rails features; and more.
  • All inspections have a description and can be switched on or off, or configured as necessary.

On-the-fly code analysis and fixes

  • According to its list of inspections, RubyMine performs on-the-fly code analysis and highlights errors right as you type.
  • Every inspection suggests an improvement with a quick-fix option, as well as the ability to disable a rule or hide a warning.
  • Quick-fixes allow you to create many project elements from their usage, such as new method, action, partial, or file. You can also use them to refactor or change code style.

Cross-language refactorings

  • Refactor any code with fast and safe rename and delete; extract method/module/superclass; introduce variable/constant/parameter; inline variable/method; and more.
  • All the refactorings are, of course, Ruby on Rails aware; e.g. renaming a controller will also rename helper, views and tests.
  • There are also Rails-specific refactorings, e.g. 'Extract Partial' which allows you to move a part of a view file code to a separate partial view.