Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Ruby on Rails template handler for the rbTenjin template engine.
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
tasks
test
MIT-LICENSE
README.rdoc
Rakefile
init.rb
install.rb
uninstall.rb

README.rdoc

Tor

Tor stands for 'Tenjin on Rails'. Tor is a Ruby on Rails plugin which enable views to be build on rbTenjin template engine. Tenjin is a very fast and full-featured template engine available in several script languages (incluing Ruby).

Tenjin

www.kuwata-lab.com/tenjin/

Installation

Tor depends on the tenjin gem. Download then tenjin gem from downloads.sourceforge.net/tenjin/tenjin-0.6.2.gem Go to the directory where the downloaded .gem file is and install the gem from it:

gem install tenjin --local

It is strongly encouraged to add tenjin gem to the Rails project. In the config/environment.rb add a line like the following inside the config block:

config.gem "tenjin", :version => '0.6.2'

Then unpack the gem into your Rails project:

rake gems:unpack GEM=tenjin

Next step is install Tor plugin:

./script/plugin install git://github.com/luishurtado/tor.git

About cache files

By default, rbTenjin will create .cache files in the same directory containing the view template. Tor changes this behavior and create .cache files under tmp/cache/tenjin directory if the Rails application.

Examples

Views with the .tenjin extension will automatically use Tenjin.

The following is a Tenjin template:

Hello #{@name}!
<ul>
<?rb for item in @items ?>
  <li>${item}</li>
<?rb end ?>
</ul>

<?rb ... ?> represents embedded Ruby statements. (the <% %> in ERB).

#{...} represents embedded Ruby expression. (the <%= %> in ERB).

${...} represents embedded escaped (sanitized) Ruby expression. (the <%=h %> in ERB)

Authors

Tor was created for Luis Hurtado to support a telecom project inside Assembla (www.assembla.com)

Tor is released under the MIT license.

Something went wrong with that request. Please try again.