Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use a maven plugin from leiningen

The specific plugin I want to be able to use is the jruby-maven-plugin so I can easily use compass in a clojure project.

If it's not possible to use maven plugins, what would be the best strategy to use a ruby gem in a clojure project?

like image 369
Dan Avatar asked Nov 13 '22 08:11

Dan


1 Answers

The following two projects provide ruby gem support. lein-ruby clogems

clogems project does not have anything in the way of documentation, so you are probably on your own with that.

lein-ruby provides some documentation on it's github page. From the github page for lein-ruby.

Usage

Tasks

This plugin adds one task to Leiningen:

  • lein ruby CMD [ARGS...] - runs a Ruby command

You are responsible for adding the desired version of jruby-complete to your project's dependencies.

Hooks

The plugin also includes a set of hooks (in the leiningen.ruby.bundler namespace) which accomplish three things:

  • augment lein deps to install bundler and any gems specified in your project's Gemfile into vendor/gems

  • add vendor/gems to your project's classpath

  • package the gems in vendor/gems as part of your project's jar

Options

lein-ruby also introduces two options which can be set in your project.clj:

  • :ruby-version - the Ruby version to use for lein ruby: "1.8" or "1.9" (default)

  • :ruby-gem-dir - the directory to use for gems, relative to the project root (defaults to vendor/gems)

like image 101
Sanchayan Maity Avatar answered Nov 15 '22 05:11

Sanchayan Maity