otwcode/otwarchive — pull request #1777 by duckinator (2014-08-10 11:51:20+00:00)
Title: ValidationHelper cleanup

Hey!

So, basically:

1. JSON = JavaScript Object Notation = a subset of JavaScript.
2. I noticed that this code was printing JavaScript objects, meaning _they were basically valid JSON._
3. Ruby has some magnificent `.to_json` magic.
4. ???
5. ~~PROFIT!!!~~ The code is far, far more maintainable!

I added tests and iteratively changed things so it was generating JSON, _then_ did the rewrite of the functionality. This way anyone who wants to look can easily determine that the only differences are non-significant whitespace and using double quotes instead of single quotes.