gomoob/grunt-flyway — pull request #2 by msulima (2013-10-11 08:57:59+00:00)
Title: Fix for bug with nested parameters

Hi, I've noticed that if you pass an option with nested properties, for example:

```
options: {
locations: "sql",
placeholders: {
schema: "dbo",
database_name: "my_database"
}
}
```

then a wrong shell command is generated:

```
-locations="sql" -placeholders.0="undefined" -placeholders.1="undefined"
```

That's because `for ... in` loop in `tasks/flyway.js:184` iterates over array `[0, 1]`, not `['schema', 'placeholder']`.

A simple fix for that would be:

```
Object.keys(options[option]).forEach(function (parameter) {
flywayCommand += Util.format(' -%s.%s="%s"', option, parameter, options[option][parameter]);
});
```

That's exaclty how @Xylem has proposed it in his pull request: https://github.com/Xylem/grunt-flyway/commit/8f72a4b4a34cdf3c3983396c12243e52f5e888b1#diff-38454901a786ea5ef27bd2be1e76b221R162 .

However I though it would be better to move command parameters building operation to a separate file, extend by adding more nesting levels and write some tests for it. Could you include these changes in your plugin?