This interface defines methods to configure Ruby runtime for embedding.
getArgv() · also: get_argvReturns an arguments' list.
Returns: an arguments' list.
setArgv(String[] argv) · also: set_argvChanges values of the arguments' list.
| name | type | description |
|---|---|---|
| argv | String[] | a new arguments' list. |
getClassLoader() · also: get_class_loaderReturns a class loader object that is currently used. This loader loads Ruby files and libraries.
Returns: a class loader object that is currently used.
setClassLoader(ClassLoader loader) · also: set_class_loaderChanges a class loader to a given loader.
| name | type | description |
|---|---|---|
| loader | ClassLoader | a new class loader to be set. |
Returns a compile mode currently chosen, which is one of CompileMode.JIT, CompileMode.FORCE, CompileMode.OFF. The default mode is CompileMode.OFF.
Returns: a compile mode.
setCompileMode(org.jruby.RubyInstanceConfig.CompileMode mode) · also: set_compile_modeChanges a compile mode to a given mode, which should be one of CompileMode.JIT, CompileMode.FORCE, CompileMode.OFF. The default value is CompileMode.OFF.
| name | type | description |
|---|---|---|
| mode | org.jruby.RubyInstanceConfig.CompileMode | compile mode |
getCurrentDirectory() · also: get_current_directoryReturns 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 "/".
Returns: a current directory.
setCurrentDirectory(String directory) · also: set_current_directoryChanges a current directory to a given directory.
| name | type | description |
|---|---|---|
| directory | String | a new directory to be set. |
getEnvironment() · also: get_environmentReturns a map of environment variables.
Returns: a map that has environment variables' key-value pairs.
setEnvironment(Map environment) · also: set_environmentChanges an environment variables' map.
| name | type | description |
|---|---|---|
| environment | Map | a new map of environment variables. |
getError() · also: get_errorReturns an error stream assigned to STDERR and $stderr.
Returns: output stream for error stream
setError(java.io.PrintStream pstream) · also: set_errorChanges STDERR and $stderr to a gievn print stream. The default standard error is java.lang.System.err.
| name | type | description |
|---|---|---|
| pstream | java.io.PrintStream | a print stream to be set |
setError(java.io.Writer writer) · also: set_errorChanges STDERR and $stderr to a given writer. No writer is set by default.
| name | type | description |
|---|---|---|
| writer | java.io.Writer | a writer to be set |
getHomeDirectory() · also: get_home_directoryReturns a JRuby home directory. The default JRuby home is the value of JRUBY_HOME environmet 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.
Returns: a JRuby home directory.
setHomeDirectory(String home) · also: set_home_directoryChanges a JRuby home directroy to a directory of a given name.
| name | type | description |
|---|---|---|
| home | String | a name of new JRuby home directory. |
getInput() · also: get_inputReturns an input stream assigned to STDIN and $stdin.
Returns: input stream of STDIN and $stdin
setInput(java.io.InputStream istream) · also: set_inputChanges STDIN and $stdin to a given input stream. The default standard input is java.lang.System.in.
| name | type | description |
|---|---|---|
| istream | java.io.InputStream | an input stream to be set |
setInput(java.io.Reader reader) · also: set_inputChanges STDIN and $stdin to a given reader. No reader is set by default.
| name | type | description |
|---|---|---|
| reader | java.io.Reader | a reader to be set |
getJitLogEvery() · also: get_jit_log_everyReturns the value of n, which means that jitted methods are logged in every n methods. The default value is 0.
Returns: a value that determines how often jitted methods are logged.
setJitLogEvery(int logEvery) · also: set_jit_log_everyChanges a value of n, so that jitted methods are logged in every n methods. The default value is 0. This value can be set by the jruby.jit.logEvery System property.
| name | type | description |
|---|---|---|
| log_every | int | a new number of methods. |
getJitMax() · also: get_jit_maxReturns a value of a max class cache size. The default value is 0 when security restriction is applied, or 4096 when no security restriction exists.
Returns: a value of a max class cache size.
setJitMax(int max) · also: set_jit_maxChanges a value of a max class cache size. The default value is 0 when security restriction is applied, or 4096 when no security restriction exists. This value can be set by jruby.jit.max System property.
| name | type | description |
|---|---|---|
| max | int | a new value of a max class cache size. |
getJitMaxSize() · also: get_jit_max_sizeReturns 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.
Returns: a value of a max size of the bytecode.
setJitMaxSize(int maxSize) · also: set_jit_max_sizeChanges 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. This value can be set by jruby.jit.maxsize System property.
| name | type | description |
|---|---|---|
| max_size | int | a new value of a max size of the bytecode. |
getJitThreshold() · also: get_jit_thresholdReturns 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.
Returns: a value of the threshold.
setJitThreshold(int threshold) · also: set_jit_thresholdChanges 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. This value can be set by jruby.jit.threshold System property.
| name | type | description |
|---|---|---|
| threshold | int | a new value of the threshold. |
Returns a value of KCode currently used. The default value is KCode.NONE.
Returns: a KCode value.
Changes a value of KCode to a given value. The default value is KCode.NONE.
| name | type | description |
|---|---|---|
| kcode | org.jruby.util.KCode | a new KCode value. |
getLoadPaths() · also: get_load_pathsReturns a list of load paths for Ruby scripts/libraries. If no paths is given, the list is created from java.class.path System property.
Returns: a list of load paths.
setLoadPaths(List<String> paths) · also: set_load_pathsChanges a list of load paths Ruby scripts/libraries. The default value is an empty array. If no paths is given, the list is created from java.class.path System property. This value can be set by org.jruby.embed.class.path System property.
| name | type | description |
|---|---|---|
| paths | List<String> | a new list of load paths. |
getLoadServiceCreator() · also: get_load_service_creatorReturns a LoadServiceCreator currently used.
Returns: a current LoadServiceCreator.
setLoadServiceCreator(org.jruby.RubyInstanceConfig.LoadServiceCreator creator) · also: set_load_service_creatorChanges a LoadServiceCreator to a given one.
| name | type | description |
|---|---|---|
| creator | org.jruby.RubyInstanceConfig.LoadServiceCreator | a new LoadServiceCreator |
setObjectSpaceEnabled(boolean enable) · also: set_object_space_enabledChanges the value to determine whether the Object Space is enabled or not. The default value is false. This value can be set by jruby.objectspace.enabled system property.
| name | type | description |
|---|---|---|
| enable | boolean | true to enable the Object Space, or false to disable. |
isObjectSpaceEnabled() · also: is_object_space_enabledTests whether the Object Space is enabled or not.
Returns: true if the Object Space is able to use, otherwise, false.
getOutput() · also: get_outputReturns an output stream assigned to STDOUT and $stdout
Returns: an output stream of STDOUT and $stdout
setOutput(java.io.PrintStream pstream) · also: set_outputChanges STDOUT and $stdout to a given output stream. The default standard output is java.lang.System.out.
| name | type | description |
|---|---|---|
| pstream | java.io.PrintStream | an output stream to be set |
setOutput(java.io.Writer writer) · also: set_outputChanges STDOUT and $stdout to a given writer. No writer is set by default.
| name | type | description |
|---|---|---|
| writer | java.io.Writer | a writer to be set |
Returns a profiler currently used. The default profiler is Profile.DEFAULT, which has the same behavior to Profile.ALL.
Returns: a current profiler.
Changes a profiler to a given one.
| name | type | description |
|---|---|---|
| profile | org.jruby.Profile | a new profiler to be set. |
getRecordSeparator() · also: get_record_separatorReturns a record separator. The default value is .
Returns: a record separator.
setRecordSeparator(String separator) · also: set_record_separatorChanges a record separator to a given value. If "0" is given, the record separator goes to "\n\n", "777" goes to "", otherwise, an octal value of the given number.
| name | type | description |
|---|---|---|
| separator | String | a new record separator value, "0" or "777" |
setRunRubyInProcess(boolean inprocess) · also: set_run_ruby_in_processChanges the value to determine whether Ruby runs in a process or not. The default value is true.
| name | type | description |
|---|---|---|
| inprocess | boolean | true when Ruby is set to run in the process, or false not to run in the process. |
isRunRubyInProcess() · also: is_run_ruby_in_processTests whether Ruby runs in a process or not.
Returns: true if Ruby is configured to run in a process, otherwise, false.
getScriptFilename() · also: get_script_filenameReturns a script filename to run. The default value is null.
Returns: a script filename.
setScriptFilename(String filename) · also: set_script_filenameChanges a script filename to run. The default value is null.
| name | type | description |
|---|---|---|
| filename | String | a new script filename. |
getSupportedRubyVersion() · also: get_supported_ruby_versionReturns version information about JRuby and Ruby supported by this platform.
Returns: version information.