RubyMine deserves a 👏 for productivity 
Tags: ruby, rubymine, ide, rails
Published: 2020-08-27 04:17:46

After doing years of ruby development in Sublime Text, I decided to move away. [Here](https://dev.to/rahul_ramfort/sublime-text-is-an-editor-not-an-ide-e5g) are the reasons. I chose [RubyMine](https://www.jetbrains.com/ruby/) as quite a few peers of mine recommended it and boasted how they could never imagine coming out of RubyMine now.

I decided to give it a shot. To be honest, I felt congested working in RubyMine and I would often switch to Sublime to debug something or to look up something quickly. It took a week to settle down and thereafter, I refrained myself from switching to sublime text. 

It's been three weeks with RubyMine now and here are the productive features that have made me happy during this short period.

###Refactoring code is easy peasy

If you're one of those, who often refactor code, you will love how easy it is done in RubyMine.

To extract a method, select the lines of code to move, give it a name and select if it has to a public/private method. 

>It's interesting to note that, if you're refactoring a class method, the new methods will also be a class method, which you might miss if you do it yourself every time. 😉
 
![Extract Method](https://github.com/rahulramfort/blog/blob/master/editors/3_ruby_min/extract_method.png?raw=true)



Similarly, moving methods to a new module/class is also neat.
RubyMine extends/includes the new module in the current file automatically as well.


![Extract Module](https://github.com/rahulramfort/blog/blob/master/editors/3_ruby_min/extract_module_array.png?raw=true)

###Renaming a method/variable/class name

When you want to rename an identifier, RubyMine intelligently finds all the usages of the identifier and changes it.

Renaming class name will change the file name accordingly as well.😎

![Extract Rename Dialog](https://github.com/rahulramfort/blog/blob/master/editors/3_ruby_min/rename_dialog.png?raw=true)

It quickly shows all the usages for you verify.

![Extract Rename](https://github.com/rahulramfort/blog/blob/master/editors/3_ruby_min/rename.png?raw=true)
 

###Documentation for methods/classes

I often end up googling methods/classes that are defined in ruby/rails so as to understand it better. *Not anymore*.

RubyMine displays the documentation in a popup for methods, classes when you hover over it. 

![Documentation](https://github.com/rahulramfort/blog/blob/master/editors/3_ruby_min/documention.png?raw=true)


###Find all usages of a method

This is my favourite feature. `CMD + Click` shows all the usages of an identifier and helps you in quickly jumping to and fro.

![All usages](https://github.com/rahulramfort/blog/blob/master/editors/3_ruby_min/all_usages_arr.png?raw=true)


###Compare with the repository version

To check the changes that I have made to a file while working, I used to switch to SourceTree. RubyMine has a similar way of showing the diff of the working copy against the repository version using any shortcut of your choice.

![Compare working copy](https://github.com/rahulramfort/blog/blob/master/editors/3_ruby_min/text_compare.png?raw=true)

###Go to Implementation of a method

This is a must-have feature in an IDE.

What I really like here is how RubyMine lets us see a method of any gem.

![All usages](https://github.com/rahulramfort/blog/blob/master/editors/3_ruby_min/ruby_method_def.png?raw=true)

###Possible syntax errors

Apart from checking the syntax of a line as you type it, it also intelligently show the syntax errors for method calls.

 ![All usages](https://github.com/rahulramfort/blog/blob/master/editors/3_ruby_min/arg_miss.png?raw=true)


###Begin ... End Block

This is a simple yet elegant feature that shows which block does the current `end` close. This is particularly useful when the number of lines in the file is too many and you have to scroll up to see which block the `end` closes. 
As soon as the cursor is on any `end`, RubyMine shows the corresponding block at the top.
 
![All usages](https://github.com/rahulramfort/blog/blob/master/editors/3_ruby_min/array_begin_end.png?raw=true)




These are a few highlights that I have liked in these three weeks of using RubyMine. These are definitely going to boost your productivity and if you're still on Sublime Text, you must give RubyMine a try.

Please drop a comment if there are any other cool features that I must know.