Package org.jruby.ast.executable

Examples of org.jruby.ast.executable.Script


        this.resource = resource;
    }

    public void load(Ruby runtime, boolean wrap) {
        try {
            Script script = CompiledScriptLoader.loadScriptFromFile(runtime, resource.getInputStream(), resource.getName());
            if (script == null) {
                // we're depending on the side effect of the load, which loads the class but does not turn it into a script
                // I don't like it, but until we restructure the code a bit more, we'll need to quietly let it by here.
                return;
            }
            script.setFilename(resource.getName());
            runtime.loadScript(script, wrap);
        } catch (IOException e) {
            throw runtime.newIOErrorFromException(e);
        }
    }
View Full Code Here


                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);
                } else {
                    return new EmbedEvalUnitImpl(container, node, scope);
                }
View Full Code Here

        private void loadScript(Ruby runtime, InputStream is, boolean wrap) {
            runtime.loadFile(scriptName, is, wrap);
        }

        private void loadClass(Ruby runtime, InputStream is, boolean wrap) {
            Script script = CompiledScriptLoader.loadScriptFromFile(runtime, is, searchName);
            if (script == null) {
                // we're depending on the side effect of the load, which loads the class but does not turn it into a script
                // I don't like it, but until we restructure the code a bit more, we'll need to quietly let it by here.
                return;
            }
            script.setFilename(scriptName);
            runtime.loadScript(script, wrap);
        }
View Full Code Here

TOP

Related Classes of org.jruby.ast.executable.Script

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.