Walrus
Walrus is a free Object-Oriented templating engine written in Ruby and licensed under the GPL. Plain text templates are compiled down to Ruby code; final output is produced by executing ("filling") the compiled templates. A walrus commandline tool is included to make compiling and filling templates easy. Walrus includes a sophisticated parser generator that can make packrat parsers capable of recognizing Parsing Expression Grammars (including grammars that include left-recursion), and outputting arbitrarily complex Abstract Syntax Trees.
Walrus was inspired by the Cheetah template engine written in Python.
For more information about Walrus see these articles published during its development:
- "Test-Driven Development"
- "Progress notes"
- "Abstract Syntax Trees"
- "Putting the 'packrat' into PEG: adding memoizing to my Ruby parser generator"
- "Updated packrat performance numbers"
- "Parser generator update"
- "Another performance update: parity"
- "Here documents"
- "Goodbye parity, hello superiority"
- "Payoff time"
Donations
Walrus is free software released under the GPL license. If it is useful to you, please consider making a donation.
Downloading from RubyForge
See the RubyForge file listing.
To install using RubyGems:
sudo gem install walrus
Obtaining via Git
git clone git://git.wincent.com/Walrus.git
Browsing the Git source repository
The source code repository can be explored in a browser using the the web interface.
Obtaining via Subversion
svn co svn://svn.wincent.com/Walrus/trunk
Note: All new development work is managed in the Git repository; the Subversion repository is being left on line for historical reasons only.
Building from source
Before using Walrus you must build the C extensions upon which it depends; you can do this from inside the root of the source tree by executing the following:
rake make
You can run the specs by doing the following:
rake spec
An XML feed showing recent commits to the repository is also available (more information).


