/** * Returns an error stream assigned to STDERR and $stderr. * * @since JRuby 1.5.0. * * @return output stream for error stream */ public PrintStream getError() { return provider.getRubyInstanceConfig().getError(); }
/** * Returns currently configured ProfileOutput object, which determines where * the output of profiling operations will be sent. (e.g., a file specified * by --profile.out). * * @since JRuby 1.7.15 * * @return current profiling output location. */ public ProfileOutput getProfileOutput() { return provider.getRubyInstanceConfig().getProfileOutput(); }
/** * Returns a record separator. The default value is "\n". * * @since JRuby 1.5.0. * * @return a record separator. */ public String getRecordSeparator() { return provider.getRubyInstanceConfig().getRecordSeparator(); }
/** * Returns a value of KCode currently used. The default value is KCode.NONE. * * @since JRuby 1.5.0. * * @return a KCode value. */ public KCode getKCode() { return provider.getRubyInstanceConfig().getKCode(); }
/** * Get whether native code is enabled for this config. * * @see Options#NATIVE_ENABLED * * @return true if native code is enabled; false otherwise. */ public boolean isNativeEnabled() { return provider.getRubyInstanceConfig().isNativeEnabled(); }
/** * Returns the value of n, which means that jitted methods are logged in * every n methods. The default value is 0. * * @since JRuby 1.5.0. * * @return a value that determines how often jitted methods are logged. */ public int getJitLogEvery() { return provider.getRubyInstanceConfig().getJitLogEvery(); }
/** * Returns a value of the threshold that determines whether jitted methods' * call reached to the limit or not. The default value is -1 when security * restriction is applied, or 50 when no security restriction exists. * * @since JRuby 1.5.0. * * @return a value of the threshold. */ public int getJitThreshold() { return provider.getRubyInstanceConfig().getJitThreshold(); }
/** * Returns a value of a max size of the bytecode generated by compiler. The * default value is -1 when security restriction is applied, or 10000 when * no security restriction exists. * * @since JRuby 1.5.0. * * @return a value of a max size of the bytecode. */ public int getJitMaxSize() { return provider.getRubyInstanceConfig().getJitMaxSize(); }
/** * Returns an input stream assigned to STDIN and $stdin. * * @since JRuby 1.5.0. * * @return input stream of STDIN and $stdin */ public InputStream getInput() { return provider.getRubyInstanceConfig().getInput(); }
/** * Tests whether Ruby runs in a process or not. * * @since JRuby 1.5.0. * * @return true if Ruby is configured to run in a process, otherwise, false. */ public boolean isRunRubyInProcess() { return provider.getRubyInstanceConfig().isRunRubyInProcess(); }
/** * Returns a map of environment variables. * * @since JRuby 1.5.0. * * @return a map that has environment variables' key-value pairs. */ public Map getEnvironment() { return provider.getRubyInstanceConfig().getEnvironment(); }
/** * Changes ProfileOutput to given one. The default value is a ProfileOutput * instance that writes to stderr. Similar to passing `--profile.out` from * the command line * * @since JRuby 1.7.15 * * @param out a new ProfileOutput object, to which profiling data should be written */ public void setProfileOutput(ProfileOutput out) { provider.getRubyInstanceConfig().setProfileOutput(out); }
/** * Returns a ProfilingMode currently used. The default value is ProfilingMode.OFF. * * @since JRuby 1.6.6. * * @return a current profiling mode. */ public ProfilingMode getProfilingMode() { return provider.getRubyInstanceConfig().getProfilingMode(); }
/** * Set whether native code is enabled for this config. Disabling it also * disables C extensions (@see RubyInstanceConfig#setCextEnabled). * * @see Options#NATIVE_ENABLED * * @param b new value indicating whether native code is enabled */ public void setNativeEnabled(boolean b) { provider.getRubyInstanceConfig().setNativeEnabled(b); }
/** * Returns an output stream assigned to STDOUT and $stdout. * * @since JRuby 1.5.0. * * @return an output stream of STDOUT and $stdout */ public PrintStream getOutput() { return provider.getRubyInstanceConfig().getOutput(); }
/** * Changes a class loader to a given loader. * Call this method before you use put/get, runScriptlet, and parse methods so that * the given class loader will be used. * * @since JRuby 1.5.0. * * @param loader a new class loader to be set. */ public void setClassLoader(ClassLoader loader) { provider.getRubyInstanceConfig().setLoader(loader); }
/** * Changes values of the arguments' list. * * @since JRuby 1.5.0. * * @param argv a new arguments' list. */ public void setArgv(String[] argv) { provider.getRubyInstanceConfig().setArgv(argv); }
private void initRubyInstanceConfig() throws RaiseException { String home = SafePropertyAccessor.getenv("JRUBY_HOME"); if (home != null) { provider.getRubyInstanceConfig().setJRubyHome(home); } provider.getRubyInstanceConfig().setScriptFileName("<script>"); }
/** * add the given classloader to the LOAD_PATH and GEM_PATH * @param classloader */ public void addClassLoader(ClassLoader classLoader) { getProvider().getRubyInstanceConfig().addLoader(classLoader); }
/** * add the classloader from the given bundle to the LOAD_PATH and the GEM_PATH * @param bundle */ public void addBundle(Bundle bundle) { getProvider().getRubyInstanceConfig().addLoader(new BundleGetResources(bundle)); }