public String getJRubyHome() { return config.getJRubyHome(); }
public String getJRubyHome() { return config.getJRubyHome(); }
public String getJRubyHome() { return config.getJRubyHome(); }
public String getJRubyHome() { return config.getJRubyHome(); }
public String getJRubyHome() { return ruby.get().getInstanceConfig().getJRubyHome(); }
public String getJRubyHome() { return ruby.get().getInstanceConfig().getJRubyHome(); }
public String getJRubyHome() { return ruby.get().getInstanceConfig().getJRubyHome(); }
public String getJRubyHome() { return ruby.get().getInstanceConfig().getJRubyHome(); }
/** * Returns a JRuby home directory. * * The default JRuby home is the value of JRUBY_HOME environment variable, * or "jruby.home" system property when no security restriction is set to * those directories. If none of JRUBY_HOME or jruby.home is set and jruby-complete.jar * is used, the default JRuby home is "/META-INF/jruby.home" in the jar archive. * Otherwise, "java.io.tmpdir" system property is the default value. * * @since JRuby 1.5.0. * * @return a JRuby home directory. */ public String getHomeDirectory() { return provider.getRubyInstanceConfig().getJRubyHome(); }
public Map<String, String> getEnvironment() { if (!environment.containsKey("RUBY") && RubyFile.PROTOCOL_PATTERN.matcher(getJRubyHome()).matches()) { // assumption: if JRubyHome is not a regular file than jruby got launched in an embedded fashion environment.put("RUBY", ClasspathLauncher.jrubyCommand(defaultClassLoader())); setEnvRuby = true; } return environment; }
/** * Returns a JRuby home directory. * * The default JRuby home is the value of JRUBY_HOME environment variable, * or "jruby.home" system property when no security restriction is set to * those directories. If none of JRUBY_HOME or jruby.home is set and jruby-complete.jar * is used, the default JRuby home is "/META-INF/jruby.home" in the jar archive. * Otherwise, "java.io.tmpdir" system property is the default value. * * @since JRuby 1.5.0. * * @return a JRuby home directory. */ public String getHomeDirectory() { return provider.getRubyInstanceConfig().getJRubyHome(); }
/** * Returns a JRuby home directory. * * The default JRuby home is the value of JRUBY_HOME environment variable, * or "jruby.home" system property when no security restriction is set to * those directories. If none of JRUBY_HOME or jruby.home is set and jruby-complete.jar * is used, the default JRuby home is "/META-INF/jruby.home" in the jar archive. * Otherwise, "java.io.tmpdir" system property is the default value. * * @since JRuby 1.5.0. * * @return a JRuby home directory. */ public String getHomeDirectory() { return provider.getRubyInstanceConfig().getJRubyHome(); }
/** * Returns a JRuby home directory. * * The default JRuby home is the value of JRUBY_HOME environment variable, * or "jruby.home" system property when no security restriction is set to * those directories. If none of JRUBY_HOME or jruby.home is set and jruby-complete.jar * is used, the default JRuby home is "/META-INF/jruby.home" in the jar archive. * Otherwise, "java.io.tmpdir" system property is the default value. * * @since JRuby 1.5.0. * * @return a JRuby home directory. */ public String getHomeDirectory() { return provider.getRubyInstanceConfig().getJRubyHome(); }
public Map<String, String> getEnvironment() { if (!environment.containsKey("RUBY") && RubyFile.PROTOCOL_PATTERN.matcher(getJRubyHome()).matches()) { // assumption: if JRubyHome is not a regular file than jruby got launched in an embedded fashion environment.put("RUBY", ClasspathLauncher.jrubyCommand(defaultClassLoader())); setEnvRuby = true; } return environment; }
fullName = JRubyFile.create(config.getJRubyHome(), "bin/" + scriptName); if (fullName.exists() && fullName.isFile()) { if (RubyInstanceConfig.DEBUG_SCRIPT_RESOLUTION) {
fullName = JRubyFile.create(config.getJRubyHome(), "bin/" + scriptName); if (fullName.exists() && fullName.isFile()) { if (RubyInstanceConfig.DEBUG_SCRIPT_RESOLUTION) {
final URL resource = Ruby.class.getResource("/META-INF/jruby.home"); if ( resource != null && "jar".equals( resource.getProtocol() ) ) { String home = config.getJRubyHome(); // uri: protocol only since 9k : if ( home == null || ! home.startsWith("uri:classloader:") ) { try {
private String resolveScript(String scriptName) { // These try/catches are to allow failing over to the "commands" logic // when running from within a jruby-complete jar file, which has // jruby.home = a jar file URL that does not resolve correctly with // JRubyFile.create. String result = resolve(config.getCurrentDirectory(), scriptName); if (result != null) return scriptName;// use relative filename result = resolve(config.getJRubyHome() + "/bin", scriptName); if (result != null) return result; // since the current directory is also on the classpath we // want to find it on filesystem first result = resolve(config.getCurrentDirectory() + "/bin", scriptName); if (result != null) return result; result = resolve("uri:classloader:/bin", scriptName); if (result != null) return result; Object maybePath = config.getEnvironment().get("PATH"); if (maybePath != null) { String path = maybePath.toString(); String[] paths = path.split(File.pathSeparator); for (int i = 0; i < paths.length; i++) { result = resolve(new File(paths[i]).getAbsolutePath(), scriptName); if (result != null) return result; } } if (config.isDebug()) { config.getError().println("warning: could not resolve -S script: " + scriptName); } // fall back to JRuby::Commands return null; }
private String resolveScript(String scriptName) { // These try/catches are to allow failing over to the "commands" logic // when running from within a jruby-complete jar file, which has // jruby.home = a jar file URL that does not resolve correctly with // JRubyFile.create. String result = resolve(config.getCurrentDirectory(), scriptName); if (result != null) return scriptName;// use relative filename result = resolve(config.getJRubyHome() + "/bin", scriptName); if (result != null) return result; // since the current directory is also on the classpath we // want to find it on filesystem first result = resolve(config.getCurrentDirectory() + "/bin", scriptName); if (result != null) return result; result = resolve("uri:classloader:/bin", scriptName); if (result != null) return result; Object maybePath = config.getEnvironment().get("PATH"); if (maybePath != null) { String path = maybePath.toString(); String[] paths = path.split(File.pathSeparator); for (int i = 0; i < paths.length; i++) { result = resolve(new File(paths[i]).getAbsolutePath(), scriptName); if (result != null) return result; } } if (config.isDebug()) { config.getError().println("warning: could not resolve -S script: " + scriptName); } // fall back to JRuby::Commands return null; }