How to extend RubyMine functionality with ruby scripts

I have an example of how to add HAML/SASS converters to RubyMine editor.

It could be handy when you try to convert large legacy code from erb templates into haml templtes. Sometimes you need to convert fragment-by-fragment, not by complete file.

Also, it could be useful as an example for creating other ruby-plugins for RubyMine.

It also could give an insight to RubyMine developers what needs to be changed in order to make this task trivial (in case of multiple gem dependencies).

See details http://scriptlandia.blogspot.com.

3 comments
Comment actions Permalink

Alexandr,

Thanks, I've mentioned your extension in our javascript:; document. Also some RubyMine Ruby API info is available at javascript:;.

0
Comment actions Permalink

Roman,

also, it would be interesing to hear how would ypu plan to architect RubyMine in a way that will simplify writing plugins that depend on other gems. Some ideas/thoughts:

1. have ability to use JRuby from external source (e.g.  from rvm);

2. make self-contained plugins that will have all dependencies inside some container (archive-like);

3. try to use existing functionality writing in ruby instead of rewriting it in java. say, you want to have haml converters in RubyMine as a feature, why whould you do it in Java?

4. Why would you require RubyMine to restart for changes in ruby code?

5. It's better to keep some scripts detached from the project (share them between different projects).

6. better, up-to-date documentation.

0
Comment actions Permalink

Roman,

also, it would be interesing to hear how would ypu plan to architect RubyMine in a way that will simplify writing plugins that depend on other gems. Some ideas/thoughts:

1. have ability to use JRuby from external source (e.g.  from rvm);

2. make self-contained plugins that will have all dependencies inside some container (archive-like);

3. try to use existing functionality writing in ruby instead of rewriting it in java. say, you want to have haml converters in RubyMine as a feature, why whould you do it in Java?

4. Why would you require RubyMine to restart for changes in ruby code?

5. It's better to keep some scripts detached from the project (share them between different projects).

6. better, up-to-date documentation.

At the moment we don't plan to improve our Ruby API because very few people use it + ideally we need to wrap all our internal Java API in Ruby and it is a rather big task. But if our users start using the API we will review our position on ruby API.

#1. We use jruby-complete.jar bundle so I'm not sure that usual JRuby installation contains it. But at least RubyMine can use Gempaths from real jruby installations. Also in theory your extension my launch any ruby script using your project sdk
#2. Ok, good idea. E.g. RubyMine already supports self-containted java plugins
#3. Some of RubyMine features are written in Ruby - e.g. refactorings, some intentions, etc. Unfortunately JRuby isn't as fast as Java and we cannot use Ruby for performance critical parts.
#4. In our first implementation ruby extensions were reloadable but then we faced with some technical limitation related to JRuby and JVM and we had to reject such idea. I don't remember details.
#5, #6. resoanable

0

Please sign in to leave a comment.