将 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 公共虚拟文件系统。
I am just guessing but would like some commentary about how to set my own ruby script loader rather than just letting the runtime take file paths.
I have not tried to load scripts, but from reading it would appear the "script path" that is searched is ...
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);
}
}
My understanding is the runtime expects file paths, i would like the ability to load scripts from my own provider such as a Apache commons Virtual FileSystem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论