From Java to Groovy
Recently I’ve been playing with some old Java Swing applications and I found myself wishing that I could replace all the anonymous inner-classes with some clean Groovy closures. The job of converting a java source file to a groovy source file is pretty simple and eminently scriptable. Here’s my take on a python script to do just that: from optparse import OptionParser from subprocess import Popen, PIPE import os def rename(src, dest, use_svn): if use_svn: output = Popen(['svn', 'rename', src, dest], stdout=PIPE)....