Package org.jruby.RubyInstanceConfig

Examples of org.jruby.RubyInstanceConfig.CompileMode


        ScriptingContainer instance = new ScriptingContainer(LocalContextScope.THREADSAFE);
        instance.setError(pstream);
        instance.setOutput(pstream);
        instance.setWriter(writer);
        instance.setErrorWriter(writer);
        CompileMode expResult = CompileMode.OFF;
        CompileMode result = instance.getCompileMode();
        assertEquals(expResult, result);

        instance = null;
    }
View Full Code Here


     * Test of setCompileMode method, of class ScriptingContainer.
     */
    @Test
    public void testSetCompileMode() {
        logger1.info("setCompileMode");
        CompileMode mode = null;
        ScriptingContainer instance = new ScriptingContainer(LocalContextScope.THREADSAFE);
        instance.setError(pstream);
        instance.setOutput(pstream);
        instance.setWriter(writer);
        instance.setErrorWriter(writer);
View Full Code Here

            if (input instanceof String) {
                node = runtime.parseEval((String)input, filename, scope, line);
            } else {
                node = runtime.parseFile((InputStream)input, filename, scope, line);
            }
            CompileMode compileMode = runtime.getInstanceConfig().getCompileMode();
            if (compileMode == CompileMode.FORCE) {
                // we pass in an ASTInspector that will force heap variables, so
                // it uses our shared scope
                ASTInspector inspector = new ASTInspector();
                inspector.setFlag(ASTInspector.SCOPE_AWARE);
View Full Code Here

            if (sharing_variables) {
                vars.inject(scope, 0, null);
                runtime.getCurrentContext().pushScope(scope);
            }
            IRubyObject ret;
            CompileMode mode = runtime.getInstanceConfig().getCompileMode();
            if (mode == CompileMode.FORCE) {
                ret = runtime.runScriptBody(script);
            } else {
                ret = runtime.runInterpreter(node);
            }
View Full Code Here

            if (sharing_variables) {
                vars.inject(scope, 0, null);
                threadContext.pushScope(scope);
            }
            IRubyObject ret;
            CompileMode mode = runtime.getInstanceConfig().getCompileMode();
            if (mode == CompileMode.FORCE) {
                ret = runtime.runScriptBody(script);
            } else {
                ret = runtime.runInterpreter(node);
            }
View Full Code Here

            if (input instanceof String) {
                node = runtime.parseEval((String)input, filename, scope, line);
            } else {
                node = runtime.parseFile((InputStream)input, filename, scope, line);
            }
            CompileMode compileMode = runtime.getInstanceConfig().getCompileMode();
            if (compileMode == CompileMode.FORCE) {
                // we pass in an ASTInspector that will force heap variables, so
                // it uses our shared scope
                ASTInspector inspector = new ASTInspector();
                inspector.setFlag(ASTInspector.SCOPE_AWARE);
View Full Code Here

     * Test of setCompileMode method, of class ScriptingContainer.
     */
    @Test
    public void testSetCompileMode() {
        logger1.info("setCompileMode");
        CompileMode mode = null;
        ScriptingContainer instance = new ScriptingContainer(LocalContextScope.THREADSAFE);
        instance.setError(pstream);
        instance.setOutput(pstream);
        instance.setWriter(writer);
        instance.setErrorWriter(writer);
View Full Code Here

            vars.inject(scope, 0, null);
            threadContext.pushScope(scope);
        }
        try {
            IRubyObject ret;
            CompileMode mode = runtime.getInstanceConfig().getCompileMode();
            if (mode == CompileMode.FORCE) {
                ret = runtime.runScriptBody(script);
            } else {
                ret = runtime.runInterpreter(node);
            }
View Full Code Here

            if (input instanceof String) {
                node = runtime.parseEval((String)input, filename, scope, line);
            } else {
                node = runtime.parseFile((InputStream)input, filename, scope, line);
            }
            CompileMode compileMode = runtime.getInstanceConfig().getCompileMode();
            if (compileMode == CompileMode.FORCE) {
                // CON FIXME: We may need to force heap variables here so the compiled script uses our provided scope
                Script script = runtime.tryCompile(node);
                if (script != null) {
                    return new EmbedEvalUnitImpl(container, node, scope, script);
View Full Code Here

TOP

Related Classes of org.jruby.RubyInstanceConfig.CompileMode

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.