tenjin 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. data/CHANGES.txt +46 -0
  2. data/MIT-LICENSE +1 -1
  3. data/README.txt +7 -7
  4. data/bin/rbtenjin +2 -2
  5. data/doc-api/classes/Tenjin.html +2 -2
  6. data/doc-api/classes/Tenjin/ArrayBufferTemplate.html +28 -28
  7. data/doc-api/classes/Tenjin/BaseContext.html +61 -44
  8. data/doc-api/classes/Tenjin/ContextHelper.html +85 -57
  9. data/doc-api/classes/Tenjin/Engine.html +88 -88
  10. data/doc-api/classes/Tenjin/ErubisTemplate.html +7 -7
  11. data/doc-api/classes/Tenjin/Preprocessor.html +28 -28
  12. data/doc-api/classes/Tenjin/Template.html +142 -142
  13. data/doc-api/created.rid +1 -1
  14. data/doc-api/files/README_txt.html +10 -10
  15. data/doc-api/files/lib/tenjin_rb.html +2 -2
  16. data/doc-api/fr_method_index.html +55 -53
  17. data/doc/examples.html +2 -2
  18. data/doc/faq.html +2 -2
  19. data/doc/users-guide.html +47 -4
  20. data/examples/form/Makefile +5 -0
  21. data/examples/form/Rakefile +7 -0
  22. data/examples/form/create.rbhtml +4 -0
  23. data/examples/form/form.rbhtml +14 -0
  24. data/examples/form/layout.rbhtml +8 -0
  25. data/examples/form/main.rb +9 -0
  26. data/examples/form/update.rbhtml +4 -0
  27. data/examples/preprocessing/Makefile +8 -0
  28. data/examples/preprocessing/Rakefile +11 -0
  29. data/examples/preprocessing/helper.rb +16 -0
  30. data/examples/preprocessing/main.rb +11 -0
  31. data/examples/preprocessing/select.rbhtml +15 -0
  32. data/examples/table/Makefile +5 -0
  33. data/examples/table/Rakefile +7 -0
  34. data/examples/table/table.rb +9 -0
  35. data/examples/table/table.rbhtml +16 -0
  36. data/lib/tenjin.rb +28 -18
  37. data/setup.rb +861 -607
  38. data/tenjin.gemspec +16 -12
  39. data/test/assert-text-equal.rb +2 -2
  40. data/test/data/users_guide/example16d.rb +27 -0
  41. data/test/data/users_guide/example16d.result +4 -0
  42. data/test/test_all.rb +2 -2
  43. data/test/test_engine.rb +2 -2
  44. data/test/test_examples.rb +2 -2
  45. data/test/test_faq.rb +2 -2
  46. data/test/test_htmlhelper.rb +2 -2
  47. data/test/test_main.rb +2 -2
  48. data/test/test_template.rb +2 -2
  49. data/test/test_users_guide.rb +2 -2
  50. data/test/testcase-helper.rb +2 -2
  51. metadata +64 -35
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/ruby
2
2
 
3
3
  ###
4
- ### $Rev: 61 $
5
- ### $Release: 0.6.0 $
6
- ### copyright(c) 2007 kuwata-lab all rights reserved.
4
+ ### $Rev: 68 $
5
+ ### $Release: 0.6.1 $
6
+ ### copyright(c) 2007-2008 kuwata-lab.com all rights reserved.
7
7
  ###
8
8
 
9
9
  require 'rubygems'
@@ -11,18 +11,22 @@ require 'rubygems'
11
11
  spec = Gem::Specification.new do |s|
12
12
  ## package information
13
13
  s.name = "tenjin"
14
- s.author = "kwatch"
15
- s.version = ("$Release: 0.6.0 $" =~ /[\.\d]+/) && $&
14
+ s.author = "makoto kuwata"
15
+ s.email = "kwa(at)kuwata-lab.com"
16
+ s.rubyforge_project = 'tenjin'
17
+ s.version = "0.6.1"
16
18
  s.platform = Gem::Platform::RUBY
