2014-07-25 20:52:45 +00:00
|
|
|
# Ruby + Gradle Example
|
|
|
|
|
2014-08-15 18:39:39 +00:00
|
|
|
This project relies heavily on the marvelous [TorqueBox Rubygems Maven
|
|
|
|
repo](http://rubygems-proxy.torquebox.org/) and my own
|
|
|
|
[jruby-gradle-plugin](http://plugins.gradle.org/plugin/com.lookout.jruby)
|
2014-07-25 23:28:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
In order to prepare the dependencies for the JRuby application you must invoke
|
|
|
|
gradle:
|
|
|
|
|
2014-07-25 23:51:51 +00:00
|
|
|
```bash
|
2014-08-15 18:39:39 +00:00
|
|
|
% ./gradlew jrubyWar
|
2014-07-25 23:51:51 +00:00
|
|
|
```
|
2014-07-25 23:28:42 +00:00
|
|
|
|
|
|
|
This will do a few things:
|
|
|
|
|
|
|
|
1. Resolve Ruby gem dependencies
|
|
|
|
1. Resolve Java dependencies
|
|
|
|
1. Extract Ruby gems into `vendor/`
|
|
|
|
1. Cache jars into `.jarcache/` (for easily referencing at JRuby interpreter runtime)
|
2014-07-28 23:18:47 +00:00
|
|
|
1. Create a runnable `.war` of what's in `src/main/webapp`
|
2014-07-25 23:28:42 +00:00
|
|
|
|
|
|
|
|
2014-07-28 23:18:47 +00:00
|
|
|
### Running locally
|
|
|
|
|
|
|
|
```bash
|
2014-07-28 23:38:34 +00:00
|
|
|
% PATH=./vendor/bin:$PATH GEM_HOME=./vendor rackup src/main/webapp/WEB-INF/config.ru
|
2014-07-28 23:18:47 +00:00
|
|
|
```
|
2014-07-28 23:45:29 +00:00
|
|
|
|
|
|
|
## Requirements
|
|
|
|
|
|
|
|
* JRuby (for one form of local development)
|
|
|
|
* Rubygems (`gem`) for extracting gems
|
|
|
|
* Java 7
|