Groovysh shell = new Groovysh(cl, binding, io, registrar); shell.getImports().add("hudson.model.*");
public void run(final ClassLoader classLoader) throws Exception { assert classLoader != null; Groovysh shell = new Groovysh(classLoader, new Binding(), io); shell.run(args); } }
public void run() throws Exception { Groovysh shell = new Groovysh(io); shell.run(args); } }
public void run(final ClassLoader classLoader) throws Exception { assert classLoader != null; Groovysh shell = new Groovysh(classLoader, new Binding(), io); shell.run(args); } }
public void run(final ClassLoader classLoader) throws Exception { assert classLoader != null; Groovysh shell = new Groovysh(classLoader, new Binding(), io); shell.run(args); } }
public void run(final ClassLoader classLoader) throws Exception { assert classLoader != null; Groovysh shell = new Groovysh(classLoader, new Binding(), io); shell.run(args); } }
public void run(final ClassLoader classLoader) throws Exception { assert classLoader != null; Groovysh shell = new Groovysh(classLoader, new Binding(), io); shell.run(args); } }
public static void main( String... args ) throws IOException { PropertyConfigurator.configure( System.getProperty( "log4j.configuration" ) ); if( args.length > 0 ) { GroovyMain.main( args ); } else { Groovysh shell = new Groovysh(); for( String name : IMPORTS ) { shell.execute( "import " + name ); } shell.run( null ); } }
public static void main( String... args ) throws IOException { PropertyConfigurator.configure( System.getProperty( "log4j.configuration" ) ); if( args.length > 0 ) { GroovyMain.main( args ); } else { Groovysh shell = new Groovysh(); for( String name : IMPORTS ) { shell.execute( "import " + name ); } shell.run( null ); } }
private Groovysh createShell() { if (welcomeMessage != null) { writer.println(SEPARATOR_BAR); writer.println(welcomeMessage); writer.println(SEPARATOR_BAR); } binding.setVariable(OUT_KEY, out); final CompilerConfiguration config = new CompilerConfiguration(); final GroovyClassLoader loader = new GroovyClassLoader(this.getClass().getClassLoader(), config); final Groovysh shell = new Groovysh(loader, binding, new IO(in, out, out)); writer.flush(); return shell; }
private Groovysh createShell() { if (welcomeMessage != null) { writer.println(SEPARATOR_BAR); writer.println(welcomeMessage); writer.println(SEPARATOR_BAR); } binding.setVariable(OUT_KEY, out); final CompilerConfiguration config = new CompilerConfiguration(); final GroovyClassLoader loader = new GroovyClassLoader(this.getClass().getClassLoader(), config); final Groovysh shell = new Groovysh(loader, binding, new IO(in, out, out)); writer.flush(); return shell; }
final Groovysh groovy = new Groovysh(binding, new IO(in, out, out));
Groovysh shell = new Groovysh(cl, binding, io, registrar); shell.getImports().add("import hudson.model.*");
Groovysh shell = new Groovysh(cl, binding, io, registrar); shell.getImports().add("import hudson.model.*");
Groovysh shell = new Groovysh(cl, binding, io, registrar); shell.getImports().add("import hudson.model.*");
@Override public void run(final ClassLoader classLoader, final ResourceLoader resourceLoader, final Map<String, Object> context, final @Nullable Map<String, Object> options) throws Exception { checkNotNull(classLoader); checkNotNull(resourceLoader); checkNotNull(context); log.trace("Running; class-loader: {}, resource-loader: {}, context: {}", classLoader, resourceLoader, context); GroovyClassLoader gcl = runtime.createGroovyClassLoader(classLoader, resourceLoader); Binding binding = runtime.createBinding(context); Groovysh shell = new Groovysh(gcl, binding, new IO()); if (options != null) { configureOptions(shell, options); } try { shell.run(null); } finally { gcl.clearCache(); } }
@Override public void run(final ClassLoader classLoader, final ResourceLoader resourceLoader, final Map<String, Object> context, final @Nullable Map<String, Object> options) throws Exception { checkNotNull(classLoader); checkNotNull(resourceLoader); checkNotNull(context); log.trace("Running; class-loader: {}, resource-loader: {}, context: {}", classLoader, resourceLoader, context); GroovyClassLoader gcl = runtime.createGroovyClassLoader(classLoader, resourceLoader); Binding binding = runtime.createBinding(context); Groovysh shell = new Groovysh(gcl, binding, new IO()); if (options != null) { configureOptions(shell, options); } try { shell.run(); } finally { gcl.clearCache(); } }
public Console(final IO io, final String inputPrompt, final String resultPrompt) { io.out.println(); io.out.println(" \\,,,/"); io.out.println(" (o o)"); io.out.println("-----oOOo-(_)-oOOo-----"); final Groovysh groovy = new Groovysh(); groovy.setResultHook(new NullResultHookClosure(groovy)); for (final String imps : Imports.getImports()) { groovy.execute("import " + imps); } for (final String evs : Imports.getEvaluates()) { groovy.execute(evs); } groovy.setResultHook(new ResultHookClosure(groovy, io, resultPrompt)); groovy.setHistory(new History()); final InteractiveShellRunner runner = new InteractiveShellRunner(groovy, new PromptClosure(groovy, inputPrompt)); runner.setErrorHandler(new ErrorHookClosure(runner, io)); try { runner.setHistory(new History(new File(System.getProperty("user.home") + "/" + HISTORY_FILE))); } catch (IOException e) { io.err.println("Unable to create history file: " + HISTORY_FILE); } Gremlin.load(); FaunusGremlin.load(); try { runner.run(); } catch (Error e) { //System.err.println(e.getMessage()); } }
System.setProperty("java.awt.headless", "true"); // don't start awt/swing Groovysh ish= new Groovysh(binding, io);
public GremlinWebConsole( Binding bindings, IO io ) { groovy = new Groovysh( bindings, io ); groovy.setResultHook( new NullResultHookClosure( groovy ) ); for ( String imps : Imports.getImports() ) { groovy.execute( "import " + imps ); } for ( String imps : Neo4jGroovyImports.getImports() ) { groovy.execute( "import " + imps ); } groovy.execute( "import com.tinkerpop.gremlin.groovy.*" ); // groovy.execute( "import .*" ); groovy.setResultHook( new GremlinResultHook( groovy, io ) ); Gremlin.load(); }