public RubyParser( ExecuteManager executeManager ) throws IOException { this.executeManager = executeManager; this.jruby = new IsolatedScriptingContainer(); this.parser = jruby.runScriptlet( PathType.CLASSPATH, "parser.rb" ); this.factory = new RubyExecuteTaskFactory( jruby ); }
public synchronized Model parse( String ruby, File source, Map<String, ?> options ) { Model model = this.jruby.callMethod( this.parser, "parse", new Object[] { ruby, this.factory, source != null ? source.getAbsolutePath() : null }, Model.class ); model.setPomFile( source ); executeManager.register( model, this.factory.getExecuteTasks() ); executeManager.install( model, options ); return model; } }
public IsolatedScriptingContainer( LocalContextScope scope, LocalVariableBehavior behavior, boolean lazy ) { super(scope, behavior, lazy); List<String> loadPaths = new LinkedList<String>(); loadPaths.add(URI_CLASSLOADER); setLoadPaths(loadPaths); // set the right jruby home UriLikePathHelper uriPath = new UriLikePathHelper(new ClassesLoader(getClassLoader())); URL url = uriPath.getResource("/.jrubydir"); if (url != null){ setCurrentDirectory( URI_CLASSLOADER ); } // setup the isolated GEM_PATH, i.e. without $HOME/.gem/** setEnvironment(null); // give preference to jrubyClassloader over parent-classloader getProvider().getRubyInstanceConfig().setClassloaderDelegate(false); }
public IsolatedScriptingContainer( LocalContextScope scope, LocalVariableBehavior behavior, boolean lazy ) { super(scope, behavior, lazy); List<String> loadPaths = new LinkedList<String>(); loadPaths.add(URI_CLASSLOADER); setLoadPaths(loadPaths); // set the right jruby home UriLikePathHelper uriPath = new UriLikePathHelper(new ClassesLoader(getClassLoader())); URL url = uriPath.getResource("/.jrubydir"); if (url != null){ setCurrentDirectory( URI_CLASSLOADER ); } // setup the isolated GEM_PATH, i.e. without $HOME/.gem/** setEnvironment(null); // give preference to jrubyClassloader over parent-classloader getProvider().getRubyInstanceConfig().setClassloaderDelegate(false); }
public RubyParser( ExecuteManager executeManager ) throws IOException { this.executeManager = executeManager; this.jruby = new IsolatedScriptingContainer(); this.parser = jruby.runScriptlet( PathType.CLASSPATH, "parser.rb" ); this.factory = new RubyExecuteTaskFactory( jruby ); }
public synchronized Model parse( String ruby, File source, Map<String, ?> options ) { Model model = this.jruby.callMethod( this.parser, "parse", new Object[] { ruby, this.factory, source != null ? source.getAbsolutePath() : null }, Model.class ); model.setPomFile( source ); executeManager.register( model, this.factory.getExecuteTasks() ); executeManager.install( model, options ); return model; } }