public String getCurrentDirectory() { return ruby.get().getInstanceConfig().getCurrentDirectory(); }
public String getCurrentDirectory() { return ruby.get().getInstanceConfig().getCurrentDirectory(); }
public String getCurrentDirectory() { return ruby.get().getInstanceConfig().getCurrentDirectory(); }
public String getCurrentDirectory() { return ruby.get().getInstanceConfig().getCurrentDirectory(); }
public RubyInstanceConfig(RubyInstanceConfig parentConfig) { currentDirectory = parentConfig.getCurrentDirectory(); compatVersion = parentConfig.compatVersion; compileMode = parentConfig.getCompileMode(); jitLogging = parentConfig.jitLogging; jitDumping = parentConfig.jitDumping; jitLoggingVerbose = parentConfig.jitLoggingVerbose; jitLogEvery = parentConfig.jitLogEvery; jitThreshold = parentConfig.jitThreshold; jitMax = parentConfig.jitMax; jitMaxSize = parentConfig.jitMaxSize; managementEnabled = parentConfig.managementEnabled; runRubyInProcess = parentConfig.runRubyInProcess; excludedMethods = parentConfig.excludedMethods; threadDumpSignal = parentConfig.threadDumpSignal; updateNativeENVEnabled = parentConfig.updateNativeENVEnabled; classCache = new ClassCache<Script>(loader, jitMax); try { environment = System.getenv(); } catch (SecurityException se) { environment = new HashMap(); } }
public RubyInstanceConfig(RubyInstanceConfig parentConfig) { currentDirectory = parentConfig.getCurrentDirectory(); compatVersion = parentConfig.compatVersion; compileMode = parentConfig.getCompileMode(); jitLogging = parentConfig.jitLogging; jitDumping = parentConfig.jitDumping; jitLoggingVerbose = parentConfig.jitLoggingVerbose; jitLogEvery = parentConfig.jitLogEvery; jitThreshold = parentConfig.jitThreshold; jitMax = parentConfig.jitMax; jitMaxSize = parentConfig.jitMaxSize; managementEnabled = parentConfig.managementEnabled; runRubyInProcess = parentConfig.runRubyInProcess; excludedMethods = parentConfig.excludedMethods; threadDumpSignal = parentConfig.threadDumpSignal; updateNativeENVEnabled = parentConfig.updateNativeENVEnabled; classCache = new ClassCache<Script>(loader, jitMax); try { environment = System.getenv(); } catch (SecurityException se) { environment = new HashMap(); } }
public RubyInstanceConfig(RubyInstanceConfig parentConfig) { isSecurityRestricted = parentConfig.isSecurityRestricted; currentDirectory = parentConfig.getCurrentDirectory(); compileMode = parentConfig.getCompileMode(); jitLogging = parentConfig.jitLogging; jitDumping = parentConfig.jitDumping; jitLoggingVerbose = parentConfig.jitLoggingVerbose; jitLogEvery = parentConfig.jitLogEvery; jitThreshold = parentConfig.jitThreshold; jitMax = parentConfig.jitMax; jitMaxSize = parentConfig.jitMaxSize; managementEnabled = parentConfig.managementEnabled; runRubyInProcess = parentConfig.runRubyInProcess; excludedMethods = parentConfig.excludedMethods; threadDumpSignal = parentConfig.threadDumpSignal; updateNativeENVEnabled = parentConfig.updateNativeENVEnabled; profilingService = parentConfig.profilingService; profilingMode = parentConfig.profilingMode; initEnvironment(); }
public RubyInstanceConfig(RubyInstanceConfig parentConfig) { isSecurityRestricted = parentConfig.isSecurityRestricted; currentDirectory = parentConfig.getCurrentDirectory(); compileMode = parentConfig.getCompileMode(); jitLogging = parentConfig.jitLogging; jitDumping = parentConfig.jitDumping; jitLoggingVerbose = parentConfig.jitLoggingVerbose; jitLogEvery = parentConfig.jitLogEvery; jitThreshold = parentConfig.jitThreshold; jitMax = parentConfig.jitMax; jitMaxSize = parentConfig.jitMaxSize; managementEnabled = parentConfig.managementEnabled; runRubyInProcess = parentConfig.runRubyInProcess; excludedMethods = parentConfig.excludedMethods; threadDumpSignal = parentConfig.threadDumpSignal; updateNativeENVEnabled = parentConfig.updateNativeENVEnabled; profilingService = parentConfig.profilingService; profilingMode = parentConfig.profilingMode; initEnvironment(); }
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; }
/** * Returns a current directory. * * The default current directory is identical to a value of "user.dir" system * property if no security restriction is set. If the "user.dir" directory is * protected by the security restriction, the default value is "/". * * @since JRuby 1.5.0. * * @return a current directory. */ public String getCurrentDirectory() { if (provider.isRuntimeInitialized()) { return provider.getRuntime().getCurrentDirectory(); } return provider.getRubyInstanceConfig().getCurrentDirectory(); }
/** * Returns a current directory. * * The default current directory is identical to a value of "user.dir" system * property if no security restriction is set. If the "user.dir" directory is * protected by the security restriction, the default value is "/". * * @since JRuby 1.5.0. * * @return a current directory. */ public String getCurrentDirectory() { if (provider.isRuntimeInitialized()) { return provider.getRuntime().getCurrentDirectory(); } return provider.getRubyInstanceConfig().getCurrentDirectory(); }
/** * Returns a current directory. * * The default current directory is identical to a value of "user.dir" system * property if no security restriction is set. If the "user.dir" directory is * protected by the security restriction, the default value is "/". * * @since JRuby 1.5.0. * * @return a current directory. */ public String getCurrentDirectory() { if (provider.isRuntimeInitialized()) { return provider.getRuntime().getCurrentDirectory(); } return provider.getRubyInstanceConfig().getCurrentDirectory(); }
/** * Returns a current directory. * * The default current directory is identical to a value of "user.dir" system * property if no security restriction is set. If the "user.dir" directory is * protected by the security restriction, the default value is "/". * * @since JRuby 1.5.0. * * @return a current directory. */ public String getCurrentDirectory() { if (provider.isRuntimeInitialized()) { return provider.getRuntime().getCurrentDirectory(); } return provider.getRubyInstanceConfig().getCurrentDirectory(); }
} else { final String script = getScriptFileName(); FileResource resource = JRubyFile.createRestrictedResource(getCurrentDirectory(), getScriptFileName()); if (resource != null && resource.exists()) { if (resource.canRead() && !resource.isDirectory()) {
} else { final String script = getScriptFileName(); FileResource resource = JRubyFile.createRestrictedResource(getCurrentDirectory(), getScriptFileName()); if (resource != null && resource.exists()) { if (resource.canRead() && !resource.isDirectory()) {
void reinitialize(boolean reinitCore) { this.doNotReverseLookupEnabled = true; this.staticScopeFactory = new StaticScopeFactory(this); this.in = config.getInput(); this.out = config.getOutput(); this.err = config.getError(); this.objectSpaceEnabled = config.isObjectSpaceEnabled(); this.siphashEnabled = config.isSiphashEnabled(); this.profile = config.getProfile(); this.currentDirectory = config.getCurrentDirectory(); this.kcode = config.getKCode(); if (reinitCore) { RubyGlobal.initARGV(this); RubyGlobal.initSTDIO(this, globalVariables); } }
void reinitialize(boolean reinitCore) { this.doNotReverseLookupEnabled = true; this.staticScopeFactory = new StaticScopeFactory(this); this.in = config.getInput(); this.out = config.getOutput(); this.err = config.getError(); this.objectSpaceEnabled = config.isObjectSpaceEnabled(); this.siphashEnabled = config.isSiphashEnabled(); this.profile = config.getProfile(); this.currentDirectory = config.getCurrentDirectory(); this.kcode = config.getKCode(); if (reinitCore) { RubyGlobal.initARGV(this); RubyGlobal.initSTDIO(this, globalVariables); } }
void reinitialize(boolean reinitCore) { this.is1_9 = config.getCompatVersion().is1_9(); this.is2_0 = config.getCompatVersion().is2_0(); this.doNotReverseLookupEnabled = is1_9; if (config.getCompileMode() == CompileMode.OFFIR || config.getCompileMode() == CompileMode.FORCEIR) { this.staticScopeFactory = new IRStaticScopeFactory(this); } else { this.staticScopeFactory = new StaticScopeFactory(this); } this.in = config.getInput(); this.out = config.getOutput(); this.err = config.getError(); this.objectSpaceEnabled = config.isObjectSpaceEnabled(); this.siphashEnabled = config.isSiphashEnabled(); this.profile = config.getProfile(); this.currentDirectory = config.getCurrentDirectory(); this.kcode = config.getKCode(); if (reinitCore) { RubyGlobal.initARGV(this); } }
void reinitialize(boolean reinitCore) { this.is1_9 = config.getCompatVersion().is1_9(); this.is2_0 = config.getCompatVersion().is2_0(); this.doNotReverseLookupEnabled = is1_9; if (config.getCompileMode() == CompileMode.OFFIR || config.getCompileMode() == CompileMode.FORCEIR) { this.staticScopeFactory = new IRStaticScopeFactory(this); } else { this.staticScopeFactory = new StaticScopeFactory(this); } this.in = config.getInput(); this.out = config.getOutput(); this.err = config.getError(); this.objectSpaceEnabled = config.isObjectSpaceEnabled(); this.siphashEnabled = config.isSiphashEnabled(); this.profile = config.getProfile(); this.currentDirectory = config.getCurrentDirectory(); this.kcode = config.getKCode(); if (reinitCore) { RubyGlobal.initARGV(this); } }