Archive for the ‘WhatsMining’ Category

What’s mining: Bundler support in RubyMine

Thursday, December 10th, 2009

We were getting a number of questions about Bundler gem support in RubyMine. Bundler is a nice tool that manages gem dependencies for your ruby applications created by Yehuda Katz (aka wycats).

So, we went and added the appropriate support for it. The new functionality will be available in the really-soon-to-be-released RubyMine 2.0.1

To bundle gems into your application you simply need to execute the Tools->Bundle Gems. This will open the console and run the gem bundle command. This menu item becomes available once you have the Bundler gem installed in your selected Ruby SDK.

Click the image below to see the full screenshot.

Once you bundled you gems, they will show up as ‘frozen’ in Gem Manager.

It is really important to note that RubyMine manages gems not to just manage them but with the purpose to provide a better code insight and completion. For IDE performance sake we do not scan ALL gems installed under the SDK, but only those attached to your project. So, do not ignore those ‘Some of the required gems are not attached’ warnings if you want to experience what “the smart IDE” really means.

If there’s something you’d love to have added/fixed in RubyMine:



Develop with pleasure!
JetBrains RubyMine Team

What’s mining: Model Dependency Diagram revisited

Friday, October 9th, 2009

We’ve always considered RubyMine’s Model Dependency Diagram a killer feature.

To make it even more killing we’ve made some small but nice changes just recently.

1. System default DB fields (id, created_at, updated_at) are now hidden by default and can be shown if needed



2. Relations are now more informative as they consider the inheritance of models

3. Some performance improvements were also made making the diagram load faster.

The new functionality will be available in the nearest RubyMine Beta update. Stay tuned for news on this blog!

What’s mining: search for duplicates in Ruby

Wednesday, September 16th, 2009

Hi all,

It is always a pleasure to tell about new features! This time I’m glad to announce a brand new one that is coming in next RubyMine 1.5 EAP — “Locate duplicates”. It is another useful tool in RubyMine’s code analysis arsenal. Everyone has once faced with copy-paste problem: when you don’t use a refactoring such as extract method/module/variable for some reason but just do copy&paste. Your code begins to “smell”.

Locate duplicates is a helpful feature designed to assist you in writing safe, fast and error-free code.

Use Code | Locate Duplicates menu item to start it. You’ll see the  Code Duplication Analysis Settings dialog where you can tune the intelligibility of the search.

Local variables, Fields, Methods, Literals can be anonymized. Do not show duplicates simpler than and Anonymize uncommon subexpressions simpler than options operate with some heuristic values complexity of found fragments of code. These thresholds are used to cut off obvious duplicates like local variables, field etc. You can change them later, but the defaults should fit pretty good for a start.

Results of this search are shown in a familiar diff view with code fragments to inspect the results.

You are welcome to try this in coming EAP build.

-JetBrains RubyMine Team

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!

What’s mining: Rails i18n support

Wednesday, August 26th, 2009

Hello folks,

Today we are going to tell you about forthcoming Rails i18n support in RubyMine. This functionality is planned for RubyMine 1.5 release in our roadmap, and you will be able to try it in next EAP builds. Feature is under development so comments, suggestions and even feature requests are very welcome :)

At the moment RubyMine supports the following:

  • Resolve and completion for property keys with quick navigation info. Autocompletion for property keys:
  • Go to declaration action:
  • Convenient usages search for property keys
  • Rename property key in locale files with all usages
  • Rails conventions for templates key prefixes
  • Inspection with quickfix for undefined property key. RubyMine offers to apply “Create property” quickfix.

Not all the desired functionality is implemented yet, but we are working hard on it. Just want to mention some of the further feautures:

  • Duplicate property key Inspection
  • Intention to i18nize plain text value
  • Check whether all the keys present in given locale file
  • your suggestions?

Please do not hesistate and let us know your opinion about all this at our forum at: http://www.jetbrains.net/devnet/community/ruby

-JetBrains RubyMine Team

What’s mining: SASS support

Tuesday, August 18th, 2009

Hello everyone,

Our team is glad to announce that development builds of RubyMine already support SASS! The feature will be available in the next public EAP build.

We originally planned SASS support for RubyMine version 2.0, but we received a lot of requests on our forums, mailing lists, in JIRA, and we changed the priorities. (So, if you miss a feature, you can have it)

