args = rec.processForLearningMode(args);
String filePath = args[0];
IRuby runtime = JavaEmbedUtils.initialize(Collections.singletonList("."));
IRubyObject conn = JavaEmbedUtils.javaToRuby(runtime, new DefaultStreamConnection());
try {
// deprecated
runtime.getGlobalVariables().set(GlobalVariable.variableName("ssh"), conn);
runtime.getGlobalVariables().set(GlobalVariable.variableName("conn"), conn);
runtime.getGlobalVariables().set(GlobalVariable.variableName("args"), JavaEmbedUtils.javaToRuby(runtime, args));
runtime.loadFile(new File(filePath), false);
} catch (JumpException je) {
if (je.getJumpType() == JumpException.JumpType.RaiseJump) {
RubyException raisedException = ((RaiseException)je).getException();
if (raisedException.isKindOf(runtime.getClass("SystemExit"))) {
RubyFixnum status = (RubyFixnum)raisedException.getInstanceVariable("status");
if (status != null) {
System.exit(RubyNumeric.fix2int(status));
}
} else {
runtime.printError(raisedException);
System.exit(1);
}
} else if (je.getJumpType() == JumpException.JumpType.ThrowJump) {
runtime.printError((RubyException)je.getTertiaryData());
System.exit(1);
} else {
//throw je;
}
} catch(MainExitException e) {