Ruby Plugin 2.0 Features

Skip to end of metadata
Go to start of metadata

Ruby and JRuby Support

IntelliJ IDEA supports Ruby 1.8.6 and JRuby for running Ruby applications, with with cross-resolution of classes between Ruby and Java.

Smart, scope based JRuby-aware Ruby code completion

IntelliJ IDEA provides intelligent code completion for Ruby language, which includes:

  • Automatic completion of built-in methods
  • Smart Ruby statements completion
  • Completion and automatic resolution in require and load calls
  • Correct filtering of static and instance members in autocompletion
  • Local variable type inference
  • Type inference for block variables within block calls

JRuby additional supports includes:

  • Autocompletion and resolve for Java classes and methods in ruby scripts
  • Support for alternative method naming (setSize -> set_size)
  • Support for Ruby-style getters and setters

Also the plugin allows to specify additional load path directories, files from which will be parsed and included in resolve and completion suggestions.

Ruby code syntax and error highlighting

IntelliJ IDEA provides automatic Ruby code syntax and error highlighting for statements, keywords, comments and other language elements.

Automatic Ruby code styling

IntelliJ IDEA supports automatic Ruby code styling, with brace matching and folding, custom formatting, indentation and TODO marks.

Smart Ruby code analysis

IntelliJ IDEA performs on-the-fly code analysis and offers one-click quick-fixes for spotted problems.

Various Ruby-aware Intention Actions are available for transforming the source code:

Ruby

  • Call argument type mismatch
  • Incorrect call arguments count
  • Parameter shadows local variable
  • Unresolved Ruby reference
  • Inspection to detect incomplete hashes (with value missing after => )
  • Inspection to detect unreachable code

JRuby additional inspections:

  • Java interface not fully implemented
  • Wrong Java top level package
  • Auto-import of Java classes
Advanced Ruby code and project navigation

With IntelliJ IDEA you can navigate your Ruby projects in a variety of ways, view and examine documentation, method parameters, context info, etc.

  • Ruby-aware structure view, quick structure popup (Ctrl+F12)
  • Go to Ruby class(Ctrl+N), file(Ctrl+Shift+N), symbol(Ctrl+Alt+Shift+N) and declaration actions 
  • Quick declaration view(Ctrl+Shift+I), context(Alt+Q) and method parameter(Ctrl+P) info
  • Ruby code documentation lookup(Ctrl+Q) with hyperlinks and navigation
  • Goto Super (Ctrl-U)
  • Goto Type Declaration (Ctrl-Shift-B)
  • Supertypes hierarchy for Ruby classes (Ctrl-H)
  • Previous/Next Method works in Ruby (Alt-Up/Down)
  • Quick overriding of classes, modules and methods with active navigation gutters 
  • Ruby code usage search for local variables, method parameters, class fields and constants 
  • Stack trace analysis with one-click Ruby code navigation (for console output or "Analyze Stack trace" dialog)
Multiple Ruby-aware refactorings

IntelliJ IDEA features the rich set of Ruby-aware refactorings, all ready to help you transform your project code quickly and efficiently:

  • Rename refactoring (for classes, methods, variables, constants, method params etc)
  • Introduce variable
  • Override method
  • Implement method (for Ruby implemented Java interfaces)
Dedicated Ruby run configuration and quick script execution

IntelliJ IDEA lets you quickly run your scripts through dedicated configuration, plus supports shortcuts for Rake tasks, generators, RSpec, etc. Also IDEA's console recognize ANSI color codes.

Miscellaneous
  • More than 50 Ruby and RSpec live templates
  • TODO tasks support in comments
  • Plugin page with plugin version, build and useful links in setting



Rails Support

The plugin supports Ruby On Rails applications (which are configured as Ruby module with Rails facet) and JRuby on Rails applications (which are configured as Java modules with JRuby and Rails facets).

RHTML support

IntelliJ IDEA fully supports RHTML, with smart code completion for both Ruby, JavaScript code and HTML tags and embedded CSS.
It also provides automatic RHTML code styling and formatting, with braces and syntax highlighting.

  • Surround With (Ctrl-Alt-T) can be used to surround a fragment of RHTML with an XML tag or with a Ruby control statement
  • Smart Enter (Ctrl-Shift-Enter) can be used in RHTML to insert the closing <% end %> tag for a control statement
YAML Support

The plugin supports syntax highlighting and error highlighting for YAML files, based on the JvYAML library by Ola Bini.

Advanced Rails project navigation

IntelliJ IDEA features the smart Rails project navigation:

  • Navigation between model, controller, helper, unit/functional/spec tests (Go To | Navigate to Rails.., Alt-Shift-N)
  • Dedicated Rails Project view
  • Quick context menus and shortcuts for calling Rake tasks and Generators
Smart resolve and autocompletion for Rails magic
  • Support for Rails controllers, view, helpers, models and migrations
  • Support for parameters of following methods: url_for, render, stylesheet_link_tag, javascript_include_tag, paginate, helper, helper_method, form_tag, validate_*, has_many, has_one, belongs_to, has_and_belongs_to_many (see full list)
  • Fields defined in migrations are understood and shown in completion lists
  • Completion for find_by_* methods is provided
  • Completion and Resolving of methods defined by named routes and resource routes
Dedicated RubyOnRails run configurations
  • Support for Rails servers: WEBrick, Mongrel, lighthttpd, etc
  • Desired environment selection (development/test/production)
  • Context toolbar for opening the corresponding page in a number of browsers in Rails views
  • Opportunity to run a arbitrary Rails script (Tools | ROR Plugin | Run Rails script...)
  • Run migrations by Ctrl-Shift-F10
Miscellaneous
  • Automated generation of Rails skeleton applications
  • Rake tasks from context menu
  • Advanced tools for developing Rails generators, models, etc
  • View navigation actions suggest to create a view if none is found (Ctrl-Alt-W)
  • Quick insert action in action controller



Debugger

  • Works with Matz Ruby and JRuby interpreters
  • Breakpoints (in Ruby files and in view templates)
  • Step Over, Step Into, Step Out
  • Call stack
  • Local and global variables view
  • Watches
  • Threads
  • Expression evaluation
  • Smart display of arrays and hashes
  • Highlighting of recently modified values



Test Runner

The results of running Test::Unit tests and RSpec examples are displayed in a nice visual UI. The test runner UI can also be used for Rake tasks which run these types of tests (for example, "rake test:unit" in a Rails application). Also plugin supports quick tests launching for a specified method, class or set of tests.



Continuous integration and build management server support

Rake runner plugin provides support for Rake build language, RSpec and Test::Unit testing frameworks.
For more details see Rake runner plugin for TeamCity buildserver

Labels:
idea idea Delete
ruby ruby Delete
rails rails Delete
diana diana Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.