public void start() throws IOException { config = new RubyInstanceConfig(parentRuntime.getInstanceConfig()); config.setCurrentDirectory(pwd.toString()); config.setEnvironment(environmentMap(env)); if (pipedStreams) { config.setInput(new PipedInputStream(processInput)); config.setOutput(new PrintStream(new PipedOutputStream(processOutput))); config.setError(new PrintStream(new PipedOutputStream(processError))); } String procName = "piped"; if (argArray.length > 0) { procName = argArray[0]; } processThread = new Thread(this, "ScriptThreadProcess: " + procName); processThread.setDaemon(true); processThread.start(); }
public void start() throws IOException { config = new RubyInstanceConfig(parentRuntime.getInstanceConfig()); config.setEnvironment(environmentMap(env)); config.setCurrentDirectory(pwd.toString()); if (pipedStreams) { config.setInput(new PipedInputStream(processInput)); config.setOutput(new PrintStream(new PipedOutputStream(processOutput))); config.setError(new PrintStream(new PipedOutputStream(processError))); } String procName = "piped"; if (argArray.length > 0) { procName = argArray[0]; } processThread = new Thread(this, "ScriptThreadProcess: " + procName); processThread.setDaemon(true); processThread.start(); }
public void start() throws IOException { config = new RubyInstanceConfig(parentRuntime.getInstanceConfig()); config.setCurrentDirectory(pwd.toString()); config.setEnvironment(environmentMap(env)); if (pipedStreams) { config.setInput(new PipedInputStream(processInput)); config.setOutput(new PrintStream(new PipedOutputStream(processOutput))); config.setError(new PrintStream(new PipedOutputStream(processError))); } String procName = "piped"; if (argArray.length > 0) { procName = argArray[0]; } processThread = new Thread(this, "ScriptThreadProcess: " + procName); processThread.setDaemon(true); processThread.start(); }
public void start() throws IOException { config = new RubyInstanceConfig(parentRuntime.getInstanceConfig()); config.setEnvironment(environmentMap(env)); config.setCurrentDirectory(pwd.toString()); if (pipedStreams) { config.setInput(new PipedInputStream(processInput)); config.setOutput(new PrintStream(new PipedOutputStream(processOutput))); config.setError(new PrintStream(new PipedOutputStream(processError))); } String procName = "piped"; if (argArray.length > 0) { procName = argArray[0]; } processThread = new Thread(this, "ScriptThreadProcess: " + procName); processThread.setDaemon(true); processThread.start(); }
JRubyMain(String bundleDisableSharedGems, String currentDirectory, String jrubyHome, RubyInstanceConfig config) { super(config); // TODO have property to disable hard exit - see warbler config.setHardExit(true); config.setCurrentDirectory(currentDirectory + "/"); config.setJRubyHome(jrubyHome); // for jruby 1.7.x add the current directory explicitly to LOAD_PATH config.setLoadPaths(Arrays.asList(currentDirectory + "/")); Map<String, String> env = new HashMap<String, String>(System.getenv()); // we assume the embedded jars are placed in jars directory env.put("JARS_HOME", currentDirectory + "/jars"); // we assume the embedded gems are placed at the root of the "archive" env.put("GEM_PATH", currentDirectory + "/"); // make sure we do not inherit it from outside // NOTE: setting it to GEM_PATH will break the extractingMain cases env.put("GEM_HOME", jrubyHome + "/lib/ruby/gems/shared"); if (bundleDisableSharedGems != null) { // for spawning jruby we need bundler to tell to // NOT clean up the load Path env.put("BUNDLE_DISABLE_SHARED_GEMS", bundleDisableSharedGems); } config.setEnvironment(env); // older jruby-1.7.x does need this config.setLoader(JRubyMain.class.getClassLoader()); }
JRubyMain(String bundleDisableSharedGems, String currentDirectory, String jrubyHome, RubyInstanceConfig config) { super(config); // TODO have property to disable hard exit - see warbler config.setHardExit(true); config.setCurrentDirectory(currentDirectory + "/"); config.setJRubyHome(jrubyHome); // for jruby 1.7.x add the current directory explicitly to LOAD_PATH config.setLoadPaths(Arrays.asList(currentDirectory + "/")); Map<String, String> env = new HashMap<String, String>(System.getenv()); // we assume the embedded jars are placed in jars directory env.put("JARS_HOME", currentDirectory + "/jars"); // we assume the embedded gems are placed at the root of the "archive" env.put("GEM_PATH", currentDirectory + "/"); // make sure we do not inherit it from outside // NOTE: setting it to GEM_PATH will break the extractingMain cases env.put("GEM_HOME", jrubyHome + "/lib/ruby/gems/shared"); if (bundleDisableSharedGems != null) { // for spawning jruby we need bundler to tell to // NOT clean up the load Path env.put("BUNDLE_DISABLE_SHARED_GEMS", bundleDisableSharedGems); } config.setEnvironment(env); // older jruby-1.7.x does need this config.setLoader(JRubyMain.class.getClassLoader()); }
/** * Changes a current directory to a given directory. * The current directory can be changed anytime. * * @since JRuby 1.5.0. * * @param directory a new directory to be set. */ public void setCurrentDirectory(String directory) { if (provider.isRuntimeInitialized()) { provider.getRuntime().setCurrentDirectory(directory); } else { provider.getRubyInstanceConfig().setCurrentDirectory(directory); } }
/** * Changes a current directory to a given directory. * The current directory can be changed anytime. * * @since JRuby 1.5.0. * * @param directory a new directory to be set. */ public void setCurrentDirectory(String directory) { if (provider.isRuntimeInitialized()) { provider.getRuntime().setCurrentDirectory(directory); } else { provider.getRubyInstanceConfig().setCurrentDirectory(directory); } }
/** * Changes a current directory to a given directory. * The current directory can be changed anytime. * * @since JRuby 1.5.0. * * @param directory a new directory to be set. */ public void setCurrentDirectory(String directory) { if (provider.isRuntimeInitialized()) { provider.getRuntime().setCurrentDirectory(directory); } else { provider.getRubyInstanceConfig().setCurrentDirectory(directory); } }
/** * Changes a current directory to a given directory. * The current directory can be changed anytime. * * @since JRuby 1.5.0. * * @param directory a new directory to be set. */ public void setCurrentDirectory(String directory) { if (provider.isRuntimeInitialized()) { provider.getRuntime().setCurrentDirectory(directory); } else { provider.getRubyInstanceConfig().setCurrentDirectory(directory); } }
public int run(NGContext context) { context.assertLoopbackClient(); RubyInstanceConfig config = new RubyInstanceConfig(); Main main = new Main(config); config.setCurrentDirectory(context.getWorkingDirectory()); config.setEnvironment(context.getEnv()); // reuse one cache of compiled bodies config.setClassCache(classCache); return main.run(context.getArgs()).getStatus(); } }
public int run(NGContext context) { context.assertLoopbackClient(); RubyInstanceConfig config = new RubyInstanceConfig(); Main main = new Main(config); config.setCurrentDirectory(context.getWorkingDirectory()); config.setEnvironment(OSEnvironment.propertiesToStringMap(context.getEnv())); return main.run(context.getArgs()).getStatus(); } }
public int run(NGContext context) { context.assertLoopbackClient(); RubyInstanceConfig config = new RubyInstanceConfig(); Main main = new Main(config); config.setCurrentDirectory(context.getWorkingDirectory()); config.setEnvironment(OSEnvironment.propertiesToStringMap(context.getEnv())); return main.run(context.getArgs()).getStatus(); } }
public int run(NGContext context) { context.assertLoopbackClient(); RubyInstanceConfig config = new RubyInstanceConfig(); Main main = new Main(config); config.setCurrentDirectory(context.getWorkingDirectory()); config.setEnvironment(context.getEnv()); // reuse one cache of compiled bodies config.setClassCache(classCache); return main.run(context.getArgs()).getStatus(); } }
File newDir = new File(saved); if (newDir.isAbsolute()) { config.setCurrentDirectory(newDir.getCanonicalPath()); } else { config.setCurrentDirectory(new File(base, newDir.getPath()).getCanonicalPath()); File newDir = new File(saved); if (newDir.isAbsolute()) { config.setCurrentDirectory(newDir.getCanonicalPath()); } else { config.setCurrentDirectory(new File(base, newDir.getPath()).getCanonicalPath());
File newDir = new File(saved); if (saved.startsWith("uri:classloader:")) { config.setCurrentDirectory(saved); } else if (newDir.isAbsolute()) { config.setCurrentDirectory(newDir.getCanonicalPath()); } else { config.setCurrentDirectory(new File(base, newDir.getPath()).getCanonicalPath()); File newDir = new File(saved); if (saved.startsWith("uri:classloader:")) { config.setCurrentDirectory(saved); } else if (newDir.isAbsolute()) { config.setCurrentDirectory(newDir.getCanonicalPath()); } else { config.setCurrentDirectory(new File(base, newDir.getPath()).getCanonicalPath());
File newDir = new File(saved); if (saved.startsWith("uri:classloader:")) { config.setCurrentDirectory(saved); } else if (newDir.isAbsolute()) { config.setCurrentDirectory(newDir.getCanonicalPath()); } else { config.setCurrentDirectory(new File(base, newDir.getPath()).getCanonicalPath()); File newDir = new File(saved); if (saved.startsWith("uri:classloader:")) { config.setCurrentDirectory(saved); } else if (newDir.isAbsolute()) { config.setCurrentDirectory(newDir.getCanonicalPath()); } else { config.setCurrentDirectory(new File(base, newDir.getPath()).getCanonicalPath());
File newDir = new File(saved); if (newDir.isAbsolute()) { config.setCurrentDirectory(newDir.getCanonicalPath()); } else { config.setCurrentDirectory(new File(base, newDir.getPath()).getCanonicalPath()); File newDir = new File(saved); if (newDir.isAbsolute()) { config.setCurrentDirectory(newDir.getCanonicalPath()); } else { config.setCurrentDirectory(new File(base, newDir.getPath()).getCanonicalPath());