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: 2368
Rating:
Participated in rating: 2
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
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:
ERB files only, | = cursor or $END$ varaible.
%- -> <%- | %>
%-- -> <%- | -%>
%= -> <%= | %>
end -> <%- end -%>
%=t -> <%= t("|") %>
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.