Injector

Compatible with:  IntelliJ IDEA , RubyMine
25.01.2016
4 508
Provides fast Ruby code injections into erb files and ruby strings. Injector makes replacements as fast as you type shortcut text and also provides additional features. Examples:
  • '%%' --> <% | %>
  • '%=' --> <%= | %>
  • '%-' --> <%- | -%>
  • '##' --> <%# | %>
Templates can be added and/or changed in settings. See details in General Usage section.
Feel free to report bugs and your suggestions to provided e-mail.

Download plugin

Version

Update date

Recent change notes

Fixed options saving and updated default templates

General usage instructions

Plugin provides fast ruby code injections. After typing shortcut text, it's replaced immediately by corresponding template. Examples are listed below:

  • '%%' --> <%- | -%>

  • '%=' --> <%= | -%>

  • '%-' --> <% | %>

  • '##' --> <%# | -%>


Templates are not inserted if cursor is already in Ruby-code block. You can change existing templates of define your own templates in settings dialog which is accessible in IDE Settings or by right-click on injector icon in status bar.
Injector provides insertion of '#{}' into Ruby strings. When cursor is placed in Ruby string, shortcut (default '##') is expanded info '#{}' and if string is non-interpolating (single-quoted), it's automatically converted to interpolating (double-quoted) string. This behavior and shortcut can be changed in settings.
To enable or disable Injector you can click on injector icon in the status bar or press default shortcut Ctrl+Comma(,).