Package org.jruby.embed.io

Examples of org.jruby.embed.io.WriterOutputStream


     */
    public void setOutput(Writer writer) {
        if (writer == null) {
            provider.getRubyInstanceConfig().setOutput(null);
        } else {
            WriterOutputStream ostream = new WriterOutputStream(writer);
            PrintStream pstream = new PrintStream(ostream);
            provider.getRubyInstanceConfig().setOutput(pstream);
        }
    }
View Full Code Here


     */
    public void setError(Writer writer) {
        if (writer == null) {
            provider.getRubyInstanceConfig().setError(null);
        } else {
            WriterOutputStream ostream = new WriterOutputStream(writer);
            PrintStream pstream = new PrintStream(ostream);
            provider.getRubyInstanceConfig().setError(pstream);
        }
    }
View Full Code Here

            if (old == writer) {
                return;
            }
        }
        map.put(AttributeName.WRITER, writer);
        PrintStream pstream = new PrintStream(new WriterOutputStream(writer));
        setOutputStream(pstream);
    }
View Full Code Here

            if (old == errorWriter) {
                return;
            }
        }
        map.put(AttributeName.ERROR_WRITER, errorWriter);
        PrintStream pstream = new PrintStream(new WriterOutputStream(errorWriter));
        setErrorStream(pstream);
    }
View Full Code Here

        runtime.getObject().storeConstant("STDERR", io);
        runtime.getGlobalVariables().alias("$deferr", "$stderr");
    }
   
    private static RubyIO getRubyIO(Ruby runtime, Writer writer) throws IOException, BadDescriptorException {
        PrintStream pstream = new PrintStream(new WriterOutputStream(writer), true);
        RubyIO io = new RubyIO(runtime, pstream, false);
        io.getOpenFile().getMainStreamSafe().setSync(true);
        io.getOpenFile().getMainStreamSafe().fflush();
        return io;
    }
View Full Code Here

     */
    public void setOutput(Writer writer) {
        if (writer == null) {
            provider.getRubyInstanceConfig().setOutput(null);
        } else {
            WriterOutputStream ostream = new WriterOutputStream(writer);
            PrintStream pstream = new PrintStream(ostream);
            provider.getRubyInstanceConfig().setOutput(pstream);
        }
    }
View Full Code Here

     */
    public void setError(Writer writer) {
        if (writer == null) {
            provider.getRubyInstanceConfig().setError(null);
        } else {
            WriterOutputStream ostream = new WriterOutputStream(writer);
            PrintStream pstream = new PrintStream(ostream);
            provider.getRubyInstanceConfig().setError(pstream);
        }
    }
View Full Code Here

            if (old == writer) {
                return;
            }
        }
        map.put(AttributeName.WRITER, writer);
        PrintStream pstream = new PrintStream(new WriterOutputStream(writer));
        setOutputStream(pstream);
    }
View Full Code Here

            if (old == errorWriter) {
                return;
            }
        }
        map.put(AttributeName.ERROR_WRITER, errorWriter);
        PrintStream pstream = new PrintStream(new WriterOutputStream(errorWriter));
        setErrorStream(pstream);
    }
View Full Code Here

                if (appRubyPath != null) {
                    StringTokenizer tok = new StringTokenizer(appRubyPath, ";");
                    while (tok.hasMoreTokens())
                        loadPaths.add(tok.nextToken().replace('/', File.separatorChar));
                }
                config.setOutput(new PrintStream(new WriterOutputStream(out)));
                config.setError(new PrintStream(new WriterOutputStream(err)));
                interpreter = JavaEmbedUtils.initialize(loadPaths, config);
                interpreter.evalScriptlet("require 'marathon/results'");
            }
            if (type == MarathonAppType.JAVA) {
                interpreter.evalScriptlet("require 'marathon/playback'");
View Full Code Here

TOP

Related Classes of org.jruby.embed.io.WriterOutputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.