Package org.jruby.embed

Examples of org.jruby.embed.ScriptingContainer.runScriptlet()


        container.runScriptlet("require 'rubygems'; require 'sass';");

        String sass = ".test\n\tcolor: red";
        container.put("str", sass);
       
        String css = (String)container.runScriptlet("Sass::Engine.new(str).render");

        assertEquals(".test {\n  color: red; }\n", css);
    }

}
View Full Code Here


    private List<Job> configureJobs(String jobSetupScript, String[] arguments) throws Exception {
        ScriptingContainer runtime = InstanceContainer.getRuntime();
        Configuration conf = getConf();
        conf.set(InstanceContainer.JOB_SETUP_SCRIPT_KEY, jobSetupScript);
        Object contextClass = runtime.runScriptlet("Rubydoop::Context");
        Object context = runtime.callMethod(contextClass, "new", conf, arguments);
        runtime.put("$rubydoop_context", context);

        try {
            runtime.callMethod(null, "require", jobSetupScript);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.