Usually, I get up early in the morning. Today, I got up a bit earlier, with some ideas about how to implement a simple template engine for my personal project, AjGenesis in Ruby. Then, I put my hands at work, and 3 hours later I had a solution, built using TDD (I made frequent commits, so you can see the progress of development in the GitHub Log).
The result at my GitHub account:
In that project, I separated the template engine in another package:
In this way, I designed the template format to be similar to the original templates in classic AjGenesis.
a simple MVC implementation over NodeJs/Express.
So, now you have three projects:
- Classical AjGenesis code generation, implemented in .NET (see examples folder)
- AjGenesis in Ruby, with a similar internal template engine, with interpolated Ruby expressions, and embedded Ruby commands (see samples folder)
AjGenesis in Ruby is still not a gem: work in progress.
REMEMBER: all these projects GENERATES the text artifacts YOU WANT to generate. There are not limited to a technology, platform or programming languages.
It’s really interesting to see how simple ideas can be reimplemented in dynamic languages. Next steps: more samples, ruby gem, node package, and web site implementing code generation as a service (ASP.NET implementation commented in my old post). (see AjGenesis: Basis of Its Implementation).
Pending implementation languages: Python, maybe Java.