html-template-pro
What
A Ruby port of HTML::Template::Pro (template engine originally written
in Perl and XS).
Installing
sudo gem install html-template-pro
The basics
# foo.rb
require 'html/template/pro'
template = HTML::Template::Pro.new(:filename => 'foo.tmpl')
template.param(:param1 => 100)
puts template.output
# foo.tmpl
<html>
<head></head>
<body>
<h1><TMPL_VAR NAME="param1"></h1>
</body>
</html>
# results
$ ruby foo.rb
<html>
<head></head>
<body>
<h1>100</h1>
</body>
</html>
Template syntax compies with original Perl module’s. See also,
HTML::Template::SYNTAX
Project
- rubyforge: http://rubyforge.org/scm/?group_id=9030
- rdoc documentations: http://tmplpro.rubyforge.org/rdoc/
git clone git://github.com/tom-lpsd/ruby-html-template-pro.git
Build and test instructions
cd ruby-html-template-pro rake test rake install_gem
License
This library is free software; you can redistribute it and/or modify
it under the same terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
Contact
Comments are welcome. Send an email to Tom Tsuruhara
Tom Tsuruhara, 2nd October 2009
Theme extended from Paul Battley