|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jruby.Ruby
public final class Ruby
The jruby runtime.
Nested Class Summary | |
---|---|
class |
Ruby.CallTraceFuncHook
Call the trace function MRI: eval.c - call_trace_func |
Field Summary | |
---|---|
int |
moduleLastId
|
int |
symbolLastId
|
Method Summary | |
---|---|
void |
addEventHook(EventHook hook)
|
void |
addFinalizer(Finalizable finalizer)
|
CallbackFactory |
callbackFactory(java.lang.Class type)
|
void |
callEventHooks(ThreadContext context,
int event,
java.lang.String file,
int line,
java.lang.String name,
IRubyObject type)
|
void |
checkSafeString(IRubyObject object)
|
IRubyObject |
compileAndRun(Node node)
|
IRubyObject |
compileOrFallbackAndRun(Node node)
|
RubyClass |
defineClass(java.lang.String name,
RubyClass superClass,
ObjectAllocator allocator)
Define a new class with name 'name' and super class 'superClass'. |
RubyClass |
defineClassUnder(java.lang.String name,
RubyClass superClass,
ObjectAllocator allocator,
SinglyLinkedList parentCRef)
|
void |
defineGlobalConstant(java.lang.String name,
IRubyObject value)
rb_define_global_const |
RubyModule |
defineModule(java.lang.String name)
rb_define_module / rb_define_module_id |
RubyModule |
defineModuleUnder(java.lang.String name,
SinglyLinkedList parentCRef)
|
void |
defineReadonlyVariable(java.lang.String name,
IRubyObject value)
defines a readonly global variable |
void |
defineVariable(GlobalVariable variable)
Defines a global variable |
IRubyObject |
eval(Node node)
|
IRubyObject |
evalScript(java.io.Reader reader,
java.lang.String name)
|
IRubyObject |
evalScript(java.lang.String script)
Evaluates a script and returns a RubyObject. |
RubyClass |
getArray()
|
CacheMap |
getCacheMap()
Retrieve mappings of cached methods to where they have been cached. |
RubyClass |
getClass(java.lang.String name)
Returns a class from the instance pool. |
RubyModule |
getClassFromPath(java.lang.String path)
|
ThreadContext |
getCurrentContext()
|
java.lang.String |
getCurrentDirectory()
|
IRubyObject |
getDebug()
Getter for property isDebug. |
static Ruby |
getDefaultInstance()
Returns a default instance of the JRuby runtime. |
RubyModule |
getEnumerable()
|
java.io.PrintStream |
getErr()
|
java.io.PrintStream |
getErrorStream()
|
RubyBoolean |
getFalse()
Returns the "false" instance from the instance pool. |
RubyClass |
getFixnum()
|
RubyFixnum[] |
getFixnumCache()
|
long |
getGlobalState()
GET_VM_STATE_VERSION |
GlobalVariables |
getGlobalVariables()
|
RubyClass |
getHash()
|
java.io.InputStream |
getIn()
|
java.io.InputStream |
getInputStream()
|
RubyInstanceConfig |
getInstanceConfig()
|
java.util.Hashtable |
getIoHandlers()
|
JavaSupport |
getJavaSupport()
|
JRubyClassLoader |
getJRubyClassLoader()
|
java.lang.String |
getJRubyHome()
|
KCode |
getKCode()
|
RubyModule |
getKernel()
|
LoadService |
getLoadService()
Returns the loadService. |
MethodCache |
getMethodCache()
Retrieve method cache. |
RubyModule |
getModule(java.lang.String name)
|
IRubyObject |
getNil()
Returns the "nil" singleton instance. |
RubyClass |
getNilClass()
|
RubyClass |
getObject()
|
ObjectSpace |
getObjectSpace()
|
RubyModule |
getOrCreateModule(java.lang.String name)
In the current context, get the named module. |
java.io.PrintStream |
getOut()
|
java.io.PrintStream |
getOutputStream()
|
Profile |
getProfile()
|
java.util.Random |
getRandom()
|
long |
getRandomSeed()
|
java.util.Map |
getRuntimeInformation()
|
int |
getSafeLevel()
Getter for property securityLevel. |
MethodSelectorTable |
getSelectorTable()
|
int |
getStackTraces()
|
long |
getStartTime()
|
RubyClass |
getString()
|
RubySymbol.SymbolTable |
getSymbolTable()
|
ThreadService |
getThreadService()
|
IRubyObject |
getTmsStruct()
|
IRubyObject |
getTopSelf()
Getter for property rubyTopSelf. |
RubyBoolean |
getTrue()
Returns the "true" instance from the instance pool. |
IRubyObject |
getUndef()
|
IRubyObject |
getVerbose()
Getter for property isVerbose. |
RubyWarnings |
getWarnings()
|
boolean |
hasEventHooks()
|
void |
incGlobalState()
INC_VM_STATE_VERSION |
long |
incrementRandomSeedSequence()
|
boolean |
isClassDefined(java.lang.String name)
|
boolean |
isDoNotReverseLookupEnabled()
|
boolean |
isGlobalAbortOnExceptionEnabled()
|
boolean |
isObjectSpaceEnabled()
|
static boolean |
isSecurityRestricted()
|
void |
loadFile(java.io.File file)
Loads, compiles and interprets a Ruby file. |
void |
loadNode(java.lang.String scriptName,
Node node)
|
void |
loadScript(RubyString scriptName,
RubyString source)
This method compiles and interprets a Ruby script. |
void |
loadScript(Script script)
|
void |
loadScript(java.lang.String scriptName,
java.io.Reader source)
|
RaiseException |
newArgumentError(int got,
int expected)
|
RaiseException |
newArgumentError(java.lang.String message)
|
RubyArray |
newArray()
|
RubyArray |
newArray(int size)
|
RubyArray |
newArray(IRubyObject object)
|
RubyArray |
newArray(IRubyObject[] objects)
|
RubyArray |
newArray(IRubyObject car,
IRubyObject cdr)
|
RubyArray |
newArray(java.util.List list)
|
RubyArray |
newArrayLight()
|
RubyArray |
newArrayNoCopy(IRubyObject[] objects)
|
RubyArray |
newArrayNoCopyLight(IRubyObject[] objects)
|
RubyBinding |
newBinding()
|
RubyBinding |
newBinding(Block block)
|
RubyBoolean |
newBoolean(boolean value)
|
RaiseException |
newEOFError()
|
RaiseException |
newErrnoEADDRINUSEError()
|
RaiseException |
newErrnoEBADFError()
|
RaiseException |
newErrnoEBADFError(java.lang.String message)
|
RaiseException |
newErrnoECONNREFUSEDError()
|
RaiseException |
newErrnoEDOMError(java.lang.String message)
|
RaiseException |
newErrnoEEXISTError(java.lang.String message)
|
RaiseException |
newErrnoEINVALError()
|
RaiseException |
newErrnoEINVALError(java.lang.String message)
|
RaiseException |
newErrnoENOENTError()
|
RaiseException |
newErrnoENOENTError(java.lang.String message)
|
RaiseException |
newErrnoESPIPEError()
|
RaiseException |
newErrnoESPIPEError(java.lang.String message)
|
RubyFixnum |
newFixnum(long value)
|
RubyFloat |
newFloat(double value)
|
RaiseException |
newFloatDomainError(java.lang.String message)
|
RaiseException |
newFrozenError(java.lang.String objectType)
|
RaiseException |
newIndexError(java.lang.String message)
|
static Ruby |
newInstance(java.io.InputStream in,
java.io.PrintStream out,
java.io.PrintStream err)
Returns a default instance of the JRuby runtime configured with the given input, output and error streams. |
static Ruby |
newInstance(RubyInstanceConfig config)
Returns a default instance of the JRuby runtime configured as provided. |
RaiseException |
newInvalidEncoding(java.lang.String message)
|
RaiseException |
newIOError(java.lang.String message)
|
RaiseException |
newIOErrorFromException(java.io.IOException ioe)
|
RaiseException |
newLoadError(java.lang.String message)
|
RaiseException |
newLocalJumpError(java.lang.String reason,
IRubyObject exitValue,
java.lang.String message)
|
RaiseException |
newNameError(java.lang.String message,
java.lang.String name)
|
RaiseException |
newNoMethodError(java.lang.String message,
java.lang.String name,
IRubyObject args)
|
RaiseException |
newNotImplementedError(java.lang.String message)
|
RubyNumeric |
newNumeric()
|
RubyProc |
newProc(boolean isLambda,
Block block)
|
RaiseException |
newRangeError(java.lang.String message)
|
RaiseException |
newRegexpError(java.lang.String message)
|
RubyFileStat |
newRubyFileStat(java.lang.String file)
|
RaiseException |
newRuntimeError(java.lang.String message)
|
RaiseException |
newSecurityError(java.lang.String message)
|
RaiseException |
newStandardError(java.lang.String message)
|
RubyString |
newString()
|
RubyString |
newString(ByteList byteList)
|
RubyString |
newString(java.lang.String string)
|
RubyString |
newStringShared(ByteList byteList)
|
RubySymbol |
newSymbol(java.lang.String string)
|
RaiseException |
newSyntaxError(java.lang.String message)
|
RaiseException |
newSystemCallError(java.lang.String message)
|
RaiseException |
newSystemExit(int status)
|
RaiseException |
newSystemStackError(java.lang.String message)
|
RaiseException |
newThreadError(java.lang.String message)
|
RubyTime |
newTime(long milliseconds)
|
RaiseException |
newTypeError(IRubyObject receivedObject,
RubyClass expectedType)
|
RaiseException |
newTypeError(java.lang.String message)
|
RaiseException |
newZeroDivisionError()
|
Node |
parse(java.io.Reader content,
java.lang.String file,
DynamicScope scope,
int lineNumber)
|
Node |
parse(java.lang.String content,
java.lang.String file,
DynamicScope scope,
int lineNumber)
|
Node |
parse(java.lang.String content,
java.lang.String file,
DynamicScope scope,
int lineNumber,
boolean extraPositionInformation)
|
void |
printError(RubyException excp)
Prints an error with backtrace to the error stream. |
IRubyObject |
pushExitBlock(RubyProc proc)
Push block onto exit stack. |
boolean |
registerInspecting(java.lang.Object obj)
|
void |
removeEventHook(EventHook hook)
|
void |
removeFinalizer(Finalizable finalizer)
|
void |
secure(int level)
|
void |
setCurrentDirectory(java.lang.String dir)
|
void |
setDebug(IRubyObject debug)
Setter for property isDebug. |
void |
setDoNotReverseLookupEnabled(boolean b)
|
void |
setGlobalAbortOnExceptionEnabled(boolean enable)
|
void |
setGlobalVariables(GlobalVariables globalVariables)
|
void |
setJRubyHome(java.lang.String home)
|
void |
setKCode(KCode kcode)
|
void |
setRandomSeed(long randomSeed)
|
void |
setSafeLevel(int safeLevel)
Setter for property securityLevel. |
static void |
setSecurityRestricted(boolean restricted)
|
void |
setStackTraces(int stackTraces)
|
void |
setTraceFunction(RubyProc traceFunction)
|
void |
setVerbose(IRubyObject verbose)
Setter for property isVerbose. |
void |
tearDown()
Make sure Kernel#at_exit procs get invoked on runtime shutdown. |
void |
unregisterInspecting(java.lang.Object obj)
|
IRubyObject |
ycompileAndRun(Node node)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int symbolLastId
public int moduleLastId
Method Detail |
---|
public static Ruby getDefaultInstance()
public static Ruby newInstance(RubyInstanceConfig config)
config
- the instance configuration
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 stream
public IRubyObject evalScript(java.io.Reader reader, java.lang.String name)
public IRubyObject evalScript(java.lang.String script)
public IRubyObject eval(Node node)
public IRubyObject compileOrFallbackAndRun(Node node)
public IRubyObject compileAndRun(Node node)
public IRubyObject ycompileAndRun(Node node)
public RubyClass getObject()
public IRubyObject getUndef()
public RubyModule getKernel()
public RubyModule getEnumerable()
public RubyClass getString()
public RubyClass getFixnum()
public RubyClass getHash()
public RubyClass getArray()
public IRubyObject getTmsStruct()
public RubyBoolean getTrue()
public RubyBoolean getFalse()
public IRubyObject getNil()
public RubyClass getNilClass()
public RubyModule getModule(java.lang.String name)
public RubyClass getClass(java.lang.String name)
name
- The name of the class.
public RubyClass defineClass(java.lang.String name, RubyClass superClass, ObjectAllocator allocator)
public RubyClass defineClassUnder(java.lang.String name, RubyClass superClass, ObjectAllocator allocator, SinglyLinkedList parentCRef)
public RubyModule defineModule(java.lang.String name)
public RubyModule defineModuleUnder(java.lang.String name, SinglyLinkedList parentCRef)
public RubyModule getOrCreateModule(java.lang.String name)
public int getSafeLevel()
public void setSafeLevel(int safeLevel)
safeLevel
- New value of property securityLevel.public KCode getKCode()
public void setKCode(KCode kcode)
public void secure(int level)
public void checkSafeString(IRubyObject object)
public CacheMap getCacheMap()
public MethodCache getMethodCache()
public java.util.Map getRuntimeInformation()
getRuntimeInformation()
public MethodSelectorTable getSelectorTable()
public void defineGlobalConstant(java.lang.String name, IRubyObject value)
public boolean isClassDefined(java.lang.String name)
public IRubyObject getTopSelf()
public void setCurrentDirectory(java.lang.String dir)
public java.lang.String getCurrentDirectory()
public IRubyObject getVerbose()
public void setVerbose(IRubyObject verbose)
verbose
- New value of property isVerbose.public IRubyObject getDebug()
public void setDebug(IRubyObject debug)
debug
- New value of property isDebug.public JavaSupport getJavaSupport()
public JRubyClassLoader getJRubyClassLoader()
public void defineVariable(GlobalVariable variable)
public void defineReadonlyVariable(java.lang.String name, IRubyObject value)
public Node parse(java.io.Reader content, java.lang.String file, DynamicScope scope, int lineNumber)
public Node parse(java.lang.String content, java.lang.String file, DynamicScope scope, int lineNumber)
public Node parse(java.lang.String content, java.lang.String file, DynamicScope scope, int lineNumber, boolean extraPositionInformation)
public ThreadService getThreadService()
public ThreadContext getCurrentContext()
public LoadService getLoadService()
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 excp)
public void loadScript(RubyString scriptName, RubyString source)
public void loadScript(java.lang.String scriptName, java.io.Reader source)
public void loadScript(Script script)
public void loadNode(java.lang.String scriptName, Node node)
public void loadFile(java.io.File file)
public void addEventHook(EventHook hook)
public void removeEventHook(EventHook hook)
public void setTraceFunction(RubyProc traceFunction)
public void callEventHooks(ThreadContext context, int 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 CallbackFactory callbackFactory(java.lang.Class type)
public IRubyObject pushExitBlock(RubyProc proc)
public void addFinalizer(Finalizable finalizer)
public void removeFinalizer(Finalizable finalizer)
public void tearDown()
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 list)
public RubyArray newArray(int size)
public RubyBoolean newBoolean(boolean value)
public RubyFileStat newRubyFileStat(java.lang.String file)
public RubyFixnum newFixnum(long value)
public RubyFloat newFloat(double value)
public RubyNumeric newNumeric()
public RubyProc newProc(boolean isLambda, Block block)
public RubyBinding newBinding()
public RubyBinding newBinding(Block block)
public RubyString newString()
public RubyString newString(java.lang.String string)
public RubyString newString(ByteList byteList)
public RubyString newStringShared(ByteList byteList)
public RubySymbol newSymbol(java.lang.String string)
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 newErrnoEBADFError()
public RaiseException newErrnoECONNREFUSEDError()
public RaiseException newErrnoEADDRINUSEError()
public RaiseException newErrnoEINVALError()
public RaiseException newErrnoENOENTError()
public RaiseException newErrnoESPIPEError()
public RaiseException newErrnoEBADFError(java.lang.String message)
public RaiseException newErrnoEINVALError(java.lang.String message)
public RaiseException newErrnoENOENTError(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 newIndexError(java.lang.String message)
public RaiseException newSecurityError(java.lang.String message)
public RaiseException newSystemCallError(java.lang.String message)
public RaiseException newTypeError(java.lang.String message)
public RaiseException newThreadError(java.lang.String message)
public RaiseException newSyntaxError(java.lang.String message)
public RaiseException newRegexpError(java.lang.String message)
public RaiseException newRangeError(java.lang.String message)
public RaiseException newNotImplementedError(java.lang.String message)
public RaiseException newInvalidEncoding(java.lang.String message)
public RaiseException newNoMethodError(java.lang.String message, java.lang.String name, IRubyObject args)
public RaiseException newNameError(java.lang.String message, java.lang.String name)
public RaiseException newLocalJumpError(java.lang.String reason, IRubyObject exitValue, java.lang.String message)
public RaiseException newLoadError(java.lang.String message)
public RaiseException newFrozenError(java.lang.String objectType)
public RaiseException newSystemStackError(java.lang.String message)
public RaiseException newSystemExit(int status)
public RaiseException newIOError(java.lang.String message)
public RaiseException newStandardError(java.lang.String message)
public RaiseException newIOErrorFromException(java.io.IOException ioe)
public RaiseException newTypeError(IRubyObject receivedObject, RubyClass expectedType)
public RaiseException newEOFError()
public RaiseException newZeroDivisionError()
public RaiseException newFloatDomainError(java.lang.String message)
public RubySymbol.SymbolTable getSymbolTable()
public void setStackTraces(int stackTraces)
public int getStackTraces()
public void setRandomSeed(long randomSeed)
public long getRandomSeed()
public java.util.Random getRandom()
public ObjectSpace getObjectSpace()
public java.util.Hashtable getIoHandlers()
public RubyFixnum[] getFixnumCache()
public long incrementRandomSeedSequence()
public java.io.InputStream getIn()
public java.io.PrintStream getOut()
public java.io.PrintStream getErr()
public boolean isGlobalAbortOnExceptionEnabled()
public void setGlobalAbortOnExceptionEnabled(boolean enable)
public boolean isDoNotReverseLookupEnabled()
public void setDoNotReverseLookupEnabled(boolean b)
public boolean registerInspecting(java.lang.Object obj)
public void unregisterInspecting(java.lang.Object obj)
public boolean isObjectSpaceEnabled()
public long getStartTime()
public Profile getProfile()
public java.lang.String getJRubyHome()
public void setJRubyHome(java.lang.String home)
public RubyInstanceConfig getInstanceConfig()
public long getGlobalState()
public void incGlobalState()
public static boolean isSecurityRestricted()
public static void setSecurityRestricted(boolean restricted)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |