jruby/docs BETA
Navigation
org.jruby.embed 16
E AttributeName
I EmbedEvalUnit
I EmbedRubyInstanceConfigAdapter
I EmbedRubyInterfaceAdapter
I EmbedRubyObjectAdapter
I EmbedRubyRuntimeAdapter
C EvalFailedException
A Extension
C InvokeFailedException
C IsolatedScriptingContainer
E LocalContextScope
E LocalVariableBehavior
C ParseFailedException
E PathType
E PropertyName
C ScriptingContainer
EmbedRubyInstanceConfigAdapter — members 46
M argv() String[]
C argv=(argv)
M class_loader() ClassLoader
C class_loader=(loader)
M compile_mode() CompileMode
C compile_mode=(mode)
M current_directory() String
C current_directory=(directory)
M environment() Map
C environment=(environment)
M error() PrintStream
C error=(pstream)
C error=(writer)
M home_directory() String
C home_directory=(home)
M input() InputStream
C input=(istream)
C input=(reader)
M jit_log_every() int
C jit_log_every=(log_every)
M jit_max() int
C jit_max=(max)
M jit_max_size() int
C jit_max_size=(max_size)
M jit_threshold() int
C jit_threshold=(threshold)
M k_code() KCode
C k_code=(kcode)
M load_paths() List<String>
C load_paths=(paths)
M load_service_creator() LoadServiceCreator
C load_service_creator=(creator)
C object_space_enabled=(enable)
M object_space_enabled?() boolean
M output() PrintStream
C output=(pstream)
C output=(writer)
M profile() Profile
C profile=(profile)
M record_separator() String
C record_separator=(separator)
C run_ruby_in_process=(inprocess)
M run_ruby_in_process?() boolean
M script_filename() String
C script_filename=(filename)
M supported_ruby_version() String

org.jruby.embed.EmbedRubyInstanceConfigAdapter

interface abstract 46 members

This interface defines methods to configure Ruby runtime for embedding.

Instance Methods

argv

String[] argv ( )
Java: getArgv() · also: get_argv

Returns an arguments' list.

Returns: an arguments' list.

argv=

argv= ( String[] argv )
Java: setArgv(String[] argv) · also: set_argv

Changes values of the arguments' list.

nametypedescription
argvString[]a new arguments' list.

class_loader

ClassLoader class_loader ( )
Java: getClassLoader() · also: get_class_loader

Returns a class loader object that is currently used. This loader loads Ruby files and libraries.

Returns: a class loader object that is currently used.

class_loader=

class_loader= ( ClassLoader loader )
Java: setClassLoader(ClassLoader loader) · also: set_class_loader

Changes a class loader to a given loader.

nametypedescription
loaderClassLoadera new class loader to be set.

compile_mode

RubyInstanceConfig.CompileMode compile_mode ( )
Java: getCompileMode() · also: get_compile_mode

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.

compile_mode=

compile_mode= ( RubyInstanceConfig.CompileMode mode )
Java: setCompileMode(org.jruby.RubyInstanceConfig.CompileMode mode) · also: set_compile_mode

Changes a compile mode to a given mode, which should be one of CompileMode.JIT, CompileMode.FORCE, CompileMode.OFF. The default value is CompileMode.OFF.

nametypedescription
modeorg.jruby.RubyInstanceConfig.CompileModecompile mode

current_directory

String current_directory ( )
Java: getCurrentDirectory() · also: get_current_directory

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 "/".

Returns: a current directory.

current_directory=

current_directory= ( String directory )
Java: setCurrentDirectory(String directory) · also: set_current_directory

Changes a current directory to a given directory.

nametypedescription
directoryStringa new directory to be set.

environment

Map environment ( )
Java: getEnvironment() · also: get_environment

Returns a map of environment variables.

Returns: a map that has environment variables' key-value pairs.

environment=

environment= ( Map environment )
Java: setEnvironment(Map environment) · also: set_environment

Changes an environment variables' map.

nametypedescription
environmentMapa new map of environment variables.

error

PrintStream error ( )
Java: getError() · also: get_error

Returns an error stream assigned to STDERR and $stderr.

Returns: output stream for error stream

error=

error= ( PrintStream pstream )
Java: setError(java.io.PrintStream pstream) · also: set_error

Changes STDERR and $stderr to a gievn print stream. The default standard error is java.lang.System.err.

nametypedescription
pstreamjava.io.PrintStreama print stream to be set

error=

error= ( Writer writer )
Java: setError(java.io.Writer writer) · also: set_error

Changes STDERR and $stderr to a given writer. No writer is set by default.

nametypedescription
writerjava.io.Writera writer to be set

home_directory

String home_directory ( )
Java: getHomeDirectory() · also: get_home_directory

Returns 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.

home_directory=

home_directory= ( String home )
Java: setHomeDirectory(String home) · also: set_home_directory

Changes a JRuby home directroy to a directory of a given name.

nametypedescription
homeStringa name of new JRuby home directory.

input

InputStream input ( )
Java: getInput() · also: get_input

Returns an input stream assigned to STDIN and $stdin.

Returns: input stream of STDIN and $stdin

input=

input= ( InputStream istream )
Java: setInput(java.io.InputStream istream) · also: set_input

Changes STDIN and $stdin to a given input stream. The default standard input is java.lang.System.in.

nametypedescription
istreamjava.io.InputStreaman input stream to be set

input=

input= ( Reader reader )
Java: setInput(java.io.Reader reader) · also: set_input

Changes STDIN and $stdin to a given reader. No reader is set by default.

nametypedescription
readerjava.io.Readera reader to be set

jit_log_every

int jit_log_every ( )
Java: getJitLogEvery() · also: get_jit_log_every