For now RubyMine’s SASS support includes:

  • Syntax highlighting
  • Smart code folding based on indentation
  • Comment/uncomment actions
  • Dedicated colors page to customize default highlighting attributes
  • Smart color-editor with gutters (see screenshot)

Here you can see SASS editor with smart code folding based on indentation. The syntax highlighting attributes can be configured in File | Settings | Editor | Colors & Fonts | SASS.

SASS editor with code folding

You can see color boxes on the gutters — these are exactly the colors used within your SASS file.
You can modify them either by editing plain SASS code or using RubyMine’s Color Edtor — just click the corresponding gutter!

Smart editor for SASS color attributes

And this is not all, we have a lot of plans for future SASS codeinsight aware support like:

  • Attributes validations
  • Navigation to constant definition, parent attributes
  • and much more

You are welcome to try all these things in coming RubyMine 1.5 EAP build!

Develop with SASS! Develop with pleasure!
- JetBrains RubyMine Team

Extending RubyMine with Ruby

Friday, August 14th, 2009

As we have already mentioned in RubyMine Roadmap, the forthcoming RubyMine 1.5 will provide Ruby API for extending the IDE in idiomatic Ruby (no Java or XML). For this purpose the latest RubyMine EAP has built-in RubyMine Extensions Manager for your own extension scripts.

Using Extensions Manager you can enable/disable the pre-installed scripts or add your own ones. Use ‘Add’ and ‘Remove’ buttons to manage your own script folders. Newly added scripts under script folders are considered as enabled by default.

API documentation isn’t yet finished, for now please refer to http://www.jetbrains.net/devnet/docs/DOC-1161. But we will surely get it published before RubyMine 1.5 release.

- JetBrains RubyMine Team

What’s mining: Ruby support within HAML

Friday, July 3rd, 2009

As you may know RubyMine provides outstanding Ruby code editing support in Erb files (RHTML). So, salute another language with Ruby code support: HAML. Familiar things like on the fly error highlighting, code completion, resolve, code folding, and much more are here to boost your productivity! And of course RubyMine is aware of HAML semantics and ruby blocks are recognized correctly according to indentations.

Here, in support of the words, we have some screenshots:

Ruby code completion:
    Ruby code folding:

This stuff will be available in RubyMine 1.5 EAP coming soon! Stay in touch!

-JetBrains RubyMine Team

What’s mining: unused local variable or parameter inspection

Wednesday, June 24th, 2009

Hello everyone,

RubyMine already has a bunch of inspections that help you on the fly to write correct and clean ruby code. They are Ruby code style, Unreachable code, Unresolved Ruby reference etc. Recently we’ve added one more useful inspection: Unused local variable.

Here is a screenshot:

This inspection will warn you about local variables or parameters which values are not used in the scope. Local variable on lines 2 and 5 are highlighted with warning because values assigned aren’t used anywhere, but local variable on line 7 isn’t because you can see read access to it’s value on line 8.

If you find some errors in its behavior or have suggestions you are welcome to file a bug or post your code on the forum. Thanks for all your reports so far! Your help is invaluable in making RubyMine the smartest Ruby IDE.

Note: You can also disable this inspection from right-click context menu or in File | Settings | Inspections | Ruby.

-JetBrains RubyMine Team

What’s mining: Polishing gems

Tuesday, June 23rd, 2009

I remember in some CRPGs I had used gems to improve a weapon or an armor. Ruby gems are somewhat similar — we pick good ones and use them in our projects to make them ‘killing’ :)

RubyMine needs to know of gems used in the code in order to provide you with the intelligent code analysis and coding assistance in general. So, we are constantly working on improving our gem manager, and a couple of new things has just been added.

1. Gem manager now lets you quickly see which of your gems are not up-to-date.

Just click ‘Update Gems’ button in gem manager

You will get the list of your project gems that you may want to update.

Turn off the ‘Show only attached gems’ option and you will see all gems that may need to be updated in your SDK. You can choose to update one, some or all gems.

2. Sometimes when opening a file you may notice a yellow notification about missing gems.

RubyMine detects some gems are not attached from lines of code such as gem 'foo'.

You can click the ‘Install…’ link and get the gems installed and attached to the project automatically.

These features will be available in RubyMine 1.2 and in RubyMine 1.5 EAP. Both should be released in the nearest future. Stay tuned!

Posted by Eugene Toporov, Marketing Manager