17
- s.homepage = "http://www.kuwata-lab.com/tenjin"
18
- s.summary = "eRuby-like template engine"
19
+ s.homepage = "http://www.kuwata-lab.com/tenjin/"
20
+ s.summary = "very fast and full-featured template engine"
19
21
  s.description = <<-'END'
20
- Tenjin is a template engine which is similar to eRuby.
21
- Tenjin has the following features.
22
+ Tenjin is a template engine and has the following features.
22
23
  * Very fast and lightweight
24
+ * Small and only a file
23
25
  * Auto escaping support
24
26
  * Auto trimming spaces around embedded statements
25
- * Context object available and easy to combine eRuby template with YAML datafile
27
+ * Context object available
28
+ * Able to load YAML data file
29
+ * Preprocessing support
26
30
  END
27
31
 
28
32
  ## files
@@ -32,8 +36,8 @@ spec = Gem::Specification.new do |s|
32
36
  #files += Dir.glob('examples/**/*')
33
37
  files += Dir.glob('test/**/*')
34
38
  files += Dir.glob('doc/**/*')
35
- #files += %w[README.txt MIT-LICENSE setup.rb tenjin.gemspec CHANGES]
36
- files += %w[README.txt MIT-LICENSE setup.rb tenjin.gemspec]
39
+ files += Dir.glob('examples/**/*')
40
+ files += %w[README.txt CHANGES.txt MIT-LICENSE setup.rb tenjin.gemspec]
37
41
  #files += Dir.glob('contrib/*')
38
42
  files += Dir.glob('benchmark/**/*')
39
43
  files += Dir.glob('doc-api/**/*')
@@ -1,7 +1,7 @@
1
1
  ###
2
2
  ### $Rev: 30 $
3
- ### 0.6.0
4
- ### copyright(c) 2007 kuwata-lab all rights reserved.
3
+ ### 0.6.1
4
+ ### copyright(c) 2007-2008 kuwata-lab.com all rights reserved.
5
5
  ###
6
6
 
7
7
  require 'test/unit'
@@ -0,0 +1,27 @@
1
+ require 'tenjin'
2
+
3
+ class MyClass
4
+ include Tenjin::ContextHelper
5
+ #include Tenjin::HtmlHelper # optional
6
+
7
+ def link_to(label, url) # define helper functions in current class
8
+ return "<a href=\"#{escape(url)}\">#{escape(label)}</a>"
9
+ end
10
+
11
+ def render_template(template_name)
12
+ engine = Tenjin::Engine.new()
13
+ output = engine.render(template_name, self) # pass self as context object
14
+ return output
15
+ end
16
+
17
+ def main
18
+ ## set context data as instance variables
19
+ @label = 'Top'
20
+ @url = '/'
21
+ output = render_template('example16.rbhtml')
22
+ print output
23
+ end
24
+
25
+ end
26
+
27
+ MyClass.new.main()
@@ -0,0 +1,4 @@
1
+ $ ruby example16d.rb
2
+ <ul>
3
+ <li><a href="/">Top</a></li>
4
+ </ul>
@@ -1,7 +1,7 @@
1
1
  ###
2
2
  ### $Rev: 45 $
3
- ### $Release: 0.6.0 $
4
- ### copyright(c) 2007 kuwata-lab all rights reserved.
3
+ ### $Release: 0.6.1 $
4
+ ### copyright(c) 2007-2008 kuwata-lab.com all rights reserved.
5
5
  ###
6
6
 
7
7
  basedir = File.dirname(File.dirname(File.expand_path(__FILE__)))
@@ -1,7 +1,7 @@
1
1
  ###
2
2
  ### $Rev: 59 $
3
- ### $Release: 0.6.0 $
4
- ### copyright(c) 2007 kuwata-lab all rights reserved.
3
+ ### $Release: 0.6.1 $
4
+ ### copyright(c) 2007-2008 kuwata-lab.com all rights reserved.
5
5
  ###
