Q:

Groovy ConfigSlurper Configure Arrays

I am trying to create a config that would look something like this:
nods = [
    nod {
        test = 1
    },
    nod {
        test = 2
    }
]

and then use configSlurper to read it but the "node" objects appear to be null after the read.
Here is my code:
final ConfigObject data = new ConfigSlurper().parse(new File("config.dat").toURI().toURL())
println  data.nods

and the output:
[null, null]

What am I doing wrong?
Thanks!

A:

It think I resolved it this way:
config {
   nods = [
      ['name':'nod1', 'test':true],
      ['name':'nod2', 'test':flase]
   ]
}

And then using it like:
config = new ConfigSlurper().parse(new File("config.groovy").text)
for( i in 0..config.config.nods.size()-1)
    println config.config.nods[i].test

Hope this helps someone else!!

