Package org.jruby
Class Main
java.lang.Object
org.jruby.Main
Class used to launch the interpreter.
This is the main class as defined in the jruby.mf manifest.
It is very basic and does not support yet the same array of switches
as the C interpreter.
Usage: java -jar jruby.jar [switches] [rubyfile.rb] [arguments]
-e 'command' one line of script. Several -e's allowed. Omit [programfile]
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionMain()privateMain(boolean hardExit) Main(InputStream in, PrintStream out, PrintStream err) Main(RubyInstanceConfig config) privateMain(RubyInstanceConfig config, boolean hardExit) -
Method Summary
Modifier and TypeMethodDescriptionprivate booleancheckFileSyntax(Ruby runtime, String filename) private booleancheckStreamSyntax(Ruby runtime, InputStream in, String filename) private voidprivate Main.StatusdoCheckSyntax(Ruby runtime, InputStream in, String filename) private static voidprivate voidprivate voiddoPrintUsage(boolean force) private voiddoRunFromMain(Ruby runtime, InputStream in, String filename) private voiddoSetContextClassLoader(Ruby runtime) private voidprivate voidprivate StringgetRuntimeFlagValue(String prefix) private Main.Statusprivate Main.StatusPrint a nicer memory error since Rubyists aren't used to seeing this.protected static intThis is only used from the main(String[]) path, in which case the err for this run should be System.err.private Main.StatusPrint a nicer stack size error since Rubyists aren't used to seeing this.private static intprivate Main.Statusprivate Main.Statusprivate static voidloadJRubyProperties(File dotfile) static voidThis is the command-line entry point for JRuby, and should ONLY be used by Java when starting up JRuby from a command-line.static voidrun()Deprecated.
-
Field Details
-
LOG
-
config
-
-
Constructor Details
-
Main
-
Main
-
Main
public Main() -
Main
-
Main
private Main(boolean hardExit)
-
-
Method Details
-
getDotfileDirectories
-
processDotfile
public static void processDotfile() -
loadJRubyProperties
-
main
This is the command-line entry point for JRuby, and should ONLY be used by Java when starting up JRuby from a command-line. Use other mechanisms when embedding JRuby into another application.- Parameters:
args- command-line args, provided by the JVM.
-
run
-
run
Deprecated. -
internalRun
-
handleUnsupportedClassVersion
-
handleStackOverflow
Print a nicer stack size error since Rubyists aren't used to seeing this. -
handleOutOfMemory
Print a nicer memory error since Rubyists aren't used to seeing this. -
getRuntimeFlagValue
-
handleMainExit
-
doRunFromMain
-
doCheckSyntax
private Main.Status doCheckSyntax(Ruby runtime, InputStream in, String filename) throws RaiseException - Throws:
RaiseException
-
checkFileSyntax
-
checkStreamSyntax
-
doSetContextClassLoader
-
doPrintProperties
private void doPrintProperties() -
doPrintUsage
private void doPrintUsage(boolean force) -
doShowCopyright
private void doShowCopyright() -
doShowVersion
private void doShowVersion() -
doGCJCheck
private static void doGCJCheck() -
doCheckSecurityManager
private void doCheckSecurityManager() -
handleRaiseException
This is only used from the main(String[]) path, in which case the err for this run should be System.err. In order to avoid the Ruby err being closed and unable to write, we use System.err unconditionally.- Parameters:
ex-- Returns:
-
handleUnexpectedJump
-