I'm using serverConfig to load properties at runtime into my ratpack app.
ratpack {
serverConfig {
// Load the environment and system properties
env()
sysProps()
require("/search", SearchConfig)
}
where SearchConfig is
class SearchConfig {
String limit
}
and the config file is like so
{
"search": {
"limit" : 100
}
}
For a more complete example, see http://kyleboon.org/blog/2016/01/10/layering-ratpack-configuration/ ).
Basically what I'm doing is passing in a gradle project property to define which JSON file holds the configuration I want, then parsing that JSON file into a hierarchical set of properties (the example above would be something like search.limit).
Is there a way to mimic that in spock?