次のような単純なmavenプロジェクトがあります。
- $PROJ/src/main/java/クラスへのパス/InstallerLoader.java
- $PROJ/src/main/resources/installer.rb
InstallerLoader.java は次のようになります。
package com.mycompany;
import org.jruby.embed.ScriptingContainer;
import org.jruby.embed.PathType;
public class InstallerLoader {
public static void main(String[] args) {
System.out.println("Running..");
ScriptingContainer container = new ScriptingContainer();
container.runScriptlet(PathType.CLASSPATH, "/installer.rb");
}
}
これが、installer.rb の外観です。
require 'optparse'
options = { :verbose => false}
optparse = OptionParser.new do |opts|
opts.on('-v', '--verbose', 'Verbose output') do
options[:verbose] = true
end
end
optparse.parse!
puts options[:verbose]
これを実行しようとすると、installer.rb が読み込まれないようです。スタック トレースなど、installer.rb が読み込まれていないことを示すものはありません。ここで何が間違っていますか?