Skip to content

Instantly share code, notes, and snippets.

@bigtoast
Created October 18, 2011 23:14
Show Gist options
  • Save bigtoast/1297037 to your computer and use it in GitHub Desktop.
Save bigtoast/1297037 to your computer and use it in GitHub Desktop.
ConfigSluper for groovy
// create a file called datasources.config somewhere
// put in something like this
/*
datasource {
user = "atd"
pass = "chubs"
host = "localhost"
// yada yada
}
environments {
test {
datasource {
user = "testatd"
}
}
}
*/
def config = new ConfigSlurper("test").parse(new File("/Path/to/config").toURL())
// now use it.
def user = config.datasource.user
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment