Skip to content

Commit

Permalink
Once more, with feeling: All output should go to the right place
Browse files Browse the repository at this point in the history
  • Loading branch information
espenhw committed Mar 4, 2009
1 parent fade1a8 commit cfc73d8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/main/groovy/org/grumblesmurf/malabar/GroovyServer.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,11 @@ class GroovyServer
return io.get()?.out ?: System.out
}

static Closure printlnClosure = { String it ->
GroovyServer.getOut().println(it)
}

static Closure printClosure = { String it ->
GroovyServer.getOut().print(it)
}

static void main(String[] args) {
ExpandoMetaClass.enableGlobally();

Object.metaClass.println = printlnClosure;
Object.metaClass.print = printClosure;
Object.metaClass.println = Utils.&println;
Object.metaClass.print = Utils.&print;

def cli = new CliBuilder();
cli.c(longOpt: 'compilerPort', args: 1, required: true, 'compiler port');
Expand Down
8 changes: 8 additions & 0 deletions src/main/groovy/org/grumblesmurf/malabar/Utils.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ package org.grumblesmurf.malabar

class Utils
{
static print(Object v) {
GroovyServer.getOut().print(v);
}

static println(Object v) {
GroovyServer.getOut().println(v);
}

static printAsLispList(List list) {
print "("
list.each {
Expand Down

0 comments on commit cfc73d8

Please sign in to comment.