public final class Ruby extends java.lang.Object implements Constantizable
Modifier and Type | Class and Description |
---|---|
class |
Ruby.CallTraceFuncHook |
static interface |
Ruby.ObjectSpacer |
static interface |
Ruby.RecursiveFunction
Deprecated.
|
static interface |
Ruby.RecursiveFunctionEx<T> |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ERRNO_BACKTRACE_MESSAGE |
static int |
NIL_PREFILLED_ARRAY_SIZE |
java.lang.ClassValue<TypePopulator> |
POPULATORS |
JavaSites |
sites |
static java.lang.String |
STOPIERATION_BACKTRACE_MESSAGE |
Modifier and Type | Method and Description |
---|---|
void |
addBoundMethod(java.lang.String className,
java.lang.String methodName,
java.lang.String rubyName) |
void |
addBoundMethods(java.lang.String className,
java.lang.String... tuples) |
void |
addBoundMethodsPacked(java.lang.String className,
java.lang.String packedTuples)
Deprecated.
|
void |
addEventHook(EventHook hook) |
void |
addFinalizer(Finalizable finalizer) |
void |
addInternalFinalizer(Finalizable finalizer) |
void |
addModule(RubyModule module) |
void |
addSimpleBoundMethodsPacked(java.lang.String className,
java.lang.String packedNames)
Deprecated.
|
void |
addToObjectSpace(boolean useObjectSpace,
IRubyObject object) |
int |
allocModuleId() |
int |
allocSymbolId() |
void |
callEventHooks(ThreadContext context,
RubyEvent event,
java.lang.String file,
int line,
java.lang.String name,
IRubyObject type) |
void |
checkSafeString(IRubyObject object)
Deprecated.
|
static void |
clearGlobalRuntime()
Clear the global runtime.
|
void |
compileAndLoadFile(java.lang.String filename,
java.io.InputStream in,
boolean wrap) |
java.lang.Object |
constant() |
RubyClass |
defineClass(java.lang.String name,
RubyClass superClass,
ObjectAllocator allocator)
Define a new class under the Object namespace.
|
RubyClass |
defineClass(java.lang.String name,
RubyClass superClass,
ObjectAllocator allocator,
CallSite[] callSites)
A variation of defineClass that allows passing in an array of supplementary
call sites for improving dynamic invocation performance.
|
RubyClass |
defineClassUnder(java.lang.String name,
RubyClass superClass,
ObjectAllocator allocator,
RubyModule parent)
Define a new class with the given name under the given module or class
namespace.
|
RubyClass |
defineClassUnder(java.lang.String id,
RubyClass superClass,
ObjectAllocator allocator,
RubyModule parent,
CallSite[] callSites)
A variation of defineClassUnder that allows passing in an array of
supplementary call sites to improve dynamic invocation.
|
void |
defineGlobalConstant(java.lang.String name,
IRubyObject value)
rb_define_global_const
Define a constant on the global namespace (i.e.
|
RubyModule |
defineModule(java.lang.String name)
Define a new module under the Object namespace.
|
RubyModule |
defineModuleUnder(java.lang.String name,
RubyModule parent)
Define a new module with the given name under the given module or
class namespace.
|
void |
defineReadonlyVariable(java.lang.String name,
IRubyObject value,
GlobalVariable.Scope scope)
defines a readonly global variable
|
void |
defineVariable(GlobalVariable variable,
GlobalVariable.Scope scope)
Defines a global variable
|
void |
eachModule(java.util.function.Consumer<RubyModule> func) |
void |
eachModule(Function1<java.lang.Object,IRubyObject> func)
Deprecated.
|
IRubyObject |
evalScriptlet(java.lang.String script)
Evaluates a script under the current scope (perhaps the top-level
scope) and returns the result (generally the last value calculated).
|
IRubyObject |
evalScriptlet(java.lang.String script,
DynamicScope scope)
Evaluates a script under the current scope (perhaps the top-level
scope) and returns the result (generally the last value calculated).
|
IRubyObject |
execRecursive(Ruby.RecursiveFunction func,
IRubyObject obj)
Deprecated.
|
IRubyObject |
execRecursiveOuter(Ruby.RecursiveFunction func,
IRubyObject obj)
Deprecated.
Use ThreadContext.safeRecurse.
|
IRubyObject |
executeScript(java.lang.String script,
java.lang.String filename)
Parse and execute the specified script
This differs from the other methods in that it accepts a string-based script and
parses and runs it as though it were loaded at a command-line.
|
RubyClass |
fastGetClass(java.lang.String internedName)
Deprecated.
|
RubyModule |
fastGetModule(java.lang.String internedName)
Deprecated.
|
RubySymbol |
fastNewSymbol(java.lang.String internedName)
Faster than
newSymbol(String) if you already have an interned
name String. |
IRubyObject |
fetchGlobalConstant(java.lang.String name)
Fetch a constant from the global namespace (i.e.
|
RubyString |
freezeAndDedupString(RubyString string)
Given a Ruby string, cache a frozen, duplicated copy of it, or find an
existing copy already prepared.
|
IRubyObject |
getArgsFile() |
RubyClass |
getArgumentError() |
RubyClass |
getArray() |
int |
getBacktraceCount()
Get the current backtrace count.
|
DynamicMethod |
getBaseNewMethod()
Get the base Class#new method.
|
RubyClass |
getBasicObject() |
BeanManager |
getBeanManager() |
RubyClass |
getBignum() |
RubyClass |
getBinding() |
java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> |
getBoundMethods() |
java.util.List<StrptimeToken> |
getCachedStrptimePattern(java.lang.String pattern) |
Caches |
getCaches()
Get the Caches management object.
|
int |
getCallerCount()
Get the current backtrace count.
|
RubyHash |
getCharsetMap()
Deprecated.
|
Invalidator |
getCheckpointInvalidator() |
RubyClass |
getClass(java.lang.String name)
Retrieve the class with the given name from the Object namespace.
|
RubyClass |
getClassClass() |
RubyModule |
getClassFromPath(java.lang.String path) |
static java.lang.ClassLoader |
getClassLoader() |
RubyModule |
getComparable() |
RubyClass |
getComplex() |
RubyClass |
getConcurrencyError() |
int |
getConstantGeneration()
Deprecated.
|
Invalidator |
getConstantInvalidator(java.lang.String constantName) |
RubyClass |
getContinuation() |
RubyClass |
getConverter() |
RubyClass |
getConverterNotFoundError() |
CoverageData |
getCoverageData() |
ThreadContext |
getCurrentContext() |
java.lang.String |
getCurrentDirectory() |
static Ruby |
getCurrentInstance()
Deprecated.
|
int |
getCurrentLine() |
RubyClass |
getData() |
IRubyObject |
getDebug()
Getter for property isDebug.
|
java.nio.charset.Charset |
getDefaultCharset()
Get the default java.nio.charset.Charset for the current default internal encoding.
|
org.jcodings.Encoding |
getDefaultEncoding()
Return the default internal encoding, if set, or UTF-8 by default.
|
org.jcodings.Encoding |
getDefaultExternalEncoding() |
org.jcodings.Encoding |
getDefaultFilesystemEncoding() |
static Ruby |
getDefaultInstance()
Deprecated.
use #newInstance()
|
org.jcodings.Encoding |
getDefaultInternalEncoding()
This is an internal encoding if actually specified via default_internal=
or passed in via -E.
|
DynamicMethod |
getDefaultMethodMissing() |
RubyRandom.RandomType |
getDefaultRand()
Deprecated.
internal API, to be hidden
|
RubyThreadGroup |
getDefaultThreadGroup() |
RubyString |
getDefinedMessage(DefinedMessage definedMessage) |
RubyClass |
getDir() |
RubyClass |
getDummy() |
RubyArray |
getEmptyFrozenArray() |
RubyClass |
getEncoding() |
RubyClass |
getEncodingCompatibilityError() |
RubyClass |
getEncodingError() |
EncodingService |
getEncodingService() |
RubyModule |
getEnumerable() |
RubyClass |
getEnumerator() |
RubyHash |
getENV() |
RubyClass |
getEOFError() |
java.io.PrintStream |
getErr() |
RubyModule |
getErrno() |
RubyClass |
getErrno(int n) |
java.io.PrintStream |
getErrorStream() |
RubyModule |
getEtc() |
RubyClass |
getException() |
int |
getExceptionCount()
Get the current exception count.
|
java.util.concurrent.ExecutorService |
getExecutor() |
RubyBoolean |
getFalse()
Returns the "false" instance from the instance pool.
|
RubyClass |
getFalseClass() |
RubyClass |
getFatal() |
FFI |
getFFI() |
RubyClass |
getFiber() |
RubyClass |
getFiberError() |
java.util.concurrent.ExecutorService |
getFiberExecutor() |
RubyClass |
getFile() |
FilenoUtil |
getFilenoUtil() |
RubyClass |
getFileStat() |
RubyModule |
getFileTest() |
RubyClass |
getFixnum() |
Invalidator |
getFixnumInvalidator()
Retrieve the invalidator for Fixnum reopening
|
RubyClass |
getFloat() |
RubyClass |
getFloatDomainError() |
Invalidator |
getFloatInvalidator()
Retrieve the invalidator for Float reopening
|
RubyClass |
getFrozenError() |
RubyModule |
getGC() |
RubyClass |
getGenerator() |
static Ruby |
getGlobalRuntime()
Get the global runtime.
|
long |
getGlobalState()
Deprecated.
|
GlobalVariables |
getGlobalVariables() |
IRubyObject |
getGroupStruct() |
RubyClass |
getHash() |
long |
getHashSeedK0() |
long |
getHashSeedK1() |
java.lang.Object |
getHierarchyLock()
Get the global object used to synchronize class-hierarchy modifications like
cache invalidation, subclass sets, and included hierarchy sets.
|
java.io.InputStream |
getIn() |
RubyClass |
getIndexError() |
java.io.InputStream |
getInputStream() |
RubyInstanceConfig |
getInstanceConfig() |
RubyClass |
getInteger() |
RubyClass |
getInterrupt() |
RubyClass |
getInterruptedRegexpError() |
RubyClass |
getInvalidByteSequenceError() |
RubyClass |
getIO() |
RubyClass |
getIOError() |
IRManager |
getIRManager() |
java.util.Map<java.lang.Class,java.util.function.Consumer<RubyModule>> |
getJavaExtensionDefinitions() |
JavaProxyClassFactory |
getJavaProxyClassFactory() |
JavaSupport |
getJavaSupport() |
JITCompiler |
getJITCompiler() |
JRubyClassLoader |
getJRubyClassLoader() |
java.lang.String |
getJRubyHome() |
KCode |
getKCode() |
RubyModule |
getKernel() |
RubyClass |
getKeyError() |
RubyClass |
getLoadError() |
LoadService |
getLoadService()
Returns the loadService.
|
RubyClass |
getLocalJumpError() |
RubyClass |
getLocation() |
RubyModule |
getMarshal() |
RubyClass |
getMatchData() |
RubyModule |
getMath() |
RubyClass |
getMathDomainError() |
RubyClass |
getMethod() |
RubyClass |
getModule() |
RubyModule |
getModule(java.lang.String name)
Retrieve the module with the given name from the Object namespace.
|
RubyClass |
getNameError() |
RubyClass |
getNameErrorMessage() |
RubyClass |
getNativeException() |
long |
getNextDynamicMethodSerial()
Get a new serial number for a new DynamicMethod instance
|
int |
getNextModuleGeneration()
Get a new generation number for a module or class.
|
IRubyObject |
getNil()
Returns the "nil" singleton instance.
|
RubyClass |
getNilClass() |
IRubyObject[] |
getNilPrefilledArray() |
RubyClass |
getNoMemoryError() |
RubyClass |
getNoMethodError() |
DynamicMethod |
getNormalMethodMissing() |
RubyClass |
getNotImplementedError() |
java.lang.invoke.MethodHandle |
getNullToNilHandle()
Get the "nullToNil" method handle filter for this runtime.
|
RubyClass |
getNumeric() |
RubyClass |
getObject() |
ObjectSpace |
getObjectSpace() |
RubyModule |
getObjectSpaceModule() |
RubyModule |
getOrCreateModule(java.lang.String id)
From Object, retrieve the named module.
|
java.io.PrintStream |
getOut() |
java.io.PrintStream |
getOutputStream() |
Parser |
getParser() |
IRubyObject |
getPasswdStruct() |
jnr.posix.POSIX |
getPosix() |
RubyModule |
getPrecision() |
DynamicMethod |
getPrivateMethodMissing() |
RubyClass |
getProc() |
RubyModule |
getProcess() |
RubyModule |
getProcGID() |
RubyClass |
getProcStatus() |
RubyModule |
getProcSysModule() |
RubyModule |
getProcUID() |
Profile |
getProfile() |
ProfiledMethods |
getProfiledMethods()
Deprecated.
|
ProfilingService |
getProfilingService() |
DynamicMethod |
getProtectedMethodMissing() |
java.util.Random |
getRandom()
Deprecated.
internal API, to be removed
|
RubyClass |
getRandomClass() |
RubyClass |
getRange() |
RubyClass |
getRangeError() |
RubyClass |
getRational() |
GlobalVariable |
getRecordSeparatorVar() |
RubyClass |
getRegexp() |
RubyClass |
getRegexpError() |
IRubyObject |
getReportOnException() |
DynamicMethod |
getRespondToMethod() |
DynamicMethod |
getRespondToMissingMethod() |
IRubyObject |
getRootFiber() |
RuntimeCache |
getRuntimeCache()
Get the core class RuntimeCache instance, for doing dynamic calls from
core class methods.
|
RubyClass |
getRuntimeError() |
int |
getRuntimeNumber() |
int |
getSafeLevel()
Deprecated.
|
RubyClass |
getSecurityError() |
SelectorPool |
getSelectorPool()
Get the runtime-global selector pool
|
RubyClass |
getSignalException() |
IRubyObject[] |
getSingleNilArray() |
RubyClass |
getStandardError() |
long |
getStartTime() |
StaticScopeFactory |
getStaticScopeFactory() |
RubyClass |
getStopIteration() |
RubyClass |
getString() |
RubyClass |
getStructClass() |
DynamicMethod |
getSuperMethodMissing() |
RubyClass |
getSymbol() |
RubySymbol.SymbolTable |
getSymbolTable() |
RubyClass |
getSyntaxError() |
RubyClass |
getSystemCallError() |
RubyClass |
getSystemExit() |
RubyClass |
getSystemStackError() |
RubyClass |
getThread() |
RubyClass |
getThreadError() |
RubyClass |
getThreadGroup() |
static Ruby |
getThreadLocalRuntime()
Get the thread-local runtime for the current thread, or null if unset.
|
ThreadService |
getThreadService() |
RubyString |
getThreadStatus(RubyThread.Status status) |
RubyClass |
getTime() |
java.util.Map<java.lang.String,org.joda.time.DateTimeZone> |
getTimezoneCache() |
IRubyObject |
getTmsStruct() |
IRubyObject |
getTopSelf()
Getter for property rubyTopSelf.
|
RubyBoolean |
getTrue()
Returns the "true" instance from the instance pool.
|
RubyClass |
getTrueClass() |
RubyClass |
getTypeError() |
RubyClass |
getUnboundMethod() |
RubyClass |
getUncaughtThrowError() |
RubyClass |
getUndefinedConversionError() |
DynamicMethod |
getVariableMethodMissing() |
IRubyObject |
getVerbose()
Getter for property isVerbose.
|
RubyModule |
getWarning() |
int |
getWarningCount()
Get the current backtrace count.
|
RubyWarnings |
getWarnings() |
RubyClass |
getYielder() |
RubyClass |
getZeroDivisionError() |
boolean |
hasEventHooks() |
void |
incGlobalState()
Deprecated.
|
void |
incrementBacktraceCount()
Increment the count of backtraces generated by code in this runtime.
|
void |
incrementCallerCount()
Increment the count of backtraces generated by code in this runtime.
|
void |
incrementExceptionCount()
Increment the count of exceptions generated by code in this runtime.
|
void |
incrementWarningCount()
Increment the count of backtraces generated for warnings in this runtime.
|
boolean |
is1_8()
Deprecated.
|
boolean |
is1_9()
Deprecated.
|
boolean |
is2_0()
Deprecated.
|
boolean |
isBooting() |
boolean |
isBootingCore() |
boolean |
isClassDefined(java.lang.String name) |
boolean |
isDebug() |
boolean |
isDefaultMethodMissing(DynamicMethod method) |
boolean |
isDoNotReverseLookupEnabled() |
boolean |
isFixnumReopened()
Whether the Float class has been reopened and modified
|
boolean |
isFloatReopened()
Whether the Float class has been reopened and modified
|
boolean |
isGlobalAbortOnExceptionEnabled() |
static boolean |
isGlobalRuntimeReady()
Tests whether globalRuntime has been instantiated or not.
|
boolean |
isInspecting(java.lang.Object obj) |
boolean |
isObjectSpaceEnabled() |
static boolean |
isSecurityRestricted() |
boolean |
isSiphashEnabled() |
boolean |
isVerbose() |
<E extends java.lang.Enum<E>> |
loadConstantSet(RubyModule module,
java.lang.Class<E> enumClass) |
void |
loadConstantSet(RubyModule module,
java.lang.String constantSetName) |
void |
loadExtension(java.lang.String extName,
BasicLibraryService extension,
boolean wrap)
Load the given BasicLibraryService instance, wrapping it in Ruby framing
to ensure it is isolated from any parent scope.
|
void |
loadFile(java.lang.String scriptName,
java.io.InputStream in,
boolean wrap) |
JavaSupport |
loadJavaSupport() |
void |
loadScope(IRScope scope,
boolean wrap) |
void |
loadScript(Script script) |
void |
loadScript(Script script,
boolean wrap) |
RaiseException |
newArgumentError(int got,
int expected) |
RaiseException |
newArgumentError(int got,
int min,
int max) |
RaiseException |
newArgumentError(java.lang.String message) |
RaiseException |
newArgumentError(java.lang.String name,
int got,
int expected) |
RaiseException |
newArgumentError(java.lang.String name,
int got,
int min,
int max) |
RubyArray |
newArray() |
RubyArray |
newArray(int size) |
RubyArray |
newArray(IRubyObject... objects) |
RubyArray |
newArray(IRubyObject object) |
RubyArray |
newArray(IRubyObject car,
IRubyObject cdr) |
RubyArray |
newArray(java.util.List<IRubyObject> list) |
RubyArray |
newArrayLight() |
RubyArray |
newArrayNoCopy(IRubyObject... objects) |
RubyArray |
newArrayNoCopyLight(IRubyObject... objects) |
RubyBinding |
newBinding() |
RubyBinding |
newBinding(Binding binding) |
RubyProc |
newBlockPassProc(Block.Type type,
Block block) |
RubyBoolean |
newBoolean(boolean value) |
RaiseException |
newConcurrencyError(java.lang.String message) |
RaiseException |
newConverterNotFoundError(java.lang.String message) |
RubyObject.Data |
newData(RubyClass objectClass,
java.lang.Object sval) |
RubyArray |
newEmptyArray() |
RaiseException |
newEncodingCompatibilityError(java.lang.String message) |
RaiseException |
newEncodingError(java.lang.String message) |
RaiseException |
newEOFError() |
RaiseException |
newEOFError(java.lang.String message) |
RaiseException |
newErrnoEACCESError(java.lang.String message) |
RaiseException |
newErrnoEADDRFromBindException(java.net.BindException be) |
RaiseException |
newErrnoEADDRFromBindException(java.net.BindException be,
java.lang.String contextMessage) |
RaiseException |
newErrnoEADDRINUSEError() |
RaiseException |
newErrnoEADDRINUSEError(java.lang.String message) |
RaiseException |
newErrnoEADDRNOTAVAILError(java.lang.String message) |
RaiseException |
newErrnoEAFNOSUPPORTError(java.lang.String message) |
RaiseException |
newErrnoEAGAINError(java.lang.String message) |
RaiseException |
newErrnoEAGAINReadableError(java.lang.String message) |
RaiseException |
newErrnoEAGAINWritableError(java.lang.String message) |
RaiseException |
newErrnoEBADFError() |
RaiseException |
newErrnoEBADFError(java.lang.String message) |
RaiseException |
newErrnoECHILDError() |
RaiseException |
newErrnoECONNABORTEDError() |
RaiseException |
newErrnoECONNREFUSEDError() |
RaiseException |
newErrnoECONNREFUSEDError(java.lang.String message) |
RaiseException |
newErrnoECONNRESETError() |
RaiseException |
newErrnoEDESTADDRREQError(java.lang.String func) |
RaiseException |
newErrnoEDOMError(java.lang.String message) |
RaiseException |
newErrnoEEXISTError(java.lang.String message) |
RaiseException |
newErrnoEHOSTUNREACHError(java.lang.String message) |
RaiseException |
newErrnoEINPROGRESSError() |
RaiseException |
newErrnoEINPROGRESSError(java.lang.String message) |
RaiseException |
newErrnoEINPROGRESSWritableError() |
RaiseException |
newErrnoEINPROGRESSWritableError(java.lang.String message) |
RaiseException |
newErrnoEINTRError() |
RaiseException |
newErrnoEINVALError() |
RaiseException |
newErrnoEINVALError(java.lang.String message) |
RaiseException |
newErrnoEISCONNError() |
RaiseException |
newErrnoEISCONNError(java.lang.String message) |
RaiseException |
newErrnoEISDirError() |
RaiseException |
newErrnoEISDirError(java.lang.String message) |
RaiseException |
newErrnoELOOPError() |
RaiseException |
newErrnoEMFILEError() |
RaiseException |
newErrnoEMSGSIZEError() |
RaiseException |
newErrnoENETUNREACHError() |
RaiseException |
newErrnoENFILEError() |
RaiseException |
newErrnoENOENTError() |
RaiseException |
newErrnoENOENTError(java.lang.String message) |
RaiseException |
newErrnoENOPROTOOPTError() |
RaiseException |
newErrnoENOTCONNError() |
RaiseException |
newErrnoENOTCONNError(java.lang.String message) |
RaiseException |
newErrnoENOTDIRError(java.lang.String message) |
RaiseException |
newErrnoENOTEMPTYError(java.lang.String message) |
RaiseException |
newErrnoENOTSOCKError(java.lang.String message) |
RaiseException |
newErrnoEOPNOTSUPPError(java.lang.String message) |
RaiseException |
newErrnoEPERMError(java.lang.String name) |
RaiseException |
newErrnoEPIPEError() |
RaiseException |
newErrnoESPIPEError() |
RaiseException |
newErrnoESPIPEError(java.lang.String message) |
RaiseException |
newErrnoESRCHError() |
RaiseException |
newErrnoEWOULDBLOCKError() |
RaiseException |
newErrnoEXDEVError(java.lang.String message) |
RaiseException |
newErrnoFromErrno(jnr.constants.platform.Errno errno,
java.lang.String message) |
RaiseException |
newErrnoFromInt(int errno) |
RaiseException |
newErrnoFromInt(int errno,
java.lang.String message) |
RaiseException |
newErrnoFromInt(int errno,
java.lang.String methodName,
java.lang.String message) |
RaiseException |
newErrnoFromLastPOSIXErrno() |
RaiseException |
newFiberError(java.lang.String message) |
RubyFileStat |
newFileStat(java.io.FileDescriptor descriptor) |
RubyFileStat |
newFileStat(java.lang.String filename,
boolean lstat) |
RubyFixnum |
newFixnum(jnr.constants.Constant value) |
RubyFixnum |
newFixnum(int value) |
RubyFixnum |
newFixnum(long value) |
RubyFloat |
newFloat(double value) |
RaiseException |
newFloatDomainError(java.lang.String message) |
RaiseException |
newFrozenError(RubyModule type) |
RaiseException |
newFrozenError(java.lang.String objectType) |
RaiseException |
newFrozenError(java.lang.String objectType,
boolean runtimeError) |
RaiseException |
newIllegalSequence(java.lang.String message)
Deprecated.
|
RaiseException |
newIndexError(java.lang.String message) |
static Ruby |
newInstance()
Returns a new instance of the JRuby runtime configured with defaults.
|
static Ruby |
newInstance(java.io.InputStream in,
java.io.PrintStream out,
java.io.PrintStream err)
Returns a new instance of the JRuby runtime configured with the given
input, output and error streams and otherwise default configuration
(except where specified system properties alter defaults).
|
static Ruby |
newInstance(RubyInstanceConfig config)
Returns a new instance of the JRuby runtime configured as specified.
|
RaiseException |
newInterruptedRegexpError(java.lang.String message) |
RaiseException |
newInvalidByteSequenceError(java.lang.String message) |
RaiseException |
newInvalidEncoding(java.lang.String message)
Deprecated.
|
RaiseException |
newIOError(java.lang.String message) |
RaiseException |
newIOErrorFromException(java.io.IOException ex)
Java does not give us enough information for specific error conditions
so we are reduced to divining them through string matches...
|
RaiseException |
newKeyError(java.lang.String message,
IRubyObject recv,
IRubyObject key) |
RaiseException |
newLightweightStopIterationError(java.lang.String message)
Deprecated.
|
RaiseException |
newLoadError(java.lang.String message) |
RaiseException |
newLoadError(java.lang.String message,
java.lang.String path) |
RaiseException |
newLocalJumpError(RubyLocalJumpError.Reason reason,
IRubyObject exitValue,
java.lang.String message) |
RaiseException |
newLocalJumpErrorNoBlock() |
RaiseException |
newMathDomainError(java.lang.String message) |
RaiseException |
newNameError(java.lang.String message,
IRubyObject recv,
IRubyObject name) |
RaiseException |
newNameError(java.lang.String message,
IRubyObject recv,
IRubyObject name,
boolean privateCall)
Construct a NameError that formats its message with an sprintf format string.
|
RaiseException |
newNameError(java.lang.String message,
IRubyObject recv,
java.lang.String name)
Construct a NameError that formats its message with an sprintf format string.
|
RaiseException |
newNameError(java.lang.String message,
IRubyObject recv,
java.lang.String name,
boolean privateCall)
Construct a NameError that formats its message with an sprintf format string and has private_call? set to given.
|
RaiseException |
newNameError(java.lang.String message,
java.lang.String name)
Construct a NameError with a pre-formatted message and name.
|
RaiseException |
newNameError(java.lang.String message,
java.lang.String name,
java.lang.Throwable origException)
Construct a NameError with an optional originating exception and a pre-formatted message.
|
RaiseException |
newNameError(java.lang.String message,
java.lang.String name,
java.lang.Throwable exception,
boolean printWhenVerbose)
Construct a NameError with the given pre-formatted message, name, and optional original exception.
|
RaiseException |
newNameErrorObject(java.lang.String message,
IRubyObject name)
Deprecated.
|
RaiseException |
newNoMethodError(java.lang.String message,
IRubyObject recv,
java.lang.String name,
RubyArray args) |
RaiseException |
newNoMethodError(java.lang.String message,
IRubyObject recv,
java.lang.String name,
RubyArray args,
boolean privateCall)
Construct a NoMethodError that formats its message with an sprintf format string.
|
RaiseException |
newNoMethodError(java.lang.String message,
java.lang.String name,
IRubyObject args)
Construct a NoMethodError with a pre-formatted message.
|
RaiseException |
newNotImplementedError(java.lang.String message) |
RubyNumeric |
newNumeric() |
RubyProc |
newProc(Block.Type type,
Block block) |
RaiseException |
newRaiseException(RubyClass exceptionClass,
java.lang.String message) |
RaiseException |
newRangeError(java.lang.String message) |
RubyRational |
newRational(long num,
long den) |
RubyRational |
newRationalReduced(long num,
long den) |
RaiseException |
newRedoLocalJumpError() |
RaiseException |
newRegexpError(java.lang.String message) |
RaiseException |
newRuntimeError(java.lang.String message) |
RaiseException |
newSecurityError(java.lang.String message) |
RaiseException |
newStandardError(java.lang.String message) |
RaiseException |
newStopIteration(IRubyObject result,
java.lang.String message)
Generate a StopIteration exception.
|
RubyString |
newString() |
RubyString |
newString(ByteList byteList) |
RubyString |
newString(java.lang.String string) |
RubyString |
newStringShared(ByteList byteList)
Deprecated.
|
RubySymbol |
newSymbol(ByteList name) |
RubySymbol |
newSymbol(java.lang.String name) |
RubySymbol |
newSymbol(java.lang.String name,
org.jcodings.Encoding encoding) |
RaiseException |
newSyntaxError(java.lang.String message) |
RaiseException |
newSystemCallError(java.lang.String message) |
RaiseException |
newSystemExit(int status) |
RaiseException |
newSystemExit(int status,
java.lang.String message) |
RaiseException |
newSystemStackError(java.lang.String message) |
RaiseException |
newSystemStackError(java.lang.String message,
java.lang.StackOverflowError error) |
RaiseException |
newThreadError(java.lang.String message) |
RubyTime |
newTime(long milliseconds) |
RaiseException |
newTypeError(IRubyObject receivedObject,
RubyClass expectedType) |
RaiseException |
newTypeError(IRubyObject receivedObject,
RubyModule expectedType) |
RaiseException |
newTypeError(IRubyObject receivedObject,
java.lang.String expectedType) |
RaiseException |
newTypeError(java.lang.String message) |
RaiseException |
newUndefinedConversionError(java.lang.String message) |
RaiseException |
newZeroDivisionError() |
Node |
parse(ByteList content,
java.lang.String file,
DynamicScope scope,
int lineNumber,
boolean extraPositionInformation) |
Node |
parse(java.lang.String content,
java.lang.String file,
DynamicScope scope,
int lineNumber,
boolean extraPositionInformation)
Deprecated.
|
Node |
parseEval(ByteList content,
java.lang.String file,
DynamicScope scope,
int lineNumber) |
Node |
parseEval(java.lang.String content,
java.lang.String file,
DynamicScope scope,
int lineNumber) |
Node |
parseFile(java.io.InputStream in,
java.lang.String file,
DynamicScope scope) |
Node |
parseFile(java.io.InputStream in,
java.lang.String file,
DynamicScope scope,
int lineNumber) |
ParseResult |
parseFile(java.lang.String file,
java.io.InputStream in,
DynamicScope scope) |
ParseResult |
parseFile(java.lang.String file,
java.io.InputStream in,
DynamicScope scope,
int lineNumber) |
Node |
parseFileFromMain(java.io.InputStream in,
java.lang.String file,
DynamicScope scope) |
ParseResult |
parseFileFromMain(java.lang.String file,
java.io.InputStream in,
DynamicScope scope) |
Node |
parseFromMain(java.io.InputStream inputStream,
java.lang.String filename)
Parse the script contained in the given input stream, using the given
filename as the name of the script, and return the root Node.
|
ParseResult |
parseFromMain(java.lang.String fileName,
java.io.InputStream in) |
Node |
parseInline(java.io.InputStream in,
java.lang.String file,
DynamicScope scope) |
void |
printError(RubyException ex)
Prints an error with backtrace to the error stream.
|
void |
printError(java.lang.Throwable ex) |
void |
printProfileData(ProfileCollection profileData)
TDOD remove the synchronized.
|
void |
pushEndBlock(RubyProc proc)
It is possible for looping or repeated execution to encounter the same END
block multiple times.
|
IRubyObject |
pushExitBlock(RubyProc proc)
Push block onto exit stack.
|
<T extends IRubyObject> |
recursiveListOperation(java.util.concurrent.Callable<T> body)
Deprecated.
|
void |
registerInspecting(java.lang.Object obj) |
void |
registerMBeans() |
void |
releaseClassLoader()
By default
tearDown(boolean) does not release the class-loader's
resources as threads might be still running accessing the classes/packages
even after the runtime has been torn down. |
void |
removeEventHook(EventHook hook) |
void |
removeFinalizer(Finalizable finalizer) |
void |
removeInternalFinalizer(Finalizable finalizer) |
void |
reopenFixnum()
Mark Fixnum as reopened
|
void |
reopenFloat()
Mark Float as reopened
|
void |
runFromMain(java.io.InputStream inputStream,
java.lang.String filename)
Run the script contained in the specified input stream, using the
specified filename as the name of the script being executed.
|
IRubyObject |
runInterpreter(Node scriptNode) |
IRubyObject |
runInterpreter(ParseResult parseResult) |
IRubyObject |
runInterpreter(ThreadContext context,
Node rootNode,
IRubyObject self) |
IRubyObject |
runInterpreter(ThreadContext context,
ParseResult parseResult,
IRubyObject self) |
IRubyObject |
runInterpreterBody(Node scriptNode)
This is used for the "gets" loop, and we bypass 'load' to use an
already-prepared, already-pushed scope for the script body.
|
IRubyObject |
runNormally(Node scriptNode)
Run the specified script without any of the loop-processing wrapper
code.
|
IRubyObject |
runNormally(Node scriptNode,
boolean wrap)
Run the specified script without any of the loop-processing wrapper
code.
|
IRubyObject |
runScript(Script script) |
IRubyObject |
runScript(Script script,
boolean wrap) |
IRubyObject |
runScriptBody(Script script)
This is used for the "gets" loop, and we bypass 'load' to use an
already-prepared, already-pushed scope for the script body.
|
IRubyObject |
runWithGetsLoop(Node scriptNode,
boolean printing,
boolean processLineEnds,
boolean split,
boolean unused)
Deprecated.
|
IRubyObject |
runWithGetsLoop(RootNode scriptNode,
boolean printing,
boolean processLineEnds,
boolean split)
Run the given script with a "while gets; end" loop wrapped around it.
|
<T> IRubyObject |
safeRecurse(Ruby.RecursiveFunctionEx<T> func,
ThreadContext context,
T state,
IRubyObject obj,
java.lang.String name,
boolean outer)
Deprecated.
Use ThreadContext.safeRecurse
|
IRubyObject |
safeRecurse(Ruby.RecursiveFunction func,
IRubyObject obj,
java.lang.String name,
boolean outer)
Deprecated.
|
void |
secure(int level)
Deprecated.
|
void |
setArgsFile(IRubyObject argsFile) |
void |
setBaseNewMethod(DynamicMethod baseNewMethod)
Set the base Class#new method.
|
void |
setCurrentDirectory(java.lang.String dir) |
static void |
setCurrentInstance(Ruby runtime)
Deprecated.
|
void |
setCurrentLine(int line) |
void |
setDebug(IRubyObject debug)
Setter for property isDebug.
|
void |
setDefaultExternalEncoding(org.jcodings.Encoding defaultExternalEncoding) |
void |
setDefaultFilesystemEncoding(org.jcodings.Encoding defaultFilesystemEncoding) |
void |
setDefaultInternalEncoding(org.jcodings.Encoding defaultInternalEncoding) |
void |
setDefaultMethodMissing(DynamicMethod method,
DynamicMethod moduleMethod) |
void |
setDefaultRand(RubyRandom.RandomType defaultRand)
Deprecated.
internal API, to be hidden
|
void |
setDoNotReverseLookupEnabled(boolean b) |
void |
setENV(RubyHash env) |
void |
setEtc(RubyModule etcModule) |
void |
setFFI(FFI ffi) |
void |
setFiber(RubyClass fiberClass) |
void |
setGenerator(RubyClass generatorClass) |
void |
setGlobalAbortOnExceptionEnabled(boolean enable) |
void |
setGlobalVariables(GlobalVariables globalVariables) |
void |
setGroupStruct(RubyClass groupStruct) |
void |
setJavaProxyClassFactory(JavaProxyClassFactory factory) |
void |
setJRubyHome(java.lang.String home) |
void |
setKCode(KCode kcode) |
void |
setLocation(RubyClass location) |
void |
setNormalMethodMissing(DynamicMethod method) |
void |
setObjectSpaceEnabled(boolean objectSpaceEnabled) |
void |
setPasswdStruct(RubyClass passwdStruct) |
void |
setPrivateMethodMissing(DynamicMethod method) |
void |
setProtectedMethodMissing(DynamicMethod method) |
void |
setRecordSeparatorVar(GlobalVariable recordSeparatorVar) |
void |
setReportOnException(IRubyObject enable) |
void |
setRespondToMethod(DynamicMethod rtm) |
void |
setRespondToMissingMethod(DynamicMethod rtmm) |
void |
setRootFiber(IRubyObject fiber) |
void |
setSafeLevel(int safeLevel)
Deprecated.
|
static void |
setSecurityRestricted(boolean restricted) |
void |
setSuperMethodMissing(DynamicMethod method) |
static void |
setThreadLocalRuntime(Ruby ruby)
Set the thread-local runtime to the given runtime.
|
void |
setTraceFunction(RubyProc traceFunction) |
void |
setVariableMethodMissing(DynamicMethod method) |
void |
setVerbose(IRubyObject verbose)
Setter for property isVerbose.
|
void |
setWarning(RubyModule warningModule) |
void |
tearDown()
Make sure Kernel#at_exit procs getService invoked on runtime shutdown.
|
void |
tearDown(boolean systemExit) |
Script |
tryCompile(Node node)
Try to compile the code associated with the given Node, returning an
instance of the successfully-compiled Script or null if the script could
not be compiled.
|
void |
unregisterInspecting(java.lang.Object obj) |
void |
useAsGlobalRuntime()
Convenience method for java integrators who may need to switch the notion
of "global" runtime.
|
boolean |
warningsEnabled() |
public static final int NIL_PREFILLED_ARRAY_SIZE
public static final java.lang.String ERRNO_BACKTRACE_MESSAGE
public static final java.lang.String STOPIERATION_BACKTRACE_MESSAGE
public final java.lang.ClassValue<TypePopulator> POPULATORS
public final JavaSites sites
public void registerMBeans()
public static Ruby newInstance()
RubyInstanceConfig
public static Ruby newInstance(RubyInstanceConfig config)
config
- The instance configurationRubyInstanceConfig
public static Ruby newInstance(java.io.InputStream in, java.io.PrintStream out, java.io.PrintStream err)
in
- the custom input streamout
- the custom output streamerr
- the custom error streamRubyInstanceConfig
public static boolean isGlobalRuntimeReady()
public static Ruby getGlobalRuntime()
public void useAsGlobalRuntime()
public static void clearGlobalRuntime()
public static Ruby getThreadLocalRuntime()
public static void setThreadLocalRuntime(Ruby ruby)
ruby
- the new runtime for thread-localpublic IRubyObject evalScriptlet(java.lang.String script)
script
- The scriptlet to runpublic IRubyObject evalScriptlet(java.lang.String script, DynamicScope scope)
script
- The scriptlet to runscope
- The scope to execute against (ManyVarsDynamicScope is
recommended, so it can grow as needed)public IRubyObject executeScript(java.lang.String script, java.lang.String filename)
script
- The contents of the script to run as a normal, root scriptpublic void runFromMain(java.io.InputStream inputStream, java.lang.String filename)
inputStream
- The InputStream from which to read the script contentsfilename
- The filename to use when parsing, and for $PROGRAM_NAME
and $0 ruby global variables.public Node parseFromMain(java.io.InputStream inputStream, java.lang.String filename)
inputStream
- The input stream from which to read the scriptfilename
- The filename to use for parsingpublic ParseResult parseFromMain(java.lang.String fileName, java.io.InputStream in)
@Deprecated public IRubyObject runWithGetsLoop(Node scriptNode, boolean printing, boolean processLineEnds, boolean split, boolean unused)
scriptNode
- The root node of the script to executeprinting
- Whether $_ should be printed after each loop (as in the
-p command-line flag)processLineEnds
- Whether line endings should be processed by
setting $\ to $/ and chop!
ing every line readsplit
- Whether to split each line read using String#split
bytecode before executing.public IRubyObject runWithGetsLoop(RootNode scriptNode, boolean printing, boolean processLineEnds, boolean split)
scriptNode
- The root node of the script to executeprinting
- Whether $_ should be printed after each loop (as in the
-p command-line flag)processLineEnds
- Whether line endings should be processed by
setting $\ to $/ and chop!
ing every line readsplit
- Whether to split each line read using String#split
bytecode before executing.public IRubyObject runNormally(Node scriptNode, boolean wrap)
scriptNode
- The root node of the script to be executed
bytecode before executionwrap
- whether to wrap the execution in an anonymous modulepublic IRubyObject runNormally(Node scriptNode)
scriptNode
- The root node of the script to be executed
bytecode before executionpublic Script tryCompile(Node node)
node
- The node to attempt to compiledpublic IRubyObject runScript(Script script)
public IRubyObject runScript(Script script, boolean wrap)
public IRubyObject runScriptBody(Script script)
public IRubyObject runInterpreter(ThreadContext context, ParseResult parseResult, IRubyObject self)
public IRubyObject runInterpreter(ThreadContext context, Node rootNode, IRubyObject self)
public IRubyObject runInterpreter(Node scriptNode)
public IRubyObject runInterpreter(ParseResult parseResult)
public IRubyObject runInterpreterBody(Node scriptNode)
public Parser getParser()
public BeanManager getBeanManager()
public JITCompiler getJITCompiler()
public Caches getCaches()
public static Ruby getDefaultInstance()
@Deprecated public static Ruby getCurrentInstance()
@Deprecated public static void setCurrentInstance(Ruby runtime)
public int allocSymbolId()
public int allocModuleId()
public void addModule(RubyModule module)
public void eachModule(java.util.function.Consumer<RubyModule> func)
@Deprecated public void eachModule(Function1<java.lang.Object,IRubyObject> func)
public RubyModule getModule(java.lang.String name)
name
- The name of the module@Deprecated public RubyModule fastGetModule(java.lang.String internedName)
public RubyClass getClass(java.lang.String name)
name
- The name of the class@Deprecated public RubyClass fastGetClass(java.lang.String internedName)
internedName
- the name of the class; must be an interned String!public RubyClass defineClass(java.lang.String name, RubyClass superClass, ObjectAllocator allocator)
name
- The name for the new classsuperClass
- The super class for the new classallocator
- An ObjectAllocator instance that can construct
instances of the new class.public RubyClass defineClass(java.lang.String name, RubyClass superClass, ObjectAllocator allocator, CallSite[] callSites)
name
- The name for the new classsuperClass
- The super class for the new classallocator
- An ObjectAllocator instance that can construct
instances of the new class.public RubyClass defineClassUnder(java.lang.String name, RubyClass superClass, ObjectAllocator allocator, RubyModule parent)
name
- The name for the new classsuperClass
- The super class for the new classallocator
- An ObjectAllocator instance that can construct
instances of the new class.parent
- The namespace under which to define the new classpublic RubyClass defineClassUnder(java.lang.String id, RubyClass superClass, ObjectAllocator allocator, RubyModule parent, CallSite[] callSites)
id
- The name for the new class as an ISO-8859_1 String (id-value)superClass
- The super class for the new classallocator
- An ObjectAllocator instance that can construct
instances of the new class.parent
- The namespace under which to define the new classcallSites
- The array of call sites to addpublic RubyModule defineModule(java.lang.String name)
name
- The name of the new modulepublic RubyModule defineModuleUnder(java.lang.String name, RubyModule parent)
name
- The name of the new moduleparent
- The class or module namespace under which to define the
modulepublic RubyModule getOrCreateModule(java.lang.String id)
id
- The name of the modulepublic KCode getKCode()
public void setKCode(KCode kcode)
public void defineGlobalConstant(java.lang.String name, IRubyObject value)
name
- the namevalue
- the valuepublic IRubyObject fetchGlobalConstant(java.lang.String name)
name
- the namepublic boolean isClassDefined(java.lang.String name)
public JavaSupport loadJavaSupport()
public IRubyObject[] getNilPrefilledArray()
public RubyClass getErrno(int n)
public IRManager getIRManager()
public IRubyObject getTopSelf()
public IRubyObject getRootFiber()
public void setRootFiber(IRubyObject fiber)
public void setCurrentDirectory(java.lang.String dir)
public java.lang.String getCurrentDirectory()
public void setCurrentLine(int line)
public int getCurrentLine()
public void setArgsFile(IRubyObject argsFile)
public IRubyObject getArgsFile()
public RubyModule getEtc()
public void setEtc(RubyModule etcModule)
public RubyClass getObject()
public RubyClass getBasicObject()
public RubyClass getModule()
public RubyClass getClassClass()
public RubyModule getKernel()
public DynamicMethod getPrivateMethodMissing()
public void setPrivateMethodMissing(DynamicMethod method)
public DynamicMethod getProtectedMethodMissing()
public void setProtectedMethodMissing(DynamicMethod method)
public DynamicMethod getVariableMethodMissing()
public void setVariableMethodMissing(DynamicMethod method)
public DynamicMethod getSuperMethodMissing()
public void setSuperMethodMissing(DynamicMethod method)
public DynamicMethod getNormalMethodMissing()
public void setNormalMethodMissing(DynamicMethod method)
public DynamicMethod getDefaultMethodMissing()
public boolean isDefaultMethodMissing(DynamicMethod method)
public void setDefaultMethodMissing(DynamicMethod method, DynamicMethod moduleMethod)
public DynamicMethod getRespondToMethod()
public void setRespondToMethod(DynamicMethod rtm)
public DynamicMethod getRespondToMissingMethod()
public void setRespondToMissingMethod(DynamicMethod rtmm)
public RubyClass getDummy()
public RubyModule getComparable()
public RubyClass getNumeric()
public RubyClass getFloat()
public RubyClass getInteger()
public RubyClass getFixnum()
public RubyClass getComplex()
public RubyClass getRational()
public RubyModule getEnumerable()
public RubyClass getEnumerator()
public RubyClass getYielder()
public RubyClass getGenerator()
public void setGenerator(RubyClass generatorClass)
public RubyClass getFiber()
public void setFiber(RubyClass fiberClass)
public RubyClass getString()
public RubyClass getEncoding()
public RubyClass getConverter()
public RubyClass getSymbol()
public RubyClass getArray()
public RubyClass getHash()
public RubyClass getRange()
public RubyBoolean getTrue()
public RubyBoolean getFalse()
public IRubyObject getNil()
public IRubyObject[] getSingleNilArray()
public RubyClass getNilClass()
public RubyClass getTrueClass()
public RubyClass getFalseClass()
public RubyClass getProc()
public RubyClass getBinding()
public RubyClass getMethod()
public RubyClass getUnboundMethod()
public RubyClass getMatchData()
public RubyClass getRegexp()
public RubyClass getTime()
public RubyModule getMath()
public RubyModule getMarshal()
public RubyClass getBignum()
public RubyClass getDir()
public RubyClass getFile()
public RubyClass getFileStat()
public RubyModule getFileTest()
public RubyClass getIO()
public RubyClass getThread()
public RubyClass getThreadGroup()
public RubyThreadGroup getDefaultThreadGroup()
public RubyClass getContinuation()
public RubyClass getStructClass()
public RubyClass getRandomClass()
public IRubyObject getTmsStruct()
public IRubyObject getPasswdStruct()
public void setPasswdStruct(RubyClass passwdStruct)
public IRubyObject getGroupStruct()
public void setGroupStruct(RubyClass groupStruct)
public RubyModule getGC()
public RubyModule getObjectSpaceModule()
public RubyModule getProcess()
public RubyClass getProcStatus()
public RubyModule getProcUID()
public RubyModule getProcGID()
public RubyModule getProcSysModule()
public RubyModule getPrecision()
public RubyHash getENV()
public void setENV(RubyHash env)
public RubyClass getLocation()
public void setLocation(RubyClass location)
public RubyModule getWarning()
public void setWarning(RubyModule warningModule)
public RubyModule getErrno()
public RubyClass getException()
public RubyClass getNameError()
public RubyClass getNameErrorMessage()
public RubyClass getNoMethodError()
public RubyClass getSignalException()
public RubyClass getRangeError()
public RubyClass getSystemExit()
public RubyClass getLocalJumpError()
public RubyClass getNativeException()
public RubyClass getSystemCallError()
public RubyClass getKeyError()
public RubyClass getFatal()
public RubyClass getInterrupt()
public RubyClass getTypeError()
public RubyClass getArgumentError()
public RubyClass getUncaughtThrowError()
public RubyClass getIndexError()
public RubyClass getStopIteration()
public RubyClass getSyntaxError()
public RubyClass getStandardError()
public RubyClass getRuntimeError()
public RubyClass getFrozenError()
public RubyClass getIOError()
public RubyClass getLoadError()
public RubyClass getNotImplementedError()
public RubyClass getSecurityError()
public RubyClass getNoMemoryError()
public RubyClass getRegexpError()
public RubyClass getInterruptedRegexpError()
public RubyClass getEOFError()
public RubyClass getThreadError()
public RubyClass getConcurrencyError()
public RubyClass getSystemStackError()
public RubyClass getZeroDivisionError()
public RubyClass getFloatDomainError()
public RubyClass getMathDomainError()
public RubyClass getEncodingError()
public RubyClass getEncodingCompatibilityError()
public RubyClass getConverterNotFoundError()
public RubyClass getFiberError()
public RubyClass getUndefinedConversionError()
public RubyClass getInvalidByteSequenceError()
public RubyRandom.RandomType getDefaultRand()
public void setDefaultRand(RubyRandom.RandomType defaultRand)
@Deprecated public RubyHash getCharsetMap()
public IRubyObject getVerbose()
public boolean isVerbose()
public boolean warningsEnabled()
public void setVerbose(IRubyObject verbose)
verbose
- New value of property isVerbose.public IRubyObject getDebug()
public boolean isDebug()
public void setDebug(IRubyObject debug)
debug
- New value of property isDebug.public JavaSupport getJavaSupport()
public static java.lang.ClassLoader getClassLoader()
public JRubyClassLoader getJRubyClassLoader()
public void defineVariable(GlobalVariable variable, GlobalVariable.Scope scope)
public void defineReadonlyVariable(java.lang.String name, IRubyObject value, GlobalVariable.Scope scope)
public Node parseFile(java.io.InputStream in, java.lang.String file, DynamicScope scope)
public ParseResult parseFile(java.lang.String file, java.io.InputStream in, DynamicScope scope)
public Node parseFile(java.io.InputStream in, java.lang.String file, DynamicScope scope, int lineNumber)
public ParseResult parseFile(java.lang.String file, java.io.InputStream in, DynamicScope scope, int lineNumber)
public Node parseFileFromMain(java.io.InputStream in, java.lang.String file, DynamicScope scope)
public ParseResult parseFileFromMain(java.lang.String file, java.io.InputStream in, DynamicScope scope)
public Node parseInline(java.io.InputStream in, java.lang.String file, DynamicScope scope)
public Node parseEval(java.lang.String content, java.lang.String file, DynamicScope scope, int lineNumber)
@Deprecated public Node parse(java.lang.String content, java.lang.String file, DynamicScope scope, int lineNumber, boolean extraPositionInformation)
public Node parseEval(ByteList content, java.lang.String file, DynamicScope scope, int lineNumber)
public Node parse(ByteList content, java.lang.String file, DynamicScope scope, int lineNumber, boolean extraPositionInformation)
public ThreadService getThreadService()
public ThreadContext getCurrentContext()
public LoadService getLoadService()
public org.jcodings.Encoding getDefaultInternalEncoding()
public void setDefaultInternalEncoding(org.jcodings.Encoding defaultInternalEncoding)
public org.jcodings.Encoding getDefaultExternalEncoding()
public void setDefaultExternalEncoding(org.jcodings.Encoding defaultExternalEncoding)
public org.jcodings.Encoding getDefaultFilesystemEncoding()
public void setDefaultFilesystemEncoding(org.jcodings.Encoding defaultFilesystemEncoding)
public java.nio.charset.Charset getDefaultCharset()
public org.jcodings.Encoding getDefaultEncoding()
public EncodingService getEncodingService()
public RubyWarnings getWarnings()
public java.io.PrintStream getErrorStream()
public java.io.InputStream getInputStream()
public java.io.PrintStream getOutputStream()
public RubyModule getClassFromPath(java.lang.String path)
public void printError(RubyException ex)
public void printError(java.lang.Throwable ex)
public void loadFile(java.lang.String scriptName, java.io.InputStream in, boolean wrap)
public void loadScope(IRScope scope, boolean wrap)
public void compileAndLoadFile(java.lang.String filename, java.io.InputStream in, boolean wrap)
public void loadScript(Script script)
public void loadScript(Script script, boolean wrap)
public void loadExtension(java.lang.String extName, BasicLibraryService extension, boolean wrap)
extName
- The name of the extension, to go on the frame wrapping itextension
- The extension object to loadwrap
- Whether to use a new "self" for toplevelpublic void addBoundMethod(java.lang.String className, java.lang.String methodName, java.lang.String rubyName)
public void addBoundMethods(java.lang.String className, java.lang.String... tuples)
@Deprecated public void addBoundMethodsPacked(java.lang.String className, java.lang.String packedTuples)
@Deprecated public void addSimpleBoundMethodsPacked(java.lang.String className, java.lang.String packedNames)
public java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> getBoundMethods()
public void setJavaProxyClassFactory(JavaProxyClassFactory factory)
public JavaProxyClassFactory getJavaProxyClassFactory()
public void addEventHook(EventHook hook)
public void removeEventHook(EventHook hook)
public void setTraceFunction(RubyProc traceFunction)
public void callEventHooks(ThreadContext context, RubyEvent event, java.lang.String file, int line, java.lang.String name, IRubyObject type)
public boolean hasEventHooks()
public GlobalVariables getGlobalVariables()
public void setGlobalVariables(GlobalVariables globalVariables)
public IRubyObject pushExitBlock(RubyProc proc)
public void pushEndBlock(RubyProc proc)
public void addInternalFinalizer(Finalizable finalizer)
public void addFinalizer(Finalizable finalizer)
public void removeInternalFinalizer(Finalizable finalizer)
public void removeFinalizer(Finalizable finalizer)
public void tearDown()
public void tearDown(boolean systemExit)
public void releaseClassLoader()
tearDown(boolean)
does not release the class-loader's
resources as threads might be still running accessing the classes/packages
even after the runtime has been torn down.
This method exists to handle such cases, e.g. with embedded uses we always
release the runtime loader but not otherwise - you should do that manually.public void printProfileData(ProfileCollection profileData)
profileData
- public ProfilingService getProfilingService()
public RubyArray newEmptyArray()
public RubyArray newArray()
public RubyArray newArrayLight()
public RubyArray newArray(IRubyObject object)
public RubyArray newArray(IRubyObject car, IRubyObject cdr)
public RubyArray newArray(IRubyObject... objects)
public RubyArray newArrayNoCopy(IRubyObject... objects)
public RubyArray newArrayNoCopyLight(IRubyObject... objects)
public RubyArray newArray(java.util.List<IRubyObject> list)
public RubyArray newArray(int size)
public RubyArray getEmptyFrozenArray()
public RubyBoolean newBoolean(boolean value)
public RubyFileStat newFileStat(java.lang.String filename, boolean lstat)
public RubyFileStat newFileStat(java.io.FileDescriptor descriptor)
public RubyFixnum newFixnum(long value)
public RubyFixnum newFixnum(int value)
public RubyFixnum newFixnum(jnr.constants.Constant value)
public RubyFloat newFloat(double value)
public RubyNumeric newNumeric()
public RubyRational newRational(long num, long den)
public RubyRational newRationalReduced(long num, long den)
public RubyProc newProc(Block.Type type, Block block)
public RubyProc newBlockPassProc(Block.Type type, Block block)
public RubyBinding newBinding()
public RubyBinding newBinding(Binding binding)
public RubyString newString()
public RubyString newString(java.lang.String string)
public RubyString newString(ByteList byteList)
@Deprecated public RubyString newStringShared(ByteList byteList)
public RubySymbol newSymbol(java.lang.String name)
public RubySymbol newSymbol(java.lang.String name, org.jcodings.Encoding encoding)
public RubySymbol newSymbol(ByteList name)
public RubySymbol fastNewSymbol(java.lang.String internedName)
newSymbol(String)
if you already have an interned
name String. Don't intern your string just to call this version - the
overhead of interning will more than wipe out any benefit from the faster
lookup.internedName
- the symbol name, must be interned! if in
doubt, call newSymbol(String)
instead.public RubyTime newTime(long milliseconds)
public RaiseException newRuntimeError(java.lang.String message)
public RaiseException newArgumentError(java.lang.String message)
public RaiseException newArgumentError(int got, int expected)
public RaiseException newArgumentError(int got, int min, int max)
public RaiseException newArgumentError(java.lang.String name, int got, int expected)
public RaiseException newArgumentError(java.lang.String name, int got, int min, int max)
public RaiseException newErrnoEBADFError()
public RaiseException newErrnoEISCONNError()
public RaiseException newErrnoEINPROGRESSError()
public RaiseException newErrnoEINPROGRESSWritableError()
public RaiseException newErrnoENOPROTOOPTError()
public RaiseException newErrnoEPIPEError()
public RaiseException newErrnoECONNABORTEDError()
public RaiseException newErrnoECONNREFUSEDError()
public RaiseException newErrnoECONNREFUSEDError(java.lang.String message)
public RaiseException newErrnoECONNRESETError()
public RaiseException newErrnoEADDRINUSEError()
public RaiseException newErrnoEADDRINUSEError(java.lang.String message)
public RaiseException newErrnoEHOSTUNREACHError(java.lang.String message)
public RaiseException newErrnoEINVALError()
public RaiseException newErrnoELOOPError()
public RaiseException newErrnoEMFILEError()
public RaiseException newErrnoENFILEError()
public RaiseException newErrnoENOENTError()
public RaiseException newErrnoEACCESError(java.lang.String message)
public RaiseException newErrnoEAGAINError(java.lang.String message)
public RaiseException newErrnoEAGAINReadableError(java.lang.String message)
public RaiseException newErrnoEAGAINWritableError(java.lang.String message)
public RaiseException newErrnoEISDirError(java.lang.String message)
public RaiseException newErrnoEPERMError(java.lang.String name)
public RaiseException newErrnoEISDirError()
public RaiseException newErrnoESPIPEError()
public RaiseException newErrnoEBADFError(java.lang.String message)
public RaiseException newErrnoEINPROGRESSError(java.lang.String message)
public RaiseException newErrnoEINPROGRESSWritableError(java.lang.String message)
public RaiseException newErrnoEISCONNError(java.lang.String message)
public RaiseException newErrnoEINVALError(java.lang.String message)
public RaiseException newErrnoENOTDIRError(java.lang.String message)
public RaiseException newErrnoENOTEMPTYError(java.lang.String message)
public RaiseException newErrnoENOTSOCKError(java.lang.String message)
public RaiseException newErrnoENOTCONNError(java.lang.String message)
public RaiseException newErrnoENOTCONNError()
public RaiseException newErrnoENOENTError(java.lang.String message)
public RaiseException newErrnoEOPNOTSUPPError(java.lang.String message)
public RaiseException newErrnoESPIPEError(java.lang.String message)
public RaiseException newErrnoEEXISTError(java.lang.String message)
public RaiseException newErrnoEDOMError(java.lang.String message)
public RaiseException newErrnoECHILDError()
public RaiseException newErrnoEADDRNOTAVAILError(java.lang.String message)
public RaiseException newErrnoESRCHError()
public RaiseException newErrnoEWOULDBLOCKError()
public RaiseException newErrnoEDESTADDRREQError(java.lang.String func)
public RaiseException newErrnoENETUNREACHError()
public RaiseException newErrnoEMSGSIZEError()
public RaiseException newErrnoEXDEVError(java.lang.String message)
public RaiseException newIndexError(java.lang.String message)
public RaiseException newSecurityError(java.lang.String message)
public RaiseException newSystemCallError(java.lang.String message)
public RaiseException newKeyError(java.lang.String message, IRubyObject recv, IRubyObject key)
public RaiseException newErrnoEINTRError()
public RaiseException newErrnoEAFNOSUPPORTError(java.lang.String message)
public RaiseException newErrnoFromLastPOSIXErrno()
public RaiseException newErrnoFromInt(int errno, java.lang.String methodName, java.lang.String message)
public RaiseException newErrnoFromInt(int errno, java.lang.String message)
public RaiseException newErrnoFromErrno(jnr.constants.platform.Errno errno, java.lang.String message)
public RaiseException newErrnoFromInt(int errno)
public RaiseException newErrnoEADDRFromBindException(java.net.BindException be)
public RaiseException newErrnoEADDRFromBindException(java.net.BindException be, java.lang.String contextMessage)
public RaiseException newTypeError(java.lang.String message)
public RaiseException newThreadError(java.lang.String message)
public RaiseException newConcurrencyError(java.lang.String message)
public RaiseException newSyntaxError(java.lang.String message)
public RaiseException newRegexpError(java.lang.String message)
public RaiseException newInterruptedRegexpError(java.lang.String message)
public RaiseException newRangeError(java.lang.String message)
public RaiseException newNotImplementedError(java.lang.String message)
@Deprecated public RaiseException newInvalidEncoding(java.lang.String message)
@Deprecated public RaiseException newIllegalSequence(java.lang.String message)
public RaiseException newNameError(java.lang.String message, IRubyObject recv, IRubyObject name)
public RaiseException newNameError(java.lang.String message, IRubyObject recv, IRubyObject name, boolean privateCall)
message
- an sprintf format string for the messagerecv
- the receiver objectname
- the name that failedprivateCall
- whether the failure was due to method visibilitypublic RaiseException newNameError(java.lang.String message, IRubyObject recv, java.lang.String name)
public RaiseException newNameError(java.lang.String message, IRubyObject recv, java.lang.String name, boolean privateCall)
public RaiseException newNameError(java.lang.String message, java.lang.String name, java.lang.Throwable exception, boolean printWhenVerbose)
message
- the pre-formatted message for the NameErrorname
- the name that failedexception
- the original exception, or nullprintWhenVerbose
- whether to log this exception when verbose mode is enabledpublic RaiseException newNameError(java.lang.String message, java.lang.String name)
newNameError(String, String, Throwable)
with a null
originating exception.message
- the pre-formatted message for the errorname
- the name that failedpublic RaiseException newNameError(java.lang.String message, java.lang.String name, java.lang.Throwable origException)
newNameError(String, String, Throwable, boolean)
with a null
originating exception and false for verbose-mode logging.message
- a formatted string message for the errorname
- the name that failedorigException
- the original exception, or null if nonepublic RaiseException newNoMethodError(java.lang.String message, IRubyObject recv, java.lang.String name, RubyArray args)
public RaiseException newNoMethodError(java.lang.String message, IRubyObject recv, java.lang.String name, RubyArray args, boolean privateCall)
newNameError(String, IRubyObject, IRubyObject)
but accepts
a java.lang.String for name and a RubyArray of the original call arguments.newNameError(String, IRubyObject, IRubyObject)
public RaiseException newNoMethodError(java.lang.String message, java.lang.String name, IRubyObject args)
message
- the pre-formatted messagename
- the name that failedargs
- the original arguments to the call that failedpublic RaiseException newLocalJumpError(RubyLocalJumpError.Reason reason, IRubyObject exitValue, java.lang.String message)
public RaiseException newLocalJumpErrorNoBlock()
public RaiseException newRedoLocalJumpError()
public RaiseException newLoadError(java.lang.String message)
public RaiseException newLoadError(java.lang.String message, java.lang.String path)
public RaiseException newFrozenError(java.lang.String objectType)
public RaiseException newFrozenError(RubyModule type)
public RaiseException newFrozenError(java.lang.String objectType, boolean runtimeError)
public RaiseException newSystemStackError(java.lang.String message)
public RaiseException newSystemStackError(java.lang.String message, java.lang.StackOverflowError error)
public RaiseException newSystemExit(int status)
public RaiseException newSystemExit(int status, java.lang.String message)
public RaiseException newIOError(java.lang.String message)
public RaiseException newStandardError(java.lang.String message)
public RaiseException newIOErrorFromException(java.io.IOException ex)
public RaiseException newTypeError(IRubyObject receivedObject, RubyClass expectedType)
public RaiseException newTypeError(IRubyObject receivedObject, RubyModule expectedType)
public RaiseException newTypeError(IRubyObject receivedObject, java.lang.String expectedType)
public RaiseException newEOFError()
public RaiseException newEOFError(java.lang.String message)
public RaiseException newZeroDivisionError()
public RaiseException newFloatDomainError(java.lang.String message)
public RaiseException newMathDomainError(java.lang.String message)
public RaiseException newEncodingError(java.lang.String message)
public RaiseException newEncodingCompatibilityError(java.lang.String message)
public RaiseException newConverterNotFoundError(java.lang.String message)
public RaiseException newFiberError(java.lang.String message)
public RaiseException newUndefinedConversionError(java.lang.String message)
public RaiseException newInvalidByteSequenceError(java.lang.String message)
public RaiseException newRaiseException(RubyClass exceptionClass, java.lang.String message)
exceptionClass
- message
- public RaiseException newStopIteration(IRubyObject result, java.lang.String message)
message
- the message for the exception@Deprecated public RaiseException newLightweightStopIterationError(java.lang.String message)
public RubyObject.Data newData(RubyClass objectClass, java.lang.Object sval)
public RubySymbol.SymbolTable getSymbolTable()
public ObjectSpace getObjectSpace()
public java.io.InputStream getIn()
public java.io.PrintStream getOut()
public java.io.PrintStream getErr()
public boolean isGlobalAbortOnExceptionEnabled()
public void setGlobalAbortOnExceptionEnabled(boolean enable)
public IRubyObject getReportOnException()
public void setReportOnException(IRubyObject enable)
public boolean isDoNotReverseLookupEnabled()
public void setDoNotReverseLookupEnabled(boolean b)
public void registerInspecting(java.lang.Object obj)
public boolean isInspecting(java.lang.Object obj)
public void unregisterInspecting(java.lang.Object obj)
public boolean isObjectSpaceEnabled()
public void setObjectSpaceEnabled(boolean objectSpaceEnabled)
public boolean isSiphashEnabled()
public long getStartTime()
public Profile getProfile()
public java.lang.String getJRubyHome()
public void setJRubyHome(java.lang.String home)
public RubyInstanceConfig getInstanceConfig()
@Deprecated public boolean is2_0()
@Deprecated public long getGlobalState()
@Deprecated public void incGlobalState()
public static boolean isSecurityRestricted()
public static void setSecurityRestricted(boolean restricted)
public jnr.posix.POSIX getPosix()
public void setRecordSeparatorVar(GlobalVariable recordSeparatorVar)
public GlobalVariable getRecordSeparatorVar()
public java.util.concurrent.ExecutorService getExecutor()
public java.util.concurrent.ExecutorService getFiberExecutor()
public java.util.Map<java.lang.String,org.joda.time.DateTimeZone> getTimezoneCache()
@Deprecated public int getConstantGeneration()
public Invalidator getConstantInvalidator(java.lang.String constantName)
public Invalidator getCheckpointInvalidator()
public <E extends java.lang.Enum<E>> void loadConstantSet(RubyModule module, java.lang.Class<E> enumClass)
public void loadConstantSet(RubyModule module, java.lang.String constantSetName)
public long getNextDynamicMethodSerial()
public int getNextModuleGeneration()
public java.lang.Object getHierarchyLock()
public SelectorPool getSelectorPool()
public RuntimeCache getRuntimeCache()
public java.util.List<StrptimeToken> getCachedStrptimePattern(java.lang.String pattern)
public void incrementExceptionCount()
public int getExceptionCount()
public void incrementBacktraceCount()
public int getBacktraceCount()
public void incrementWarningCount()
public int getWarningCount()
public void incrementCallerCount()
public int getCallerCount()
public void reopenFixnum()
public Invalidator getFixnumInvalidator()
public boolean isFixnumReopened()
public void reopenFloat()
public Invalidator getFloatInvalidator()
public boolean isFloatReopened()
public boolean isBootingCore()
public boolean isBooting()
public CoverageData getCoverageData()
public java.util.Random getRandom()
public long getHashSeedK0()
public long getHashSeedK1()
public StaticScopeFactory getStaticScopeFactory()
public FFI getFFI()
public void setFFI(FFI ffi)
public RubyString getDefinedMessage(DefinedMessage definedMessage)
public RubyString getThreadStatus(RubyThread.Status status)
public RubyString freezeAndDedupString(RubyString string)
string
- the string to freeze-dup if an equivalent does not already existpublic int getRuntimeNumber()
public java.lang.Object constant()
constant
in interface Constantizable
Constantizable
public void setBaseNewMethod(DynamicMethod baseNewMethod)
baseNewMethod
- public DynamicMethod getBaseNewMethod()
public java.lang.invoke.MethodHandle getNullToNilHandle()
public FilenoUtil getFilenoUtil()
public RubyClass getData()
public java.util.Map<java.lang.Class,java.util.function.Consumer<RubyModule>> getJavaExtensionDefinitions()
@Deprecated public int getSafeLevel()
@Deprecated public void setSafeLevel(int safeLevel)
@Deprecated public void checkSafeString(IRubyObject object)
@Deprecated public void secure(int level)
@Deprecated public RaiseException newNameErrorObject(java.lang.String message, IRubyObject name)
@Deprecated public boolean is1_8()
@Deprecated public boolean is1_9()
@Deprecated public IRubyObject safeRecurse(Ruby.RecursiveFunction func, IRubyObject obj, java.lang.String name, boolean outer)
@Deprecated public ProfiledMethods getProfiledMethods()
@Deprecated public <T> IRubyObject safeRecurse(Ruby.RecursiveFunctionEx<T> func, ThreadContext context, T state, IRubyObject obj, java.lang.String name, boolean outer)
@Deprecated public IRubyObject execRecursive(Ruby.RecursiveFunction func, IRubyObject obj)
recursiveListOperation
,
which will ensure the thread-local recursion tracking data structs are
cleared.
MRI: rb_exec_recursive
Calls func(obj, arg, recursive), where recursive is non-zero if the
current method is called recursively on objfunc
- obj
- @Deprecated public IRubyObject execRecursiveOuter(Ruby.RecursiveFunction func, IRubyObject obj)
func
- obj
- @Deprecated public <T extends IRubyObject> T recursiveListOperation(java.util.concurrent.Callable<T> body)
execRecursive
.
Clean up recursive structures once complete.T
- body
- public void addToObjectSpace(boolean useObjectSpace, IRubyObject object)
Copyright © 2001-2019 JRuby. All Rights Reserved.