Created
October 18, 2011 23:14
-
-
Save bigtoast/1297037 to your computer and use it in GitHub Desktop.
ConfigSluper for groovy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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