Returns 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.

jit_log_every=

jit_log_every= ( int log_every )
Java: setJitLogEvery(int logEvery) · also: set_jit_log_every

Changes 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.

nametypedescription
log_everyinta new number of methods.

jit_max

int jit_max ( )
Java: getJitMax() · also: get_jit_max

Returns 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.

jit_max=

jit_max= ( int max )
Java: setJitMax(int max) · also: set_jit_max

Changes 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.

nametypedescription
maxinta new value of a max class cache size.

jit_max_size

int jit_max_size ( )
Java: getJitMaxSize() · also: get_jit_max_size

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.

Returns: a value of a max size of the bytecode.

jit_max_size=

jit_max_size= ( int max_size )
Java: setJitMaxSize(int maxSize) · also: set_jit_max_size

Changes 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.

nametypedescription
max_sizeinta new value of a max size of the bytecode.

jit_threshold

int jit_threshold ( )
Java: getJitThreshold() · also: get_jit_threshold

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.

Returns: a value of the threshold.

jit_threshold=

jit_threshold= ( int threshold )
Java: setJitThreshold(int threshold) · also: set_jit_threshold

Changes 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.

nametypedescription
thresholdinta new value of the threshold.

k_code

KCode k_code ( )
Java: getKCode() · also: get_k_code

Returns a value of KCode currently used. The default value is KCode.NONE.

Returns: a KCode value.

k_code=

k_code= ( KCode kcode )
Java: setKCode(org.jruby.util.KCode kcode) · also: set_k_code

Changes a value of KCode to a given value. The default value is KCode.NONE.

nametypedescription
kcodeorg.jruby.util.KCodea new KCode value.

load_paths

List<String> load_paths ( )
Java: getLoadPaths() · also: get_load_paths

Returns 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.

load_paths=

load_paths= ( List<String> paths )
Java: setLoadPaths(List<String> paths) · also: set_load_paths

Changes 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.

nametypedescription
pathsList<String>a new list of load paths.

load_service_creator

RubyInstanceConfig.LoadServiceCreator load_service_creator ( )
Java: getLoadServiceCreator() · also: get_load_service_creator

Returns a LoadServiceCreator currently used.

Returns: a current LoadServiceCreator.

load_service_creator=

load_service_creator= ( RubyInstanceConfig.LoadServiceCreator creator )
Java: setLoadServiceCreator(org.jruby.RubyInstanceConfig.LoadServiceCreator creator) · also: set_load_service_creator

Changes a LoadServiceCreator to a given one.

nametypedescription
creatororg.jruby.RubyInstanceConfig.LoadServiceCreatora new LoadServiceCreator

object_space_enabled=

object_space_enabled= ( boolean enable )
Java: setObjectSpaceEnabled(boolean enable) · also: set_object_space_enabled

Changes 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.

nametypedescription
enablebooleantrue to enable the Object Space, or false to disable.

object_space_enabled?

boolean object_space_enabled? ( )
Java: isObjectSpaceEnabled() · also: is_object_space_enabled

Tests whether the Object Space is enabled or not.

Returns: true if the Object Space is able to use, otherwise, false.

output

PrintStream output ( )
Java: getOutput() · also: get_output

Returns an output stream assigned to STDOUT and $stdout

Returns: an output stream of STDOUT and $stdout

output=

output= ( PrintStream pstream )
Java: setOutput(java.io.PrintStream pstream) · also: set_output

Changes STDOUT and $stdout to a given output stream. The default standard output is java.lang.System.out.

nametypedescription
pstreamjava.io.PrintStreaman output stream to be set

output=

output= ( Writer writer )
Java: setOutput(java.io.Writer writer) · also: set_output

Changes STDOUT and $stdout to a given writer. No writer is set by default.

nametypedescription
writerjava.io.Writera writer to be set

profile

Profile profile ( )
Java: getProfile() · also: get_profile

Returns a profiler currently used. The default profiler is Profile.DEFAULT, which has the same behavior to Profile.ALL.

Returns: a current profiler.

profile=

profile= ( Profile profile )
Java: setProfile(org.jruby.Profile profile) · also: set_profile

Changes a profiler to a given one.

nametypedescription
profileorg.jruby.Profilea new profiler to be set.

record_separator

String record_separator ( )
Java: getRecordSeparator() · also: get_record_separator

Returns a record separator. The default value is .

Returns: a record separator.

record_separator=

record_separator= ( String separator )
Java: setRecordSeparator(String separator) · also: set_record_separator

Changes 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.

nametypedescription
separatorStringa new record separator value, "0" or "777"

run_ruby_in_process=

run_ruby_in_process= ( boolean inprocess )
Java: setRunRubyInProcess(boolean inprocess) · also: set_run_ruby_in_process

Changes the value to determine whether Ruby runs in a process or not. The default value is true.

nametypedescription
inprocessbooleantrue when Ruby is set to run in the process, or false not to run in the process.

run_ruby_in_process?

boolean run_ruby_in_process? ( )
Java: isRunRubyInProcess() · also: is_run_ruby_in_process

Tests whether Ruby runs in a process or not.

Returns: true if Ruby is configured to run in a process, otherwise, false.

script_filename

String script_filename ( )
Java: getScriptFilename() · also: get_script_filename

Returns a script filename to run. The default value is null.

Returns: a script filename.

script_filename=

script_filename= ( String filename )
Java: setScriptFilename(String filename) · also: set_script_filename

Changes a script filename to run. The default value is null.

nametypedescription
filenameStringa new script filename.

supported_ruby_version

String supported_ruby_version ( )
Java: getSupportedRubyVersion() · also: get_supported_ruby_version

Returns version information about JRuby and Ruby supported by this platform.

Returns: version information.