6
6
 
7
7
  require 'test/unit'
@@ -1,7 +1,7 @@
1
1
  ###
2
2
  ### $Rev: 54 $
3
- ### $Release: 0.6.0 $
4
- ### copyright(c) 2007 kuwata-lab all rights reserved.
3
+ ### $Release: 0.6.1 $
4
+ ### copyright(c) 2007-2008 kuwata-lab.com all rights reserved.
5
5
  ###
6
6
 
7
7
  require 'test/unit'
@@ -1,7 +1,7 @@
1
1
  ###
2
2
  ### $Rev: 45 $
3
- ### $Release: 0.6.0 $
4
- ### copyright(c) 2007 kuwata-lab all rights reserved.
3
+ ### $Release: 0.6.1 $
4
+ ### copyright(c) 2007-2008 kuwata-lab.com all rights reserved.
5
5
  ###
6
6
 
7
7
  require 'test/unit'
@@ -1,7 +1,7 @@
1
1
  ###
2
2
  ### $Rev: 52 $
3
- ### $Release: 0.6.0 $
4
- ### copyright(c) 2007 kuwata-lab all rights reserved.
3
+ ### $Release: 0.6.1 $
4
+ ### copyright(c) 2007-2008 kuwata-lab.com all rights reserved.
5
5
  ###
6
6
 
7
7
  require 'test/unit'
@@ -1,7 +1,7 @@
1
1
  ###
2
2
  ### $Rev: 59 $
3
- ### $Release: 0.6.0 $
4
- ### copyright(c) 2007 kuwata-lab all rights reserved.
3
+ ### $Release: 0.6.1 $
4
+ ### copyright(c) 2007-2008 kuwata-lab.com all rights reserved.
5
5
  ###
6
6
 
7
7
  require 'test/unit'
@@ -1,7 +1,7 @@
1
1
  ###
2
2
  ### $Rev: 59 $
3
- ### $Release: 0.6.0 $
4
- ### copyright(c) 2007 kuwata-lab all rights reserved.
3
+ ### $Release: 0.6.1 $
4
+ ### copyright(c) 2007-2008 kuwata-lab.com all rights reserved.
5
5
  ###
6
6
 
7
7
  require 'test/unit'
@@ -1,7 +1,7 @@
1
1
  ###
2
2
  ### $Rev: 48 $
3
- ### $Release: 0.6.0 $
4
- ### copyright(c) 2007 kuwata-lab all rights reserved.
3
+ ### $Release: 0.6.1 $
4
+ ### copyright(c) 2007-2008 kuwata-lab.com all rights reserved.
5
5
  ###
6
6
 
7
7
  require 'test/unit'
@@ -1,7 +1,7 @@
1
1
  ###
2
2
  ### $Rev: 42 $
3
- ### $Release: 0.6.0 $
4
- ### copyright(c) 2007 kuwata-lab all rights reserved.
3
+ ### $Release: 0.6.1 $
4
+ ### copyright(c) 2007-2008 kuwata-lab.com all rights reserved.
5
5
  ###
6
6
 
7
7
  require 'yaml'
metadata CHANGED
@@ -1,33 +1,26 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.2
3
- specification_version: 1
4
2
  name: tenjin
5
3
  version: !ruby/object:Gem::Version
6
- version: 0.6.0
7
- date: 2007-08-04 00:00:00 +09:00
8
- summary: eRuby-like template engine
9
- require_paths:
10
- - lib
11
- email:
12
- homepage: http://www.kuwata-lab.com/tenjin
13
- rubyforge_project:
14
- description: Tenjin is a template engine which is similar to eRuby. Tenjin has the following features. * Very fast and lightweight * Auto escaping support * Auto trimming spaces around embedded statements * Context object available and easy to combine eRuby template with YAML datafile
15
- autorequire:
16
- default_executable:
17
- bindir: bin
18
- has_rdoc: false
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">"
22
- - !ruby/object:Gem::Version
23
- version: 0.0.0
24
- version:
4
+ version: 0.6.1
25
5
  platform: ruby
