Categories


Authors:
toXXIc
free software

Injector

Products: IntelliJ IDEA, RubyMine

Vendor: Basil Gren

Email:

Website: N/A

Description:

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.
Downloads: 3234
Rating:
Participated in rating: 2
Version Since Build Until Build File/URL Size (Kb) Date Details
1.02. 80.8000. . Download 85.45 2012-05-09 01:48:19 details
. .
5 updates are hidden show all updates
Screenshot #11552

Recent change notes:

1.02

  • Fixed Injector exception throwed when typing characters in editors that are not linked to any project (for example, in Settings dialog).

1.01

  • Fixed throwing exception by Injector when task is changed in Task Manager with switching current context

1.0

  • Added Injector settings dialog, where you can specify own templates. The dialog accessible by right-click on Injector icon in status bar (opens very fast).
  • Added ignore shortcut option
  • Added ability to insert '#{}' into ruby strings, converting them to interpolated if necessary
  • Code optimization
  • Usage statistics added

0.95b

  • Changed injection method. Now character sequence should be typed instead of one char to be replaced by template. This makes Injector not so annoying in some situations as it was before.
  • Added some new templates.

0.91

  • Fixed issue when Injector occasionally inserted ruby injections if replace key is hold.
  • Minor injection rules fix.

0.9

  • Injector have become much more unobtrusive. It injects code only within html text and attributes value, within <script> tag it's automatically disabled.
  • Performance improved.
  • Plugin state now persists between IDE restarts.
  • Minor bugs fixed.

0.8

  • Initital release

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(,).

Comments:

develop7
Rated:
2011-12-16 16:24:13
.
toXXIc
2011-12-10 02:45:25
Finally, v1.0 is finished.
.
toXXIc
2011-10-18 00:04:20
Unfortunately, templates now are hard-coded, but customizing is the next step of development. I just need to implement settings for the plugin.
.
dlikhten
2011-10-17 17:52:06
Definitely better. Can the templates be customized, since I definitely like using the - symbols after the % (ensures that the injection line does not create a blank line in the output, good for saving some bandwidth and cleaner output).
.
toXXIc
2011-10-16 16:35:06
Dear Dmitry, thank you very much for your feedback. Actually I wrote the plugin to learn how to make plugins for IntelliJ platform and to speed up template editing with my style of coding. It was good for me because I mostly insert ruby code into ready html templates, so many bugs were unseen for me. Now having some feedback I reworked Injector to make it much more comfortable in use. From this version you can freely use '=', '#', '%' and '-' characters as usually, because now replacement is made after typing several characters instead of one. Please, try new version and I hope you will find it useful now. Please, feel free to report any bugs and suggestions here or via e-mail.
.
dlikhten
2011-10-11 19:21:43
Here are some live templates I use daily instead of this plugin... Maybe someone can instruct me how to release those maybe in some importable format on github.

ERB files only, | = cursor or $END$ varaible.

%- -> <%- | %>
%-- -> <%- | -%>
%= -> <%= | %>
end -> <%- end -%>
%=t -> <%= t("|") %>
.
dlikhten
Rated:
2011-10-11 19:09:53
This plugin kind of sucks. I replaced all it’s uses with live templates, and then some. It has MANY drawbacks, allow me to elaborate:

1) Typing simple things like = and - automatically turns into tags. Which is really bad when trying to type the following: <input type="button" class="foo-bar"> as it keeps escaping. I hit this situation more times than I actually used the feature. Sure you can undo but why, when the more common use for me is %- -> <- | %> and I can go crazy like %=t -> <%= t("|") %> etc…

2) You can no longer type %, -, =, # into live templates with this plugin. That’s right I started copy-pasting from vim to get the characters into live templates. That is beyond awful.

3) The to undo is stupid. It needs to be very smart about it because a VERY common case is typing `class=` -> `class<= | %>` -> `class<= "foo %>` [OPSE, backspace, oh wait i can't undo that expansion anymore]

I’d honestly remove this plugin and add a few live templates. This plugin is more harm than good.
.