Posts Tagged ‘refactoring’

What’s mining: inline local refactoring

Tuesday, September 15th, 2009

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!

RubyMine 1.5 EAP (build 1364)

Thursday, August 20th, 2009

The SASS is here!

Other changes include cool Ruby related features:

  • Introduce constant refactoring
  • Introduce field refactoring
  • In-place rename for local variables and parameters
  • ‘Create method from usage’ quickfix
  • Quickfix for Ruby code style inspection
  • Suppress inspection feature for Ruby and Cucumber files

  1. Read full release notes
  2. Download RubyMine 1.5 EAP build 1364
  3. Let us know how it works for you.

RubyMine 1.5 EAP update with Shoulda, new refactorings and more

Thursday, August 13th, 2009

The time since the last RubyMine EAP update was not waisted and the new build 1347 adds lots of new things. Here’s the selected list of changes:

  • Shoulda support with coding assistance and test runner UI
  • Improved Ruby support inside HAML
  • New refactorings: Pull Up / Push Down members (expect more in the next update)
  • Spell checker plugin bundled
  • Support for method type annotation: # :return:=> Type
  • RubyMine Extensions manager added (in IDE Settings). Extensions can register menu items for editor actions (by default under Tools | Extensions)
  • Cucumer Formatter and quickfix to create Cucumber step definition for unresolved step
  • New icons for *.rb, *_spec.rb, *_test.rb and *_steps.rb Ruby files

Read full Release Notes.

Download RubyMine EAP and participate with your feedback.

RubyMine EAP build 784

Friday, March 20th, 2009

New Early Access build of RubyMine is available. Chances are this is the last build before the Beta release. Here is the list of changes:

  • Improved “Analyze Stacktrace”. You can now match stacktrace from production server or other team member with your local project sources
  • Improved documentation rendering in quick documentation lookup
  • Smart Rails controllers renaming: helper, views, spec and test:unit tests are also renamed
  • Quick Rake Task popup
  • Single key selection surround with quotes, parentheses, etc.
  • Gem descriptions markup rendering added
  • Misc improvements to gem manager stability
  • RSpec 1.2.0 compatibility
  • And a number of other fixes and improvements. See complete release notes.

Download RubyMine EAP build 784 and let us know your thoughts.

The Ruby plugin for IntelliJ IDEA has also been updated for all users of IntelliJ IDEA.

Also, you can now follow RubyMine on Twitter.

This is how documentation looks now when you press Ctrl+Q / ^J

RubyMine EAP build 715

Tuesday, February 17th, 2009

You can download the latest RubyMine build featuring the following:

  • Rename Refactoring for Rails View templates and Rails Action Methods (short demo)
  • Remote gems browsing and installation using the Gem manager
  • Improved ‘Find Usages’ performance
  • Show partial declaration
  • other improvements and fixes

Download RubyMine EAP build 715 and share your feedback.

We have also updated the Ruby plugin for IntelliJ IDEA. All the features recently added to RubyMine are now available in IntelliJ IDEA too.

RubyMine EAP build 681

Friday, February 6th, 2009

The original plan was to publish the EAP build on Monday. But there are some interesting things in this build that we could not wait any longer!

What’s inside?

  • Ruby Gems manager
  • Extract Method refactoring
  • Fixed performance regression in build 638
  • Three new inspections
  • and more

Download RubyMine EAP build 681 and let us know your thoughts.

Check the 2 demos below demonstrating the Extract Method refactoring.

Simple method extraction and error handling.(View full screen)

Extract method with multiple return values (view full screen)

Posted by Eugene Toporov, Marketing Manager

What’s mining: Extract Method Refactoring

Thursday, January 29th, 2009

We thought of making it “What’s cooking:…” but then realized we are not about food, we are about RubyMine, so — meet the new “What’s mining” blogpost series!

One of the things that’s in the works right now is the extract method refactoring. This feature is likely to appear in one of the next EAP releases.

On our developers’ machines, RubyMine can already do a simple, yet probably the most often used, kind of method extraction. Here is an example.

We have these three lines of code:

If we select the code to extract and choose Refactor|Extract Method… (or press Ctrl+Alt+M / ⌥⌘M), we can set the new method name and define parameter names and order in the following dialog:

After we click OK, the code looks like this:

Pretty simple, huh? Right, but not just simple :)

It is also smart enough to not let you easily break you code. Here is another example where RubyMine warns you about inability to make the refactoring and gives the reason.

Isn’t it cool? It is coming soon.

The following refactorings are already available in RubyMine:

  • Rename
  • Introduce Variable
  • Copy and Move for files

There are some improvements we have in mind (see the Issue Tracker) for the existing refactorings, and we also plan to add Extract Constant before RubyMine 1.0 is released.

Do you have an idea you’d like to share? Please leave a comment or start a discussion on our forum