26
- signing_key:
27
- cert_chain:
28
- post_install_message:
29
6
  authors:
30
- - kwatch
7
+ - makoto kuwata
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-02-07 00:00:00 +09:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: Tenjin is a template engine and has the following features. * Very fast and lightweight * Small and only a file * Auto escaping support * Auto trimming spaces around embedded statements * Context object available * Able to load YAML data file * Preprocessing support
17
+ email: kwa(at)kuwata-lab.com
18
+ executables:
19
+ - rbtenjin
20
+ extensions: []
21
+
22
+ extra_rdoc_files: []
23
+
31
24
  files:
32
25
  - lib/tenjin.rb
33
26
  - bin/rbtenjin
@@ -126,6 +119,8 @@ files:
126
119
  - test/data/users_guide/example16b.result
127
120
  - test/data/users_guide/example16c.rb
128
121
  - test/data/users_guide/example16c.result
122
+ - test/data/users_guide/example16d.rb
123
+ - test/data/users_guide/example16d.result
129
124
  - test/data/users_guide/example1_S.result
130
125
  - test/data/users_guide/example1_source.result
131
126
  - test/data/users_guide/example1_SXNC.result
@@ -176,7 +171,27 @@ files:
176
171
  - doc/examples.html
177
172
  - doc/faq.html
178
173
  - doc/users-guide.html
174
+ - examples/form
175
+ - examples/form/create.rbhtml
176
+ - examples/form/form.rbhtml
177
+ - examples/form/layout.rbhtml
178
+ - examples/form/main.rb
179
+ - examples/form/Makefile
180
+ - examples/form/Rakefile
181
+ - examples/form/update.rbhtml
182
+ - examples/preprocessing
183
+ - examples/preprocessing/helper.rb
184
+ - examples/preprocessing/main.rb
185
+ - examples/preprocessing/Makefile
186
+ - examples/preprocessing/Rakefile
187
+ - examples/preprocessing/select.rbhtml
188
+ - examples/table
189
+ - examples/table/Makefile
190
+ - examples/table/Rakefile
191
+ - examples/table/table.rb
192
+ - examples/table/table.rbhtml
179
193
  - README.txt
194
+ - CHANGES.txt
180
195
  - MIT-LICENSE
181
196
  - setup.rb
182
197
  - tenjin.gemspec
@@ -210,17 +225,31 @@ files:
210
225
  - doc-api/fr_method_index.html
211
226
  - doc-api/index.html
212
227
  - doc-api/rdoc-style.css
213
- test_files:
214
- - test/test_all.rb
228
+ has_rdoc: false
229
+ homepage: http://www.kuwata-lab.com/tenjin/
230
+ post_install_message:
215
231
  rdoc_options: []
216
232
 
217
- extra_rdoc_files: []
218
-
219
- executables:
220
- - rbtenjin
221
- extensions: []
222
-
233
+ require_paths:
234
+ - lib
235
+ required_ruby_version: !ruby/object:Gem::Requirement
236
+ requirements:
237
+ - - ">="
238
+ - !ruby/object:Gem::Version
239
+ version: "0"
240
+ version:
241
+ required_rubygems_version: !ruby/object:Gem::Requirement
242
+ requirements:
243
+ - - ">="
244
+ - !ruby/object:Gem::Version
245
+ version: "0"
246
+ version:
223
247
  requirements: []
224
248
 
225
- dependencies: []
226
-
249
+ rubyforge_project: tenjin
250
+ rubygems_version: 1.0.1
251
+ signing_key:
252
+ specification_version: 2
253
+ summary: very fast and full-featured template engine
254
+ test_files:
255
+ - test/test_all.rb