Haml/SASS Converters for RubyMine IDE (JRuby script-plugin)

Installing

  1. Install jruby:

> rvm install jruby-1.5.6 > rvm use jruby

We are not going to use this version of JRuby - RubyMine already has bundled version of it. We need to install it in order to collect all required for this plugin gems.

  1. Install this plugin as a gem into your project:

> cd <your-project-root> > gem i haml-sass-converters-rubymine-plugin –install-dir ./scripts

#1. Copy “Gemfile”, “.rvmrc” and “converters.rb” files from the root of this project into #newly created “scripts” folder inside your RubyMine project.

  1. Go to “File|Setting|Extensions” and add “scripts” folder as new “Script Folder”.

#This plugin will #be installed in “#'HOME'/.rvm/gems/jruby-1.5.6@haml-sass-converters/gems/haml-sass-converters-rubymine-plugin-0.1.0”

  1. From command line navigate to “scripts” folder:

> cd <your-project-root>/scripts

Accept “.rvmrc” as trusted configuration inside this folder. As a result, it will create “haml-sass-converters” gemset and switched rvm to use it. Now install bundler and all required gems:

> gem install bundler > bundle install

  1. Restart RubyMine. After restarting IDE will have new “Css” group under “Tools|Extensions” and new actions:

  • convert Html to Haml;

  • convert CSS to SASS;

You can reach them from “Tools|Extensions” in main menu or from context popup menu inside the editor.

Usage

Select some content inside erb or css file. Right click inside the editor and select appropriate action.