Great, the code is here:
http://code.google.com/p/json-template/source/checkout
Just check it out with svn. Basically:
1) Make sure you can run the tests ('python jsontemplate_test.py',
will require simplejson). This runs just the Python tests.
2) Try running at least one other set of tests to get a feel for how
it works, e.g. with the --javascript, --java, or --php flags (they
require different interpreters, as Ruby will obviously).
Look at the verifier.py shim in each language directory. This is the
key to making the Python tests work against other languages. It's
basically a bridge so you can serialize the test case over the process
boundary between Python and Ruby interpreters. This means we have one
authoritative set of tests instead of many, and also conveniently
relieves you of having to write detailed tests (although
language-specific tests are welcome and may help you develop the
smaller units).
3) Write the verifier.py shim. You have to fill in 3 methods --
Expansion, CompilationError, EvaluationError. This should be pretty
easy. The Python, JavaScript, and Java ones are slightly different so
copy the one you like and make it work for Ruby.
You'll need some Ruby code to call into your Ruby implementation from
the test too.
4) The -t and -m regex filters on jsontemplate_test.py will help
isolate test runs. It should be pretty gratifying to see it go from 0
passing to 38 passing or however many tests we have now. : )
Since Ruby is similar to Python in so many ways, it will probably work
very well to just port it line-by-line, using the tests as a guide.
The JavaScript version was a line-by-line port, with some idiom
adjustments, and it works quite well.
Let us know if you have any other questions.
thanks,
Andy