Skip to content

Commit

Permalink
Import version 0.6.2 of rbTenjin
Browse files Browse the repository at this point in the history
  • Loading branch information
Luis Hurtado committed Jun 1, 2009
0 parents commit e882636
Show file tree
Hide file tree
Showing 190 changed files with 18,447 additions and 0 deletions.
76 changes: 76 additions & 0 deletions CHANGES.txt
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,76 @@
=begin
= CHANGES


== Release 0.6.2 (2008-02-24)

* Rubinius supported.

* Changed to convert texts before expressions into spaces when
command-line option '-S' specified.

ex. hoge.rbhtml
<?rb for item in @list ?>
<p>${item}</p>
<?rb end ?>

ex. result of '-S'
## 0.6.1
$ rbtenjin -S hoge.rbhtml
_buf = ''; for item in @list
escape((item).to_s);
end
_buf.to_s

## 0.6.2
$ rbtenjin -S hoge.rbhtml
_buf = ''; for item in @list
escape((item).to_s);
end
_buf.to_s



== Release 0.6.1 (2007-02-07)

=== Enhancements

* It is able to make any class which includes
Tenjin::ContextHelper module as context object class.
This is useful if you want to define helper functions
as instance method of that class.
See section 'Add Your Helper Functions' for details.
http://www.kuwata-lab.com/tenjin/rbtenjin-users-guide.html#dev-helpers

ex.
require 'tenjin'

class MyClass
include Tenjin::ContextHelper
#include Tenjin::HtmlHelper # optional

## define helper functions in current class
def link_to(label, url)
return "<a href=\"#{escape(url)}\">#{escape(label)}</a>"
end

def render_template(template_name)
engine = Tenjin::Engine.new()
## pass self as context object
output = engine.render(template_name, self)
return output
end

def main
## set context data as instance variables
@label = 'Top'
@url = '/'
output = render_template('example.rbhtml')
print output
end

end

MyClass.new.main()

=end
20 changes: 20 additions & 0 deletions MIT-LICENSE
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,20 @@
copyright(c) 2007-2008 kuwata-lab.com all rights reserved.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
56 changes: 56 additions & 0 deletions README.txt
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,56 @@
= README

release:: 0.6.2
copyright:: copyright(c) 2007-2008 kuwata-lab.com all rights reserved.


== About

rbTenjin is a very fast and full-featured template engine.
You can embed Ruby statements and expressions into your text file.
rbTenjin converts it into Ruby program and evaluate it.


== Features

* Very fast (twice faster than eruby and three times faster than ERB)
* Lightweight (only a file which contains about 1000 lines)
* Not break HTML design because it uses XML Processing
Instructions (PI) as embedded notation for Python statements.
* Secure because it supports escaping expression value by default.
* Auto caching of converted Python code.
* Nestable layout template
* Inlucde other templates
* Capture part of template
* Load YAML file as context data
* Preprocessing support

See doc/*.html for details.


== Installation

* If you have installed RubyGems, just type <tt>gem install tenjin</tt>.

$ sudo gem install tenjin

* Else download rbtenjin-0.6.2.tar.bz2 and just copy 'lib/tenjin.rb' and
'bin/rbtenjin' into proper directory.

$ tar xjf rbtenjin-0.6.2.tar.bz2
$ cd rbtenjin-0.6.2/
$ sudo copy lib/tenjin.rb /usr/local/lib/ruby/1.8/site_ruby/1.8/
$ sudo copy bin/rbtenjin /usr/local/bin/

rbTenjin is tested with Ruby 1.8.6 and Rubinius.


== Attention

rbTenjin is beta released. It means that API or specification may change
in the future.


== License

MIT License
Loading

0 comments on commit e882636

Please sign in to comment.