Use the uri:classloader:/ custom path for setting up JARS_HOME and $LOAD_PATH

This will help the submitted topology operate much more like an embedded JRuby
use-case thanks to the recent improvements that @mkristian has made in JRuby
core

Fixes #12
This commit is contained in:
R. Tyler Croy 2015-09-09 13:13:52 -07:00
parent 0734acdcb0
commit 23b6fdd4e3
No known key found for this signature in database
GPG Key ID: 1426C7DC3F51E16F
2 changed files with 10 additions and 1 deletions

View File

@ -19,7 +19,7 @@ apply plugin: 'java'
apply plugin: 'com.github.jruby-gradle.jar'
apply plugin: 'com.jfrog.bintray'
version = '0.8.1'
version = '0.9.0'
group = 'com.github.jruby-gradle'
description = "RedStorm integrates Ruby code via JRuby into the Storm distributed computation system"
defaultTasks 'check', 'assemble'

View File

@ -37,6 +37,15 @@ class TopologyLauncher
end
env = args[0].to_sym
# If we're in the "cluster" mode that means we're running in an embedded JRuby
# and we should modify our environment to suit that, see:
# <https://github.com/jruby-gradle/redstorm/issues/12>
if env == :cluster
Dir.chdir('uri:classloader:/')
ENV['JARS_HOME'] = 'uri:classloader:/jars'
$LOAD_PATH.unshift('uri:classloader://')
end
class_path = args[1]
launch_path = Dir.pwd