Top Fields Constructors Methods
org.jruby.embed.internal

public Class EmbedRubyRuntimeAdapterImpl

extends Object
implements EmbedRubyRuntimeAdapter
Class Inheritance
All Implemented Interfaces
org.jruby.embed.EmbedRubyRuntimeAdapter, org.jruby.RubyRuntimeAdapter
Imports
java.io.File, .FileInputStream, .FileNotFoundException, .IOException, .InputStream, .Reader, .StringReader, java.net.URL, java.util.Objects, org.jcodings.specific.UTF8Encoding, org.jruby.ParseResult, .Ruby, .RubyInstanceConfig.CompileMode, .RubyRuntimeAdapter, .RubyString, org.jruby.ast.executable.Script, org.jruby.embed.AttributeName, .EmbedEvalUnit, .EmbedRubyRuntimeAdapter, .ParseFailedException, .PathType, .ScriptingContainer, org.jruby.embed.io.ReaderInputStream, org.jruby.embed.util.SystemPropertyCatcher, org.jruby.exceptions.RaiseException, org.jruby.internal.runtime.GlobalVariable, .ValueAccessor, org.jruby.javasupport.JavaEmbedUtils, .JavaEmbedUtils.EvalUnit, org.jruby.parser.ParserType, .StaticScope, .StaticScopeFactory, org.jruby.runtime.DynamicScope, .Helpers, .IAccessor, org.jruby.runtime.builtin.IRubyObject, org.jruby.runtime.load.LoadService, org.jruby.runtime.scope.ManyVarsDynamicScope

Field Summary

Modifier and TypeField and Description
private final RubyRuntimeAdapter
private final ScriptingContainer
private final boolean

Constructor Summary

AccessConstructor and Description
public
public
EmbedRubyRuntimeAdapterImpl(ScriptingContainer container, boolean wrapExceptions)

Method Summary

Modifier and TypeMethod and Description
pack-priv static DynamicScope
createLocalVarScope(Ruby runtime, final String[] varNames)

public IRubyObject
eval(Ruby runtime, String script)

Implements org.jruby.RubyRuntimeAdapter.eval.

public EmbedEvalUnit
parse(String
is a Ruby script to be parsed
script
,
int...
are linenumbers to display for parse errors and backtraces. This field is optional. Only the first argument is used for parsing. When no line number is specified, 0 is applied to.
lines
)

Implements org.jruby.embed.EmbedRubyRuntimeAdapter.parse.

Parses a script and return an object which can be run().

public EmbedEvalUnit
parse(Reader
is used to read a script from
reader
,
String
is used as in information, for example, appears in a stack trace of an exception
filename
,
int...
are linenumbers to display for parse errors and backtraces. This field is optional. Only the first argument is used for parsing. When no line number is specified, 0 is applied to.
lines
)

Implements org.jruby.embed.EmbedRubyRuntimeAdapter.parse.

Parses a script given by a reader and return an object which can be run().

public EmbedEvalUnit
parse(PathType
is one of the types PathType defines
type
,
String
is used as in information, for example, appears in a stack trace of an exception
filename
,
int...
are linenumbers to display for parse errors and backtraces. This field is optional. Only the first argument is used for parsing. When no line number is specified, 0 is applied to.
lines
)

Implements org.jruby.embed.EmbedRubyRuntimeAdapter.parse.

Parses a script read from a specified path and return an object which can be run().

public EmbedEvalUnit
parse(InputStream
is an input stream to get a script from
istream
,
String
filename is used as in information, for example, appears in a stack trace of an exception
filename
,
int...
are linenumbers to display for parse errors and backtraces. This field is optional. Only the first argument is used for parsing. When no line number is specified, 0 is applied to.
lines
)

Implements org.jruby.embed.EmbedRubyRuntimeAdapter.parse.

Parses a script given by a input stream and return an object which can be run().

public JavaEmbedUtils.EvalUnit
parse(Ruby runtime, String script, String filename, int lineNumber)

Implements org.jruby.RubyRuntimeAdapter.parse.

public JavaEmbedUtils.EvalUnit
parse(Ruby runtime, InputStream istream, String filename, int lineNumber)

