I recently encountered a strange problem when trying to redirect the ScriptEngine output for my ruby session. It seems that no matter what Ipass in to my ScriptEngine, it always prints to stdout and stderr. I found this post, but it says it's fixed.
https://scripting.dev.java.net/issues/show_bug.cgi?id=8
scriptContext.setWriter(outWriter);
scriptContext.setErrorWriter(errWriter);
ruby.setContext(scriptContext);
ruby.eval(...)
I'm running through sbt and using the latest version of the jruby-complete.jar, yet it still goes to stdout every time. Has this issue truly been resolved?
I've also trying passing eval(...)
a StringWriter, but I get an array exception when I try to pull a string out afterwards.