JRubyVerticle(String scriptName, ClassLoader cl) { this.container = new ScriptingContainer(LocalContextScope.SINGLETHREAD); container.setClassLoader(cl); // Prevent JRuby from logging errors to stderr - we want to log ourselves container.setErrorWriter(new NullWriter()); this.cl = cl; this.scriptName = scriptName; }
Engine(File root) { List<String> loadPaths = new ArrayList<String>(); loadPaths.add(new File(root, "lib").getAbsolutePath()); for (VirtualFile vf : Play.roots) { loadPaths.add(new File(vf.getRealFile(), "public/stylesheets").getAbsolutePath()); } scriptingContainer = new ScriptingContainer(); scriptingContainer.getProvider().setLoadPaths(loadPaths); scriptingContainer.setErrorWriter(errors); }