Implements org.jruby.RubyRuntimeAdapter.parse.

private EmbedEvalUnit
runParser(Object input, String filename, int... lines)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

adapterback to summary
private final RubyRuntimeAdapter adapter
containerback to summary
private final ScriptingContainer container
wrapExceptionsback to summary
private final boolean wrapExceptions

Constructor Detail

EmbedRubyRuntimeAdapterImplback to summary
public EmbedRubyRuntimeAdapterImpl(ScriptingContainer container)
EmbedRubyRuntimeAdapterImplback to summary
public EmbedRubyRuntimeAdapterImpl(ScriptingContainer container, boolean wrapExceptions)

Method Detail

createLocalVarScopeback to summary
pack-priv static DynamicScope createLocalVarScope(Ruby runtime, final String[] varNames)
evalback to summary
public IRubyObject eval(Ruby runtime, String script)

Implements org.jruby.RubyRuntimeAdapter.eval.

parseback to summary
public EmbedEvalUnit parse(String script, int... lines)

Implements org.jruby.embed.EmbedRubyRuntimeAdapter.parse.

Doc from org.jruby.embed.EmbedRubyRuntimeAdapter.parse.

Parses a script and return an object which can be run(). This allows the script to be parsed once and evaluated many times.

Parameters
script:String

is a Ruby script to be parsed

lines:int[]

are linenumbers to display for parse errors and backtraces. This field is optional. Only the first argument is used for parsing. When no line number is specified, 0 is applied to.

Returns:EmbedEvalUnit

an object which can be run

parseback to summary
public EmbedEvalUnit parse(Reader reader, String filename, int... lines)

Implements org.jruby.embed.EmbedRubyRuntimeAdapter.parse.

Doc from org.jruby.embed.EmbedRubyRuntimeAdapter.parse.

Parses a script given by a reader and return an object which can be run(). This allows the script to be parsed once and evaluated many times.

Parameters
reader:Reader

is used to read a script from

filename:String

is used as in information, for example, appears in a stack trace of an exception

lines:int[]

are linenumbers to display for parse errors and backtraces. This field is optional. Only the first argument is used for parsing. When no line number is specified, 0 is applied to.

Returns:EmbedEvalUnit

an object which can be run

parseback to summary
public EmbedEvalUnit parse(PathType type, String filename, int... lines)

Implements org.jruby.embed.EmbedRubyRuntimeAdapter.parse.

Doc from org.jruby.embed.EmbedRubyRuntimeAdapter.parse.

Parses a script read from a specified path and return an object which can be run(). This allows the script to be parsed once and evaluated many times.

Parameters
type:PathType

is one of the types PathType defines

filename:String

is used as in information, for example, appears in a stack trace of an exception

lines:int[]

are linenumbers to display for parse errors and backtraces. This field is optional. Only the first argument is used for parsing. When no line number is specified, 0 is applied to.

Returns:EmbedEvalUnit

an object which can be run

parseback to summary
public EmbedEvalUnit parse(InputStream istream, String filename, int... lines)

Implements org.jruby.embed.EmbedRubyRuntimeAdapter.parse.

Doc from org.jruby.embed.EmbedRubyRuntimeAdapter.parse.

Parses a script given by a input stream and return an object which can be run(). This allows the script to be parsed once and evaluated many times.

Parameters
istream:InputStream

is an input stream to get a script from

filename:String

filename is used as in information, for example, appears in a stack trace of an exception

lines:int[]

are linenumbers to display for parse errors and backtraces. This field is optional. Only the first argument is used for parsing. When no line number is specified, 0 is applied to.

Returns:EmbedEvalUnit

an object which can be run

parseback to summary
public JavaEmbedUtils.EvalUnit parse(Ruby runtime, String script, String filename, int lineNumber)

Implements org.jruby.RubyRuntimeAdapter.parse.

parseback to summary
public JavaEmbedUtils.EvalUnit parse(Ruby runtime, InputStream istream, String filename, int lineNumber)

Implements org.jruby.RubyRuntimeAdapter.parse.

runParserback to summary
private EmbedEvalUnit runParser(Object input, String filename, int... lines)