当前位置: 首页>>代码示例>>Java>>正文


Java RubyInstanceConfig.setLoader方法代码示例

本文整理汇总了Java中org.jruby.RubyInstanceConfig.setLoader方法的典型用法代码示例。如果您正苦于以下问题:Java RubyInstanceConfig.setLoader方法的具体用法?Java RubyInstanceConfig.setLoader怎么用?Java RubyInstanceConfig.setLoader使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jruby.RubyInstanceConfig的用法示例。


在下文中一共展示了RubyInstanceConfig.setLoader方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initRuntimeConfig

import org.jruby.RubyInstanceConfig; //导入方法依赖的package包/类
protected RubyInstanceConfig initRuntimeConfig(final RubyInstanceConfig config) {
	final RackConfig rackConfig = rackServletContext.getConfig();
	config.setLoader(Thread.currentThread().getContextClassLoader());
	final Map<String, String> newEnv = rackConfig.getRuntimeEnvironment();
	if (newEnv != null) {
		config.setEnvironment(newEnv);
	}
	config.processArguments(rackConfig.getRuntimeArguments());
	if (rackConfig.getCompatVersion() != null) {
		config.setCompatVersion(rackConfig.getCompatVersion());
	}
	String home = getEnvVariable("JRUBY_HOME");
	logger.info("stokesdrift.env JRUBY_HOME=" + home);
	try {
		if (home != null) {
			config.setJRubyHome(home);
		}
	} catch (Exception e) {
		rackServletContext.log(RackLogger.DEBUG, "won't set-up jruby.home from jar", e);
	}
	return config;
}
 
开发者ID:stokesdrift,项目名称:stokesdrift,代码行数:23,代码来源:DriftRackApplicationFactory.java

示例2: createRuntime

import org.jruby.RubyInstanceConfig; //导入方法依赖的package包/类
protected Ruby createRuntime(String root) {
    Ruby runtime;
    if (Ruby.isGlobalRuntimeReady()) {
        runtime = Ruby.getGlobalRuntime();
    } else {
        RubyInstanceConfig instanceConfig = new RubyInstanceConfig();
        String jrubyHome = WunderBoss.options().get("jruby-home", "").toString();
        if (!jrubyHome.isEmpty()) {
            instanceConfig.setJRubyHome(jrubyHome);
        }
        String[] argv = (String[]) WunderBoss.options().get("argv", new String[]{});
        instanceConfig.setArgv(argv);
        instanceConfig.setLoader(this.getClass().getClassLoader());
        runtime = Ruby.newInstance(instanceConfig);
    }
    runtime.getLoadService().addPaths(root);
    return runtime;
}
 
开发者ID:projectodd,项目名称:wunderboss,代码行数:19,代码来源:RubyLanguage.java

示例3: asciidoctor

import org.jruby.RubyInstanceConfig; //导入方法依赖的package包/类
@Bean
public Asciidoctor asciidoctor() {
    RubyInstanceConfig rubyInstanceConfig = new RubyInstanceConfig();
    rubyInstanceConfig.setLoader(this.getClass().getClassLoader());
    JavaEmbedUtils.initialize(Arrays.asList("META-INF/jruby.home/lib/ruby/2.0", "classpath:/gems/asciidoctor-1.5.4/lib"), rubyInstanceConfig);
    return create(this.getClass().getClassLoader());
}
 
开发者ID:wu191287278,项目名称:sc-generator,代码行数:8,代码来源:DocumentController.java

示例4: init

import org.jruby.RubyInstanceConfig; //导入方法依赖的package包/类
public static void init()
{
	if (instance != null) return;
	instance = new ScriptExecuter();
	
	Logger.log(ScriptExecuter.class, Logger.DEBUG, "ScriptExecuter starting...");

	RubyInstanceConfig config = new RubyInstanceConfig();
	config.setLoader(CuinaClassLoader.getInstance());
	runtime = Ruby.newInstance(config);
	runtime.getLoadService().require("java");
	state = READY;
}
 
开发者ID:TheWhiteShadow3,项目名称:cuina,代码行数:14,代码来源:ScriptExecuter.java


注:本文中的org.jruby.RubyInstanceConfig.setLoader方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。