2011-06-19 115 views
0

我运行的JRuby这样:为org.jruby.Main设置类路径?

Main jrubyRunner = new Main() 
jrubyRunner.main(sassCompileCommandLineArgs) 

我有一些宝石我已经编入罐。如何在jrubyRunner将使用的类路径中包含这些jar?

回答

0
private static def setupCompassInvocationArgs = 
['-e', "require 'rubygems';gem 'compass'; load Gem.bin_path('compass', 'compass')"] 

protected def runCompassCommand(def compassArgs) { 
    Main main = new Main() 
    main.run([setupCompassInvocationArgs, compassArgs].flatten() as String[]) 
} 

第一位是你需要加载各种宝石。