What’s mining: inline local refactoring
You’ve probably got used to utilizing the power of RubyMine’s refactorings, have you?
One of the cool refactorings we have in RubyMine is ‘Introduce variable’ that lets you quickly create variable from a statement and replace all similar occurrences in the code.
Right now we are adding the reverse thing: inline local refactoring.
Here is the slide-cast showing it in action.
Step 1: Place caret on a variable you want to inline and select Refactor | Inline… from the main menu or context menu. Or, even better, learn the keyboard shortcut.
Step 2: Confirm your action.
Result: Your code is updated
This new refactoring will be available in the next RubyMine EAP build. You can download the latest build now and try other new refactorings we’ve been adding lately.
BTW, have you pre-ordered the “Refactoring: Ruby Edition” book already? Should be a good one.
Ruby can be refactored!
For the screenshots and my refactoring tests I use excellent ‘Greed’ project created by Jim Weirich and Joe O’Brien for their “Testing, Design, and Refactoring” tutorial during RailsConf 2009. Thanks guys!