Well, the solution is in the Java File class:
println new File(".").absolutePath
If you want to get every groovy script in the same directory, perhaps you could use some other features in the groovy JDK, for example eachFile:
def files = []
new File(".").eachFile {
if (it.name.endsWith(".groovy") ) files << it
}
println files
script, (http://jira.codehaus.org/browse/GROOVY -1642)
JIRA ( ):
URL scriptUrl = getClass().classLoader.resourceLoader
.loadGroovySource(getClass().name)