Modified ruby script.

Now adds commas also at the end of each line.
Need to be checked if the last comma of the array can create some
issues.