用文件路径以外的其他抽象概念替换jruby脚本路径

时间:2011-07-31 09:18:33

标签: jruby

我只是猜测,但想要一些关于如何设置我自己的ruby脚本加载器的评论,而不仅仅是让运行时采用文件路径。

我没有尝试加载脚本,但是通过阅读它会显示搜索到的“脚本路径”...

ScriptingContainer {

   /**
 * Changes a list of load paths Ruby scripts/libraries. The default value
 * is an empty array. If no paths is given, the list is created from
 * java.class.path System property. This value can be set by
 * org.jruby.embed.class.path System property, also.
 * Call this method before you use put/get, runScriptlet, and parse methods so that
 * the given paths will be used.
 *
 * @since JRuby 1.5.0.
 *
 * @param paths a new list of load paths.
 */
public void setLoadPaths(List<String> paths) {
    provider.getRubyInstanceConfig().setLoadPaths(paths);
}
}

我的理解是运行时需要文件路径,我希望能够从我自己的提供程序加载脚本,例如Apache commons Virtual FileSystem。

0 个答案:

没有答案