Permalink
Browse files

Import version 0.6.2 of rbTenjin

  • Loading branch information...
Luis Hurtado
Luis Hurtado committed Jun 1, 2009
0 parents commit e882636eb39825b01ea337f46193465528a29c15
Showing with 18,447 additions and 0 deletions.
  1. +76 −0 CHANGES.txt
  2. +20 −0 MIT-LICENSE
  3. +56 −0 README.txt
  4. +502 −0 benchmark/bench.rb
  5. +17 −0 benchmark/bench_context.rb
  6. +141 −0 benchmark/bench_context.yaml
  7. +4 −0 benchmark/templates/_footer.html
  8. +52 −0 benchmark/templates/_header.html
  9. +29 −0 benchmark/templates/bench_eruby.rhtml
  10. +29 −0 benchmark/templates/bench_tenjin.rbhtml
  11. +454 −0 bin/rbtenjin
  12. +141 −0 doc-api/classes/Tenjin.html
  13. +270 −0 doc-api/classes/Tenjin/ArrayBufferTemplate.html
  14. +329 −0 doc-api/classes/Tenjin/BaseContext.html
  15. +126 −0 doc-api/classes/Tenjin/Context.html
  16. +461 −0 doc-api/classes/Tenjin/ContextHelper.html
  17. +616 −0 doc-api/classes/Tenjin/Engine.html
  18. +166 −0 doc-api/classes/Tenjin/ErubisTemplate.html
  19. +359 −0 doc-api/classes/Tenjin/HtmlHelper.html
  20. +242 −0 doc-api/classes/Tenjin/Preprocessor.html
  21. +916 −0 doc-api/classes/Tenjin/Template.html
  22. +1 −0 doc-api/created.rid
  23. +188 −0 doc-api/files/README_txt.html
  24. +136 −0 doc-api/files/lib/tenjin_rb.html
  25. +36 −0 doc-api/fr_class_index.html
  26. +28 −0 doc-api/fr_file_index.html
  27. +91 −0 doc-api/fr_method_index.html
  28. +24 −0 doc-api/index.html
  29. +208 −0 doc-api/rdoc-style.css
  30. +188 −0 doc/docstyle.css
  31. +312 −0 doc/examples.html
  32. +909 −0 doc/faq.html
  33. +1,734 −0 doc/users-guide.html
  34. +8 −0 examples/form/Makefile
  35. +11 −0 examples/form/Rakefile
  36. +4 −0 examples/form/create.rbhtml
  37. +14 −0 examples/form/form.rbhtml
  38. +8 −0 examples/form/layout.rbhtml
  39. +9 −0 examples/form/main.rb
  40. +4 −0 examples/form/update.rbhtml
  41. +11 −0 examples/preprocessing/Makefile
  42. +15 −0 examples/preprocessing/Rakefile
  43. +16 −0 examples/preprocessing/helper.rb
  44. +11 −0 examples/preprocessing/main.rb
  45. +15 −0 examples/preprocessing/select.rbhtml
  46. +17 −0 examples/preprocessing/select.rbhtml.cache
  47. +8 −0 examples/table/Makefile
  48. +11 −0 examples/table/Rakefile
  49. +9 −0 examples/table/table.rb
  50. +16 −0 examples/table/table.rbhtml
  51. +969 −0 lib/tenjin.rb
  52. +1,585 −0 setup.rb
  53. +62 −0 tenjin.gemspec
  54. +14 −0 test/Rookbook.yaml
  55. +45 −0 test/assert-text-equal.rb
  56. +4 −0 test/data/examples/form/create.rbhtml
  57. +14 −0 test/data/examples/form/form.rbhtml
  58. +8 −0 test/data/examples/form/layout.rbhtml
  59. +9 −0 test/data/examples/form/main.rb
  60. +21 −0 test/data/examples/form/main.result
  61. +4 −0 test/data/examples/form/update.rbhtml
  62. +16 −0 test/data/examples/preprocessing/helper.rb
  63. +11 −0 test/data/examples/preprocessing/main.rb
  64. +17 −0 test/data/examples/preprocessing/main.result
  65. +15 −0 test/data/examples/preprocessing/select.rbhtml
  66. +18 −0 test/data/examples/preprocessing/select_P.result
  67. +9 −0 test/data/examples/table/table.rb
  68. +16 −0 test/data/examples/table/table.rbhtml
  69. +20 −0 test/data/examples/table/table.result
  70. +18 −0 test/data/examples/table/table_s.result
  71. +5 −0 test/data/faq/ex1.rbhtml
  72. +27 −0 test/data/faq/ex10-baselayout.rbhtml
  73. +12 −0 test/data/faq/ex10-content.rbhtml
  74. +11 −0 test/data/faq/ex10-customlayout.rbhtml
  75. +25 −0 test/data/faq/ex10_inherit.result
  76. +28 −0 test/data/faq/ex11-bench.rb
  77. +9 −0 test/data/faq/ex11-content.rbhtml
  78. +5 −0 test/data/faq/ex11-layout1.rbhtml
  79. +6 −0 test/data/faq/ex11-layout2.rbhtml
  80. +5 −0 test/data/faq/ex11.rb
  81. +8 −0 test/data/faq/ex11.rbhtml
  82. +11 −0 test/data/faq/ex11.source
  83. +15 −0 test/data/faq/ex11_arraybuffer.result
  84. +3 −0 test/data/faq/ex1_chksyntax.result
  85. +3 −0 test/data/faq/ex2-content.rbhtml
  86. +11 −0 test/data/faq/ex2-layout.rbhtml
  87. +19 −0 test/data/faq/ex2_removenl.result
  88. +4 −0 test/data/faq/ex3.rb
  89. +1 −0 test/data/faq/ex3.rbhtml
  90. +2 −0 test/data/faq/ex3_escapefunc1.result
  91. +2 −0 test/data/faq/ex3_escapefunc2.result
  92. +7 −0 test/data/faq/ex5.rbhtml
  93. +9 −0 test/data/faq/ex5_template_args.source
  94. +6 −0 test/data/faq/ex6-content.rhtml
  95. +6 −0 test/data/faq/ex6-layout.rhtml
  96. +10 −0 test/data/faq/ex6.rb
  97. +12 −0 test/data/faq/ex6_eruby.result
  98. +34 −0 test/data/faq/ex7-expr-pattern.rb
  99. +3 −0 test/data/faq/ex7-expr-pattern.rbhtml
  100. +4 −0 test/data/faq/ex7_expr_pattern.result
  101. +77 −0 test/data/faq/ex8-m18n.rb
  102. +4 −0 test/data/faq/ex8-m18n.rbhtml
  103. +10 −0 test/data/faq/ex8_m18n.result
  104. +8 −0 test/data/faq/ex9-baselayout.rbhtml
  105. +6 −0 test/data/faq/ex9-content.rbhtml
  106. +5 −0 test/data/faq/ex9-mylayout.rbhtml
  107. +11 −0 test/data/faq/ex9_changelayout.result
  108. +3 −0 test/data/users_guide/content6.rbhtml
  109. +5 −0 test/data/users_guide/content7.rbhtml
  110. +2 −0 test/data/users_guide/content8.rbhtml
  111. +7 −0 test/data/users_guide/contextdata.rb
  112. +5 −0 test/data/users_guide/datafile.rb
  113. +10 −0 test/data/users_guide/datafile.yaml
  114. +6 −0 test/data/users_guide/ex.rbhtml
  115. +7 −0 test/data/users_guide/ex.result
  116. +5 −0 test/data/users_guide/ex.script
  117. +7 −0 test/data/users_guide/ex_script.result
  118. +8 −0 test/data/users_guide/ex_source.result
  119. +12 −0 test/data/users_guide/example1.rbhtml
  120. +17 −0 test/data/users_guide/example1.result
  121. +4 −0 test/data/users_guide/example10.rbhtml
  122. +6 −0 test/data/users_guide/example10_template_args.result
  123. +5 −0 test/data/users_guide/example11.rbhtml
  124. +2 −0 test/data/users_guide/example11_template_args_result
  125. +12 −0 test/data/users_guide/example12.rbhtml
  126. +10 −0 test/data/users_guide/example12_preprocessed.result
  127. +10 −0 test/data/users_guide/example12_preprocessed_source.result
  128. +6 −0 test/data/users_guide/example13.rbhtml
  129. +2 −0 test/data/users_guide/example13_preprocessed.result
  130. +2 −0 test/data/users_guide/example13_preprocessed_source.result
  131. +32 −0 test/data/users_guide/example14.rb
  132. +6 −0 test/data/users_guide/example14.rbhtml
  133. +15 −0 test/data/users_guide/example14_tmplclass.result
  134. +10 −0 test/data/users_guide/example15.rb
  135. +14 −0 test/data/users_guide/example15_escapefunc.result
  136. +4 −0 test/data/users_guide/example16.rbhtml
  137. +10 −0 test/data/users_guide/example16a.rb
  138. +4 −0 test/data/users_guide/example16a.result
  139. +13 −0 test/data/users_guide/example16b.rb
  140. +4 −0 test/data/users_guide/example16b.result
  141. +12 −0 test/data/users_guide/example16c.rb
  142. +4 −0 test/data/users_guide/example16c.result
  143. +27 −0 test/data/users_guide/example16d.rb
  144. +4 −0 test/data/users_guide/example16d.result
  145. +14 −0 test/data/users_guide/example1_S.result
  146. +10 −0 test/data/users_guide/example1_SXNC.result
  147. +14 −0 test/data/users_guide/example1_source.result
  148. +3 −0 test/data/users_guide/example2.rbhtml
  149. +9 −0 test/data/users_guide/example2_sb.result2
  150. +5 −0 test/data/users_guide/example3.rbhtml
  151. +2 −0 test/data/users_guide/example3_syntaxcheck.result
  152. +13 −0 test/data/users_guide/example4.rbhtml
  153. +13 −0 test/data/users_guide/example4_datafile_rb.result
  154. +13 −0 test/data/users_guide/example4_yaml.result
  155. +9 −0 test/data/users_guide/example5.rbhtml
  156. +9 −0 test/data/users_guide/example5_datastr_rb.result
  157. +9 −0 test/data/users_guide/example5_datastr_yaml.result
  158. +19 −0 test/data/users_guide/example6.rbhtml
  159. +29 −0 test/data/users_guide/example6_layout.result
  160. +28 −0 test/data/users_guide/example6_nested.result
  161. +13 −0 test/data/users_guide/example7_layout2.result
  162. +8 −0 test/data/users_guide/example8_layout3.result
  163. +18 −0 test/data/users_guide/example9.rbhtml
  164. +26 −0 test/data/users_guide/example9_capture.result
  165. +5 −0 test/data/users_guide/footer.html
  166. +4 −0 test/data/users_guide/footer.rbhtml
  167. +17 −0 test/data/users_guide/layout6.rbhtml
  168. +9 −0 test/data/users_guide/layout7.rbhtml
  169. +5 −0 test/data/users_guide/layout8_html.rbhtml
  170. +6 −0 test/data/users_guide/layout8_xhtml.rbhtml
  171. +25 −0 test/data/users_guide/layout9.rbhtml
  172. +5 −0 test/data/users_guide/sidemenu.rbhtml
  173. +39 −0 test/data/users_guide/user_app.cgi
  174. +30 −0 test/data/users_guide/user_app.result
  175. +6 −0 test/data/users_guide/user_create.rbhtml
  176. +7 −0 test/data/users_guide/user_edit.rbhtml
  177. +10 −0 test/data/users_guide/user_form.rbhtml
  178. +16 −0 test/data/users_guide/user_layout.rbhtml
  179. +23 −0 test/test_all.rb
  180. +495 −0 test/test_engine.rb
  181. +2,039 −0 test/test_engine.yaml
  182. +81 −0 test/test_examples.rb
  183. +60 −0 test/test_faq.rb
  184. +78 −0 test/test_htmlhelper.rb
  185. +748 −0 test/test_main.rb
  186. +174 −0 test/test_main.yaml
  187. +128 −0 test/test_template.rb
  188. +1,245 −0 test/test_template.yaml
  189. +75 −0 test/test_users_guide.rb
  190. +194 −0 test/testcase-helper.rb
@@ -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
@@ -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.
@@ -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
Oops, something went wrong.

0 comments on commit e882636

Please sign in to comment.