org.jruby.embed.internal
Class EmbedRubyRuntimeAdapterImpl

java.lang.Object
  extended by org.jruby.embed.internal.EmbedRubyRuntimeAdapterImpl
All Implemented Interfaces:
EmbedRubyRuntimeAdapter, RubyRuntimeAdapter

public class EmbedRubyRuntimeAdapterImpl
extends java.lang.Object
implements EmbedRubyRuntimeAdapter

Author:
Yoko Harada

Constructor Summary
EmbedRubyRuntimeAdapterImpl(ScriptingContainer container)
           
 
Method Summary
 IRubyObject eval(Ruby runtime, java.lang.String script)
           
 EmbedEvalUnit parse(java.io.InputStream istream, java.lang.String filename, int... lines)
          Parses a script given by a input stream and return an object which can be run().
 EmbedEvalUnit parse(PathType type, java.lang.String filename, int... lines)
          Parses a script read from a specified path and return an object which can be run().
 EmbedEvalUnit parse(java.io.Reader reader, java.lang.String filename, int... lines)
          Parses a script given by a reader and return an object which can be run().
 JavaEmbedUtils.EvalUnit parse(Ruby runtime, java.io.InputStream istream, java.lang.String filename, int lineNumber)
           
 JavaEmbedUtils.EvalUnit parse(Ruby runtime, java.lang.String script, java.lang.String filename, int lineNumber)
           
 EmbedEvalUnit parse(java.lang.String script, int... lines)
          Parses a script and return an object which can be run().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmbedRubyRuntimeAdapterImpl

public EmbedRubyRuntimeAdapterImpl(ScriptingContainer container)
Method Detail

parse

public EmbedEvalUnit parse(java.lang.String script,
                           int... lines)
Description copied from interface: EmbedRubyRuntimeAdapter
Parses a script and return an object which can be run(). This allows the script to be parsed once and evaluated many times.

Specified by:
parse in interface EmbedRubyRuntimeAdapter
Parameters:
script - is a Ruby script to be parsed
lines - 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:
an object which can be run

parse

public EmbedEvalUnit parse(java.io.Reader reader,
                           java.lang.String filename,
                           int... lines)
Description copied from interface: EmbedRubyRuntimeAdapter
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.

Specified by:
parse in interface EmbedRubyRuntimeAdapter
Parameters:
reader - is used to read a script from
filename - is used as in information, for example, appears in a stack trace of an exception
lines - 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:
an object which can be run

parse

public EmbedEvalUnit parse(PathType type,
                           java.lang.String filename,
                           int... lines)
Description copied from interface: EmbedRubyRuntimeAdapter
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.

Specified by:
parse in interface EmbedRubyRuntimeAdapter
Parameters:
type - is one of the types PathType defines
filename - is used as in information, for example, appears in a stack trace of an exception
lines - 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:
an object which can be run

parse

public EmbedEvalUnit parse(java.io.InputStream istream,
                           java.lang.String filename,
                           int... lines)
Description copied from interface: EmbedRubyRuntimeAdapter
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.

Specified by:
parse in interface EmbedRubyRuntimeAdapter
Parameters:
istream - is an input stream to get a script from
filename - filename is used as in information, for example, appears in a stack trace of an exception
lines - 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:
an object which can be run

eval

public IRubyObject eval(Ruby runtime,
                        java.lang.String script)
Specified by:
eval in interface RubyRuntimeAdapter

parse

public JavaEmbedUtils.EvalUnit parse(Ruby runtime,
                                     java.lang.String script,
                                     java.lang.String filename,
                                     int lineNumber)
Specified by:
parse in interface RubyRuntimeAdapter

parse

public JavaEmbedUtils.EvalUnit parse(Ruby runtime,
                                     java.io.InputStream istream,
                                     java.lang.String filename,
                                     int lineNumber)
Specified by:
parse in interface RubyRuntimeAdapter


Copyright © 2002-2009 JRuby Team. All Rights Reserved.