tenjin 0.6.2 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES.txt +163 -0
- data/MIT-LICENSE +16 -17
- data/README.txt +5 -5
- data/benchmark/Makefile +9 -0
- data/benchmark/bench.rb +3 -2
- data/bin/rbtenjin +6 -3
- data/doc/docstyle.css +25 -4
- data/doc/users-guide.html +2088 -1563
- data/lib/tenjin.rb +784 -158
- data/public_html/_layout.rbhtml +33 -0
- data/public_html/css/style.css +77 -0
- data/public_html/env.rbhtml +15 -0
- data/public_html/favicon.ico +0 -0
- data/public_html/hello.rbhtml +14 -0
- data/public_html/index.rbhtml +39 -0
- data/public_html/rbtenjin.cgi +188 -0
- data/tenjin.gemspec +9 -6
- data/test/data/examples/preprocessing/main.rb +1 -1
- data/test/data/examples/preprocessing/select.rbhtml +1 -1
- data/test/data/faq/{ex11-bench.rb → ex10-bench.rb} +3 -3
- data/test/data/faq/ex10-content.rbhtml +8 -11
- data/test/data/faq/{ex11-layout1.rbhtml → ex10-layout1.rbhtml} +0 -0
- data/test/data/faq/{ex11-layout2.rbhtml → ex10-layout2.rbhtml} +0 -0
- data/test/data/faq/{ex11.rb → ex10.rb} +1 -1
- data/test/data/faq/{ex11.rbhtml → ex10.rbhtml} +0 -0
- data/test/data/faq/{ex11.source → ex10.source} +2 -2
- data/test/data/faq/{ex11_arraybuffer.result → ex10_arraybuffer.result} +1 -1
- data/test/data/faq/{ex5.rbhtml → ex2.rbhtml} +0 -0
- data/test/data/faq/{ex5_template_args.source → ex2_template_args.source} +1 -1
- data/test/data/faq/{ex7-expr-pattern.rb → ex4-expr-pattern.rb} +1 -1
- data/test/data/faq/{ex7-expr-pattern.rbhtml → ex4-expr-pattern.rbhtml} +0 -0
- data/test/data/faq/{ex7_expr_pattern.result → ex4_expr_pattern.result} +1 -1
- data/test/data/faq/{ex6-content.rhtml → ex5-content.rhtml} +0 -0
- data/test/data/faq/{ex6-layout.rhtml → ex5-layout.rhtml} +0 -0
- data/test/data/faq/{ex6.rb → ex5.rb} +2 -2
- data/test/data/faq/{ex6_eruby.result → ex5_eruby.result} +1 -1
- data/test/data/faq/{ex2-content.rbhtml → ex6-content.rbhtml} +0 -0
- data/test/data/faq/{ex2-layout.rbhtml → ex6-layout.rbhtml} +0 -0
- data/test/data/faq/{ex2_removenl.result → ex6_removenl.result} +1 -1
- data/test/data/faq/ex7-m18n.rb +48 -0
- data/test/data/faq/{ex8-m18n.rbhtml → ex7-m18n.rbhtml} +0 -0
- data/test/data/faq/{ex8_m18n.result → ex7_m18n.result} +1 -1
- data/test/data/faq/ex8-baselayout.rbhtml +8 -0
- data/test/data/faq/ex8-content.rbhtml +6 -0
- data/test/data/faq/{ex9-mylayout.rbhtml → ex8-mylayout.rbhtml} +0 -0
- data/test/data/faq/{ex9_changelayout.result → ex8_changelayout.result} +1 -1
- data/test/data/faq/ex9-baselayout.rbhtml +24 -5
- data/test/data/faq/ex9-content.rbhtml +12 -6
- data/test/data/faq/{ex10-customlayout.rbhtml → ex9-customlayout.rbhtml} +1 -1
- data/test/data/faq/{ex10_inherit.result → ex9_inherit.result} +1 -1
- data/test/data/faq/helpers1.rb +17 -0
- data/test/data/faq/helpers1.rbhtml +4 -0
- data/test/data/faq/helpers1.result +11 -0
- data/test/data/faq/helpers2.rb +21 -0
- data/test/data/faq/helpers2.rbhtml +4 -0
- data/test/data/faq/helpers2.result +11 -0
- data/test/data/faq/weekday1.rb +6 -0
- data/test/data/faq/weekday1.rbhtml +9 -0
- data/test/data/faq/weekday1.result +23 -0
- data/test/data/faq/weekday2.rb +8 -0
- data/test/data/faq/weekday2.rbhtml +10 -0
- data/test/data/faq/weekday2.result +24 -0
- data/test/data/faq/weekday3.rb +22 -0
- data/test/data/faq/weekday3.rbhtml +3 -0
- data/test/data/faq/weekday3.result +28 -0
- data/test/data/users_guide/test_010/main.rb +14 -0
- data/test/data/users_guide/test_010/result.output +13 -0
- data/test/data/users_guide/test_010/views/page.rbhtml +11 -0
- data/test/data/users_guide/test_011/main.rb +14 -0
- data/test/data/users_guide/test_011/result.output +2 -0
- data/test/data/users_guide/test_011/views/page.rbhtml +11 -0
- data/test/data/users_guide/test_020/main.rb +14 -0
- data/test/data/users_guide/test_020/result.output +13 -0
- data/test/data/users_guide/test_020/views/page.rbhtml +11 -0
- data/test/data/users_guide/test_021/main.rb +12 -0
- data/test/data/users_guide/test_021/result.output +12 -0
- data/test/data/users_guide/test_021/views/page.rbhtml +11 -0
- data/test/data/users_guide/test_030/main.rb +14 -0
- data/test/data/users_guide/test_030/result.output +23 -0
- data/test/data/users_guide/test_030/views/_layout.rbhtml +10 -0
- data/test/data/users_guide/test_030/views/page.rbhtml +11 -0
- data/test/data/users_guide/test_040/main.rb +14 -0
- data/test/data/users_guide/test_040/result.output +23 -0
- data/test/data/users_guide/test_040/views/_layout.rbhtml +10 -0
- data/test/data/users_guide/test_040/views/page.rbhtml +12 -0
- data/test/data/users_guide/test_050/main.rb +14 -0
- data/test/data/users_guide/test_050/result.output +14 -0
- data/test/data/users_guide/test_050/views/_layout.rbhtml +10 -0
- data/test/data/users_guide/test_050/views/page.rbhtml +13 -0
- data/test/data/users_guide/test_051/main.rb +14 -0
- data/test/data/users_guide/test_051/result.output +12 -0
- data/test/data/users_guide/test_051/views/_layout.rbhtml +11 -0
- data/test/data/users_guide/test_051/views/page.rbhtml +13 -0
- data/test/data/users_guide/test_060/main.rb +14 -0
- data/test/data/users_guide/test_060/result.output +29 -0
- data/test/data/users_guide/test_060/views/_footer.rbhtml +3 -0
- data/test/data/users_guide/test_060/views/_header.rbhtml +3 -0
- data/test/data/users_guide/test_060/views/_layout.rbhtml +13 -0
- data/test/data/users_guide/test_060/views/page.rbhtml +13 -0
- data/test/data/users_guide/test_070/main.rb +14 -0
- data/test/data/users_guide/test_070/result.output +29 -0
- data/test/data/users_guide/test_070/views/_footer.rbhtml +3 -0
- data/test/data/users_guide/test_070/views/_header.rbhtml +3 -0
- data/test/data/users_guide/test_070/views/_layout.rbhtml +13 -0
- data/test/data/users_guide/test_070/views/page.rbhtml +13 -0
- data/test/data/users_guide/test_capturing/main.rb +24 -0
- data/test/data/users_guide/test_capturing/result.output +28 -0
- data/test/data/users_guide/test_capturing/views/_layout.rbhtml +21 -0
- data/test/data/users_guide/test_capturing/views/blog-post.rbhtml +13 -0
- data/test/data/users_guide/test_context/context.rb +5 -0
- data/test/data/users_guide/test_context/context.yaml +4 -0
- data/test/data/users_guide/test_context/example.rbhtml +5 -0
- data/test/data/users_guide/test_context/result1.output +6 -0
- data/test/data/users_guide/test_context/result2.output +6 -0
- data/test/data/users_guide/test_context/result3.output +6 -0
- data/test/data/users_guide/test_context/result4.output +6 -0
- data/test/data/users_guide/test_convert/example.rbhtml +5 -0
- data/test/data/users_guide/test_convert/result1.output +7 -0
- data/test/data/users_guide/test_convert/result2.output +6 -0
- data/test/data/users_guide/test_escape/main.rb +4 -0
- data/test/data/users_guide/test_escape/result.output +5 -0
- data/test/data/users_guide/test_escape/views/page.rbhtml +4 -0
- data/test/data/users_guide/test_execute/example.rbhtml +6 -0
- data/test/data/users_guide/test_execute/result.output +6 -0
- data/test/data/users_guide/test_fragmentcache/cache.d/items/1 +5 -0
- data/test/data/users_guide/test_fragmentcache/main.rb +21 -0
- data/test/data/users_guide/test_fragmentcache/result.output +8 -0
- data/test/data/users_guide/test_fragmentcache/result2.output +6 -0
- data/test/data/users_guide/test_fragmentcache/views/items.rbhtml +10 -0
- data/test/data/users_guide/test_logging/ex-logger.rb +11 -0
- data/test/data/users_guide/test_logging/example.rbhtml +0 -0
- data/test/data/users_guide/test_logging/result1.output +3 -0
- data/test/data/users_guide/test_logging/result2.output +2 -0
- data/test/data/users_guide/test_m17n/m17n.rb +44 -0
- data/test/data/users_guide/test_m17n/m17n.rbhtml +5 -0
- data/test/data/users_guide/test_m17n/result.output +9 -0
- data/test/data/users_guide/test_m17n/result_en.output +4 -0
- data/test/data/users_guide/test_m17n/result_fr.output +4 -0
- data/test/data/users_guide/test_nested/main.rb +8 -0
- data/test/data/users_guide/test_nested/result.output +15 -0
- data/test/data/users_guide/test_nested/views/_blog_layout.rbhtml +5 -0
- data/test/data/users_guide/{layout8_html.rbhtml → test_nested/views/_site_layout.rbhtml} +0 -0
- data/test/data/users_guide/test_nested/views/blog_post.rbhtml +4 -0
- data/test/data/users_guide/test_preprocessing/pp-example1.rb +14 -0
- data/test/data/users_guide/test_preprocessing/result1a.output +11 -0
- data/test/data/users_guide/test_preprocessing/result1b.output +5 -0
- data/test/data/users_guide/test_preprocessing/result1c.output +6 -0
- data/test/data/users_guide/test_preprocessing/result2a.output +10 -0
- data/test/data/users_guide/test_preprocessing/result2b.output +10 -0
- data/test/data/users_guide/test_preprocessing/result3a.output +2 -0
- data/test/data/users_guide/test_preprocessing/result3b.output +2 -0
- data/test/data/users_guide/test_preprocessing/views/pp-example1.rbhtml +4 -0
- data/test/data/users_guide/{example12.rbhtml → test_preprocessing/views/pp-example2.rbhtml} +4 -4
- data/test/data/users_guide/test_preprocessing/views/pp-example3.rbhtml +7 -0
- data/test/data/users_guide/test_retrieve/example.rbhtml +10 -0
- data/test/data/users_guide/test_retrieve/result1.output +11 -0
- data/test/data/users_guide/test_retrieve/result2.output +11 -0
- data/test/data/users_guide/test_retrieve/result3.output +11 -0
- data/test/data/users_guide/test_retrieve/result4.output +8 -0
- data/test/data/users_guide/test_retrieve/result5.output +5 -0
- data/test/data/users_guide/test_safe/result.output +6 -0
- data/test/data/users_guide/test_safe/safe-test.rb +21 -0
- data/test/data/users_guide/test_safehelper/main.rb +16 -0
- data/test/data/users_guide/test_safehelper/result.output +8 -0
- data/test/data/users_guide/{example3.rbhtml → test_syntax_check/example.rbhtml} +0 -0
- data/test/data/users_guide/test_syntax_check/result.output +2 -0
- data/test/data/users_guide/test_trace/layout.rbhtml +7 -0
- data/test/data/users_guide/test_trace/main.rbhtml +5 -0
- data/test/data/users_guide/test_trace/result.output +16 -0
- data/test/data/users_guide/test_trace/trace-example.rb +4 -0
- data/test/oktest.rb +755 -0
- data/test/test_all.rb +24 -14
- data/test/test_engine.rb +628 -63
- data/test/test_engine.yaml +40 -3
- data/test/test_examples.rb +14 -12
- data/test/test_faq.rb +17 -12
- data/test/test_htmlhelper.rb +104 -33
- data/test/test_main.rb +32 -21
- data/test/test_main.yaml +2 -2
- data/test/test_safe.rb +206 -0
- data/test/test_store.rb +220 -0
- data/test/test_tcache.rb +94 -0
- data/test/test_template.rb +65 -23
- data/test/test_template.yaml +7 -7
- data/test/test_users_guide.rb +75 -29
- data/test/testcase-helper.rb +20 -18
- data/test/testunit-assertions.rb +71 -0
- metadata +185 -159
- data/doc-api/classes/Tenjin.html +0 -141
- data/doc-api/classes/Tenjin/ArrayBufferTemplate.html +0 -270
- data/doc-api/classes/Tenjin/BaseContext.html +0 -329
- data/doc-api/classes/Tenjin/Context.html +0 -126
- data/doc-api/classes/Tenjin/ContextHelper.html +0 -461
- data/doc-api/classes/Tenjin/Engine.html +0 -616
- data/doc-api/classes/Tenjin/ErubisTemplate.html +0 -166
- data/doc-api/classes/Tenjin/HtmlHelper.html +0 -359
- data/doc-api/classes/Tenjin/Preprocessor.html +0 -242
- data/doc-api/classes/Tenjin/Template.html +0 -916
- data/doc-api/created.rid +0 -1
- data/doc-api/files/README_txt.html +0 -188
- data/doc-api/files/lib/tenjin_rb.html +0 -136
- data/doc-api/fr_class_index.html +0 -36
- data/doc-api/fr_file_index.html +0 -28
- data/doc-api/fr_method_index.html +0 -91
- data/doc-api/index.html +0 -24
- data/doc-api/rdoc-style.css +0 -208
- data/doc/examples.html +0 -312
- data/doc/faq.html +0 -909
- data/examples/preprocessing/select.rbhtml.cache +0 -17
- data/test/Rookbook.yaml +0 -14
- data/test/assert-text-equal.rb +0 -45
- data/test/data/faq/ex10-baselayout.rbhtml +0 -27
- data/test/data/faq/ex11-content.rbhtml +0 -9
- data/test/data/faq/ex8-m18n.rb +0 -77
- data/test/data/users_guide/content6.rbhtml +0 -3
- data/test/data/users_guide/content7.rbhtml +0 -5
- data/test/data/users_guide/content8.rbhtml +0 -2
- data/test/data/users_guide/contextdata.rb +0 -7
- data/test/data/users_guide/datafile.rb +0 -5
- data/test/data/users_guide/datafile.yaml +0 -10
- data/test/data/users_guide/ex.rbhtml +0 -6
- data/test/data/users_guide/ex.result +0 -7
- data/test/data/users_guide/ex.script +0 -5
- data/test/data/users_guide/ex_script.result +0 -7
- data/test/data/users_guide/ex_source.result +0 -8
- data/test/data/users_guide/example1.rbhtml +0 -12
- data/test/data/users_guide/example1.result +0 -17
- data/test/data/users_guide/example10.rbhtml +0 -4
- data/test/data/users_guide/example10_template_args.result +0 -6
- data/test/data/users_guide/example11.rbhtml +0 -5
- data/test/data/users_guide/example11_template_args_result +0 -2
- data/test/data/users_guide/example12_preprocessed.result +0 -10
- data/test/data/users_guide/example12_preprocessed_source.result +0 -10
- data/test/data/users_guide/example13.rbhtml +0 -6
- data/test/data/users_guide/example13_preprocessed.result +0 -2
- data/test/data/users_guide/example13_preprocessed_source.result +0 -2
- data/test/data/users_guide/example14.rb +0 -32
- data/test/data/users_guide/example14.rbhtml +0 -6
- data/test/data/users_guide/example14_tmplclass.result +0 -15
- data/test/data/users_guide/example15.rb +0 -10
- data/test/data/users_guide/example15_escapefunc.result +0 -14
- data/test/data/users_guide/example16.rbhtml +0 -4
- data/test/data/users_guide/example16a.rb +0 -10
- data/test/data/users_guide/example16a.result +0 -4
- data/test/data/users_guide/example16b.rb +0 -13
- data/test/data/users_guide/example16b.result +0 -4
- data/test/data/users_guide/example16c.rb +0 -12
- data/test/data/users_guide/example16c.result +0 -4
- data/test/data/users_guide/example16d.rb +0 -27
- data/test/data/users_guide/example16d.result +0 -4
- data/test/data/users_guide/example1_S.result +0 -14
- data/test/data/users_guide/example1_SXNC.result +0 -10
- data/test/data/users_guide/example1_source.result +0 -14
- data/test/data/users_guide/example2.rbhtml +0 -3
- data/test/data/users_guide/example2_sb.result2 +0 -9
- data/test/data/users_guide/example3_syntaxcheck.result +0 -2
- data/test/data/users_guide/example4.rbhtml +0 -13
- data/test/data/users_guide/example4_datafile_rb.result +0 -13
- data/test/data/users_guide/example4_yaml.result +0 -13
- data/test/data/users_guide/example5.rbhtml +0 -9
- data/test/data/users_guide/example5_datastr_rb.result +0 -9
- data/test/data/users_guide/example5_datastr_yaml.result +0 -9
- data/test/data/users_guide/example6.rbhtml +0 -19
- data/test/data/users_guide/example6_layout.result +0 -29
- data/test/data/users_guide/example6_nested.result +0 -28
- data/test/data/users_guide/example7_layout2.result +0 -13
- data/test/data/users_guide/example8_layout3.result +0 -8
- data/test/data/users_guide/example9.rbhtml +0 -18
- data/test/data/users_guide/example9_capture.result +0 -26
- data/test/data/users_guide/footer.html +0 -5
- data/test/data/users_guide/footer.rbhtml +0 -4
- data/test/data/users_guide/layout6.rbhtml +0 -17
- data/test/data/users_guide/layout7.rbhtml +0 -9
- data/test/data/users_guide/layout8_xhtml.rbhtml +0 -6
- data/test/data/users_guide/layout9.rbhtml +0 -25
- data/test/data/users_guide/sidemenu.rbhtml +0 -5
- data/test/data/users_guide/user_app.cgi +0 -39
- data/test/data/users_guide/user_app.result +0 -30
- data/test/data/users_guide/user_create.rbhtml +0 -6
- data/test/data/users_guide/user_edit.rbhtml +0 -7
- data/test/data/users_guide/user_form.rbhtml +0 -10
- data/test/data/users_guide/user_layout.rbhtml +0 -16
data/doc-api/index.html
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
|
5
|
-
|
6
|
-
<!--
|
7
|
-
|
8
|
-
RDoc Documentation
|
9
|
-
|
10
|
-
-->
|
11
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
12
|
-
<head>
|
13
|
-
<title>RDoc Documentation</title>
|
14
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
15
|
-
</head>
|
16
|
-
<frameset rows="20%, 80%">
|
17
|
-
<frameset cols="25%,35%,45%">
|
18
|
-
<frame src="fr_file_index.html" title="Files" name="Files" />
|
19
|
-
<frame src="fr_class_index.html" name="Classes" />
|
20
|
-
<frame src="fr_method_index.html" name="Methods" />
|
21
|
-
</frameset>
|
22
|
-
<frame src="files/README_txt.html" name="docwin" />
|
23
|
-
</frameset>
|
24
|
-
</html>
|
data/doc-api/rdoc-style.css
DELETED
@@ -1,208 +0,0 @@
|
|
1
|
-
|
2
|
-
body {
|
3
|
-
font-family: Verdana,Arial,Helvetica,sans-serif;
|
4
|
-
font-size: 90%;
|
5
|
-
margin: 0;
|
6
|
-
margin-left: 40px;
|
7
|
-
padding: 0;
|
8
|
-
background: white;
|
9
|
-
}
|
10
|
-
|
11
|
-
h1,h2,h3,h4 { margin: 0; color: #efefef; background: transparent; }
|
12
|
-
h1 { font-size: 150%; }
|
13
|
-
h2,h3,h4 { margin-top: 1em; }
|
14
|
-
|
15
|
-
a { background: #eef; color: #039; text-decoration: none; }
|
16
|
-
a:hover { background: #039; color: #eef; }
|
17
|
-
|
18
|
-
/* Override the base stylesheet's Anchor inside a table cell */
|
19
|
-
td > a {
|
20
|
-
background: transparent;
|
21
|
-
color: #039;
|
22
|
-
text-decoration: none;
|
23
|
-
}
|
24
|
-
|
25
|
-
/* and inside a section title */
|
26
|
-
.section-title > a {
|
27
|
-
background: transparent;
|
28
|
-
color: #eee;
|
29
|
-
text-decoration: none;
|
30
|
-
}
|
31
|
-
|
32
|
-
/* === Structural elements =================================== */
|
33
|
-
|
34
|
-
div#index {
|
35
|
-
margin: 0;
|
36
|
-
margin-left: -40px;
|
37
|
-
padding: 0;
|
38
|
-
font-size: 90%;
|
39
|
-
}
|
40
|
-
|
41
|
-
|
42
|
-
div#index a {
|
43
|
-
margin-left: 0.7em;
|
44
|
-
}
|
45
|
-
|
46
|
-
div#index .section-bar {
|
47
|
-
margin-left: 0px;
|
48
|
-
padding-left: 0.7em;
|
49
|
-
background: #ccc;
|
50
|
-
font-size: small;
|
51
|
-
}
|
52
|
-
|
53
|
-
|
54
|
-
div#classHeader, div#fileHeader {
|
55
|
-
width: auto;
|
56
|
-
color: white;
|
57
|
-
padding: 0.5em 1.5em 0.5em 1.5em;
|
58
|
-
margin: 0;
|
59
|
-
margin-left: -40px;
|
60
|
-
border-bottom: 3px solid #006;
|
61
|
-
}
|
62
|
-
|
63
|
-
div#classHeader a, div#fileHeader a {
|
64
|
-
background: inherit;
|
65
|
-
color: white;
|
66
|
-
}
|
67
|
-
|
68
|
-
div#classHeader td, div#fileHeader td {
|
69
|
-
background: inherit;
|
70
|
-
color: white;
|
71
|
-
}
|
72
|
-
|
73
|
-
|
74
|
-
div#fileHeader {
|
75
|
-
background: #057;
|
76
|
-
}
|
77
|
-
|
78
|
-
div#classHeader {
|
79
|
-
background: #048;
|
80
|
-
}
|
81
|
-
|
82
|
-
|
83
|
-
.class-name-in-header {
|
84
|
-
font-size: 180%;
|
85
|
-
font-weight: bold;
|
86
|
-
}
|
87
|
-
|
88
|
-
|
89
|
-
div#bodyContent {
|
90
|
-
padding: 0 1.5em 0 1.5em;
|
91
|
-
}
|
92
|
-
|
93
|
-
div#description {
|
94
|
-
padding: 0.5em 1.5em;
|
95
|
-
background: #efefef;
|
96
|
-
border: 1px dotted #999;
|
97
|
-
}
|
98
|
-
|
99
|
-
div#description h1,h2,h3,h4,h5,h6 {
|
100
|
-
color: #125;;
|
101
|
-
background: transparent;
|
102
|
-
}
|
103
|
-
|
104
|
-
div#validator-badges {
|
105
|
-
text-align: center;
|
106
|
-
}
|
107
|
-
div#validator-badges img { border: 0; }
|
108
|
-
|
109
|
-
div#copyright {
|
110
|
-
color: #333;
|
111
|
-
background: #efefef;
|
112
|
-
font: 0.75em sans-serif;
|
113
|
-
margin-top: 5em;
|
114
|
-
margin-bottom: 0;
|
115
|
-
padding: 0.5em 2em;
|
116
|
-
}
|
117
|
-
|
118
|
-
|
119
|
-
/* === Classes =================================== */
|
120
|
-
|
121
|
-
table.header-table {
|
122
|
-
color: white;
|
123
|
-
font-size: small;
|
124
|
-
}
|
125
|
-
|
126
|
-
.type-note {
|
127
|
-
font-size: small;
|
128
|
-
color: #DEDEDE;
|
129
|
-
}
|
130
|
-
|
131
|
-
.xxsection-bar {
|
132
|
-
background: #eee;
|
133
|
-
color: #333;
|
134
|
-
padding: 3px;
|
135
|
-
}
|
136
|
-
|
137
|
-
.section-bar {
|
138
|
-
color: #333;
|
139
|
-
border-bottom: 1px solid #999;
|
140
|
-
margin-left: -20px;
|
141
|
-
}
|
142
|
-
|
143
|
-
|
144
|
-
.section-title {
|
145
|
-
background: #79a;
|
146
|
-
color: #eee;
|
147
|
-
padding: 3px;
|
148
|
-
margin-top: 2em;
|
149
|
-
margin-left: -30px;
|
150
|
-
border: 1px solid #999;
|
151
|
-
}
|
152
|
-
|
153
|
-
.top-aligned-row { vertical-align: top }
|
154
|
-
.bottom-aligned-row { vertical-align: bottom }
|
155
|
-
|
156
|
-
/* --- Context section classes ----------------------- */
|
157
|
-
|
158
|
-
.context-row { }
|
159
|
-
.context-item-name { font-family: monospace; font-weight: bold; color: black; }
|
160
|
-
.context-item-value { font-size: small; color: #448; }
|
161
|
-
.context-item-desc { color: #333; padding-left: 2em; }
|
162
|
-
|
163
|
-
/* --- Method classes -------------------------- */
|
164
|
-
.method-detail {
|
165
|
-
background: #efefef;
|
166
|
-
padding: 0;
|
167
|
-
margin-top: 0.5em;
|
168
|
-
margin-bottom: 1em;
|
169
|
-
border: 1px dotted #ccc;
|
170
|
-
}
|
171
|
-
.method-heading {
|
172
|
-
color: black;
|
173
|
-
background: #ccc;
|
174
|
-
border-bottom: 1px solid #666;
|
175
|
-
padding: 0.2em 0.5em 0 0.5em;
|
176
|
-
}
|
177
|
-
.method-signature { color: black; background: inherit; }
|
178
|
-
.method-name { font-weight: bold; }
|
179
|
-
.method-args { font-style: italic; }
|
180
|
-
.method-description { padding: 0 0.5em 0 0.5em; }
|
181
|
-
|
182
|
-
/* --- Source code sections -------------------- */
|
183
|
-
|
184
|
-
a.source-toggle { font-size: 90%; }
|
185
|
-
div.method-source-code {
|
186
|
-
background: #262626;
|
187
|
-
color: #ffdead;
|
188
|
-
margin: 1em;
|
189
|
-
padding: 0.5em;
|
190
|
-
border: 1px dashed #999;
|
191
|
-
overflow: hidden;
|
192
|
-
}
|
193
|
-
|
194
|
-
div.method-source-code pre { color: #ffdead; overflow: hidden; }
|
195
|
-
|
196
|
-
/* --- Ruby keyword styles --------------------- */
|
197
|
-
|
198
|
-
.standalone-code { background: #221111; color: #ffdead; overflow: hidden; }
|
199
|
-
|
200
|
-
.ruby-constant { color: #7fffd4; background: transparent; }
|
201
|
-
.ruby-keyword { color: #00ffff; background: transparent; }
|
202
|
-
.ruby-ivar { color: #eedd82; background: transparent; }
|
203
|
-
.ruby-operator { color: #00ffee; background: transparent; }
|
204
|
-
.ruby-identifier { color: #ffdead; background: transparent; }
|
205
|
-
.ruby-node { color: #ffa07a; background: transparent; }
|
206
|
-
.ruby-comment { color: #b22222; font-weight: bold; background: transparent; }
|
207
|
-
.ruby-regexp { color: #ffa07a; background: transparent; }
|
208
|
-
.ruby-value { color: #7fffd4; background: transparent; }
|
data/doc/examples.html
DELETED
@@ -1,312 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta http-equiv="Content-Type" content="text/html">
|
5
|
-
<title>rbTenjin Examples</title>
|
6
|
-
<meta name="generator" content="kwaser">
|
7
|
-
<meta http-equiv="Content-Style-Type" content="text/css">
|
8
|
-
<link rel="stylesheet" href="docstyle.css" type="text/css">
|
9
|
-
</head>
|
10
|
-
<body>
|
11
|
-
|
12
|
-
<blockquote>
|
13
|
-
<div class="mainbody">
|
14
|
-
|
15
|
-
<div align="left"><h1>rbTenjin Examples</h1></div>
|
16
|
-
<div align="left">
|
17
|
-
last update: $Date: 2007-10-23 15:29:14 +0900 (Tue, 23 Oct 2007) $<br>
|
18
|
-
</div>
|
19
|
-
|
20
|
-
<p>Release: 0.6.2
|
21
|
-
</p>
|
22
|
-
<p>Table of Contents:
|
23
|
-
<ul>
|
24
|
-
<li><a href="#bordered-table">Bordered Table</a>
|
25
|
-
</li>
|
26
|
-
<li><a href="#form">Form</a>
|
27
|
-
</li>
|
28
|
-
<li><a href="#preprocessing">Preprocessing</a>
|
29
|
-
</li>
|
30
|
-
</ul>
|
31
|
-
</p>
|
32
|
-
<a name="bordered-table"></a>
|
33
|
-
<h2 class="section1">Bordered Table</h2>
|
34
|
-
<a name="table/table.rbhtml"></a>
|
35
|
-
<div class="program_caption">
|
36
|
-
Template: 'table.rbhtml'</div>
|
37
|
-
<pre class="program"><html>
|
38
|
-
<body>
|
39
|
-
<h1><strong>${@title}</strong></h1>
|
40
|
-
<table>
|
41
|
-
<strong><?rb i = 0 ?></strong>
|
42
|
-
<strong><?rb for item in @items ?></strong>
|
43
|
-
<strong><?rb i += 1 ?></strong>
|
44
|
-
<strong><?rb color = i % 2 == 0 ? '#FFCCCC' : '#CCCCFF' ?></strong>
|
45
|
-
<tr bgcolor="<strong>#{color}</strong>">
|
46
|
-
<td><strong>#{i}</strong></td>
|
47
|
-
<td><strong>${item}</strong></td>
|
48
|
-
</tr>
|
49
|
-
<strong><?rb end ?></strong>
|
50
|
-
</table>
|
51
|
-
</body>
|
52
|
-
</html>
|
53
|
-
</pre>
|
54
|
-
<a name="table/table_s.result"></a>
|
55
|
-
<div class="terminal_caption">
|
56
|
-
Convert into Ruby script:</div>
|
57
|
-
<pre class="terminal">$ rbtenjin -a convert table.rbhtml
|
58
|
-
_buf = ''; _buf << %Q`<html>
|
59
|
-
<body>
|
60
|
-
<h1><strong>#{escape((@title).to_s)}</strong></h1>
|
61
|
-
<table>\n`
|
62
|
-
<strong>i = 0</strong>
|
63
|
-
<strong>for item in @items</strong>
|
64
|
-
<strong>i += 1</strong>
|
65
|
-
<strong>color = i % 2 == 0 ? '#FFCCCC' : '#CCCCFF'</strong>
|
66
|
-
_buf << %Q` <tr bgcolor="<strong>#{color}</strong>">
|
67
|
-
<td><strong>#{i}</strong></td>
|
68
|
-
<td><strong>#{escape((item).to_s)}</strong></td>
|
69
|
-
</tr>\n`
|
70
|
-
<strong>end</strong>
|
71
|
-
_buf << %Q` </table>
|
72
|
-
</body>
|
73
|
-
</html>\n`
|
74
|
-
_buf.to_s
|
75
|
-
</pre>
|
76
|
-
<a name="table/table.rb"></a>
|
77
|
-
<div class="program_caption">
|
78
|
-
Main program: 'table.rb'</div>
|
79
|
-
<pre class="program">## create Engine object
|
80
|
-
require 'tenjin'
|
81
|
-
<strong>engine = Tenjin::Engine.new()</strong>
|
82
|
-
|
83
|
-
## render template with context data
|
84
|
-
context = { :title => 'Bordered Table Example',
|
85
|
-
:items => [ '<AAA>', 'B&B', '"CCC"' ] }
|
86
|
-
<strong>output = engine.render('table.rbhtml', context)</strong>
|
87
|
-
puts output
|
88
|
-
</pre>
|
89
|
-
<a name="table/table.result"></a>
|
90
|
-
<div class="terminal_caption">
|
91
|
-
Result:</div>
|
92
|
-
<pre class="terminal">$ ruby table.rb
|
93
|
-
<html>
|
94
|
-
<body>
|
95
|
-
<h1>Bordered Table Example</h1>
|
96
|
-
<table>
|
97
|
-
<tr bgcolor="<strong>#CCCCFF</strong>">
|
98
|
-
<td><strong>1</strong></td>
|
99
|
-
<td><strong>&lt;AAA&gt;</strong></td>
|
100
|
-
</tr>
|
101
|
-
<tr bgcolor="<strong>#FFCCCC</strong>">
|
102
|
-
<td><strong>2</strong></td>
|
103
|
-
<td><strong>B&amp;B</strong></td>
|
104
|
-
</tr>
|
105
|
-
<tr bgcolor="<strong>#CCCCFF</strong>">
|
106
|
-
<td><strong>3</strong></td>
|
107
|
-
<td><strong>&quot;CCC&quot;</strong></td>
|
108
|
-
</tr>
|
109
|
-
</table>
|
110
|
-
</body>
|
111
|
-
</html>
|
112
|
-
</pre>
|
113
|
-
<br>
|
114
|
-
|
115
|
-
|
116
|
-
<a name="form"></a>
|
117
|
-
<h2 class="section1">Form</h2>
|
118
|
-
<a name="form/form.rbhtml"></a>
|
119
|
-
<div class="program_caption">
|
120
|
-
Template: 'form.rbhtml':</div>
|
121
|
-
<pre class="program"><strong><?rb #@ARGS action, params, label ?></strong>
|
122
|
-
<form action="<strong>${@action}</strong>" method="post">
|
123
|
-
<p>
|
124
|
-
<label>Name:</label>
|
125
|
-
<input type="text" name="name" value="<strong>${@params[:name]}</strong>" />
|
126
|
-
</p>
|
127
|
-
<p>
|
128
|
-
<label>Gender:</label>
|
129
|
-
<strong><?rb gender = @params[:gender] ?></strong>
|
130
|
-
<input type="radio" name="gender" value="M" <strong>#{checked(gender=='M')}</strong> />Man
|
131
|
-
<input type="radio" name="gender" value="W" <strong>#{checked(gender=='W')}</strong> />Woman
|
132
|
-
</p>
|
133
|
-
<input type="submit" value="<strong>${@label}</strong>" />
|
134
|
-
</form>
|
135
|
-
</pre>
|
136
|
-
<a name="form/create.rbhtml"></a>
|
137
|
-
<div class="program_caption">
|
138
|
-
Template: 'create.rbhtml':</div>
|
139
|
-
<pre class="program"><?rb @title = 'Create user' ?>
|
140
|
-
<?rb @label = 'Create' ?>
|
141
|
-
<?rb @action = 'action.cgi' ?>
|
142
|
-
<strong><?rb import(:form) ?></strong>
|
143
|
-
</pre>
|
144
|
-
<a name="form/update.rbhtml"></a>
|
145
|
-
<div class="program_caption">
|
146
|
-
Template: 'update.rbhtml':</div>
|
147
|
-
<pre class="program"><?rb @title = 'Update user' ?>
|
148
|
-
<?rb @label = 'Update' ?>
|
149
|
-
<?rb @action = 'update.cgi' ?>
|
150
|
-
<strong><?rb import(:form) ?></strong>
|
151
|
-
</pre>
|
152
|
-
<a name="form/layout.rbhtml"></a>
|
153
|
-
<div class="program_caption">
|
154
|
-
Layout template: 'layout.rbhtml'</div>
|
155
|
-
<pre class="program"><html>
|
156
|
-
<body>
|
157
|
-
<h1>${@title}</h1>
|
158
|
-
<div class="main-content">
|
159
|
-
<strong>#{@_content}</strong>
|
160
|
-
</div>
|
161
|
-
</body>
|
162
|
-
</html>
|
163
|
-
</pre>
|
164
|
-
<a name="form/main.rb"></a>
|
165
|
-
<div class="program_caption">
|
166
|
-
Main program: 'main.rb':</div>
|
167
|
-
<pre class="program">## create Engine object
|
168
|
-
require 'tenjin'
|
169
|
-
<strong>engine = Tenjin::Engine.new(:postfix=>'.rbhtml', :layout=>'layout.rbhtml')</strong>
|
170
|
-
|
171
|
-
## render template with context data
|
172
|
-
params = { :name=>'Foo', :gender=>'M' }
|
173
|
-
context = { :params=>params }
|
174
|
-
<strong>output = engine.render(:update, context)</strong> # :update == 'update'+postfix
|
175
|
-
puts output
|
176
|
-
</pre>
|
177
|
-
<a name="form/main.result"></a>
|
178
|
-
<div class="terminal_caption">
|
179
|
-
Result:</div>
|
180
|
-
<pre class="terminal">$ ruby main.rb
|
181
|
-
<html>
|
182
|
-
<body>
|
183
|
-
<h1><strong>Update user</strong></h1>
|
184
|
-
<div class="main-content">
|
185
|
-
<form action="<strong>update.cgi</strong>" method="post">
|
186
|
-
<p>
|
187
|
-
<label>Name:</label>
|
188
|
-
<input type="text" name="name" value="<strong>Foo</strong>" />
|
189
|
-
</p>
|
190
|
-
<p>
|
191
|
-
<label>Gender:</label>
|
192
|
-
<input type="radio" name="gender" value="M" <strong> checked="checked"</strong> />Man
|
193
|
-
<input type="radio" name="gender" value="W" />Woman
|
194
|
-
</p>
|
195
|
-
<input type="submit" value="<strong>Update</strong>" />
|
196
|
-
</form>
|
197
|
-
|
198
|
-
</div>
|
199
|
-
</body>
|
200
|
-
</html>
|
201
|
-
</pre>
|
202
|
-
<br>
|
203
|
-
|
204
|
-
|
205
|
-
<a name="preprocessing"></a>
|
206
|
-
<h2 class="section1">Preprocessing</h2>
|
207
|
-
<a name="preprocessing/helper.rb"></a>
|
208
|
-
<div class="program_caption">
|
209
|
-
Library: 'helper.rb'</div>
|
210
|
-
<pre class="program">LANGUAGES = [
|
211
|
-
['en', 'Engilish'],
|
212
|
-
['fr', 'French'],
|
213
|
-
['de', 'German'],
|
214
|
-
['es', 'Spanish'],
|
215
|
-
['ch', 'Chinese'],
|
216
|
-
['ja', 'Japanese'],
|
217
|
-
]
|
218
|
-
|
219
|
-
def link_to(label, options={})
|
220
|
-
action, id = options[:action], options[:id]
|
221
|
-
url = '/app'
|
222
|
-
url << '/' << action if action && !action.empty?
|
223
|
-
url << '/' << id if id
|
224
|
-
return "<a href=\"#{CGI::escape(url).gsub(/%2F/i, '/')}\">#{label}</a>"
|
225
|
-
end
|
226
|
-
</pre>
|
227
|
-
<a name="preprocessing/select.rbhtml"></a>
|
228
|
-
<div class="program_caption">
|
229
|
-
Template: 'select.rbhtml'</div>
|
230
|
-
<pre class="program"><?RB require 'helper' ?>
|
231
|
-
<form>
|
232
|
-
<label>Select your language:</label>
|
233
|
-
<select name="lang">
|
234
|
-
<?rb table = { @params[:lang] => ' selected="selected"' } ?>
|
235
|
-
<strong><?RB for val, name in LANGUAGES ?></strong>
|
236
|
-
<option value="${{val}}" #{table[#{{val.inspect}}]}>${{name}}</option>
|
237
|
-
<strong><?RB end ?></strong>
|
238
|
-
</select>
|
239
|
-
<input type="submit" value="OK" />
|
240
|
-
</form>
|
241
|
-
<p>
|
242
|
-
<strong>#{{</strong>link_to('Back', :action=>'index')<strong>}}</strong> |
|
243
|
-
<strong>#{{</strong>link_to('Show '+<strong>_P('@params[:name]')</strong>, :action=>'show', :id=><strong>_p('@params[:id]')</strong>)<strong>}}</strong>
|
244
|
-
</p>
|
245
|
-
</pre>
|
246
|
-
<a name="preprocessing/select_P.result"></a>
|
247
|
-
<div class="terminal_caption">
|
248
|
-
Preprocessed code:</div>
|
249
|
-
<pre class="terminal">$ rbtenjin -a preprocess select.rbhtml
|
250
|
-
<form>
|
251
|
-
<label>Select your language:</label>
|
252
|
-
<select name="lang">
|
253
|
-
<?rb table = { @params[:lang] => ' selected="selected"' } ?>
|
254
|
-
<option value="en" #{table["en"]}>Engilish</option>
|
255
|
-
<option value="fr" #{table["fr"]}>French</option>
|
256
|
-
<option value="de" #{table["de"]}>German</option>
|
257
|
-
<option value="es" #{table["es"]}>Spanish</option>
|
258
|
-
<option value="ch" #{table["ch"]}>Chinese</option>
|
259
|
-
<option value="ja" #{table["ja"]}>Japanese</option>
|
260
|
-
</select>
|
261
|
-
<input type="submit" value="OK" />
|
262
|
-
</form>
|
263
|
-
<p>
|
264
|
-
<a href="/app/index">Back</a> |
|
265
|
-
<a href="/app/show/<strong>#{@params[:id]}</strong>">Show <strong>${@params[:name]}</strong></a>
|
266
|
-
</p>
|
267
|
-
</pre>
|
268
|
-
<a name="preprocessing/main.rb"></a>
|
269
|
-
<div class="program_caption">
|
270
|
-
Main program: 'main.rb'</div>
|
271
|
-
<pre class="program">require 'helper'
|
272
|
-
|
273
|
-
## create engine
|
274
|
-
require 'tenjin'
|
275
|
-
engine = Tenjin::Engine.new(:postfix=>'.rbhtml', <strong>:preprocess=>true</strong>)
|
276
|
-
|
277
|
-
## render template with context data
|
278
|
-
params = { :id=>1234, :name=>'Foo', :lang=>'ch' }
|
279
|
-
context = { :params => params }
|
280
|
-
output = engine.render(:select, context)
|
281
|
-
puts output
|
282
|
-
</pre>
|
283
|
-
<a name="preprocessing/main.result"></a>
|
284
|
-
<div class="terminal_caption">
|
285
|
-
Result:</div>
|
286
|
-
<pre class="terminal">$ ruby main.rb
|
287
|
-
<form>
|
288
|
-
<label>Select your language:</label>
|
289
|
-
<select name="lang">
|
290
|
-
<option value="en" >Engilish</option>
|
291
|
-
<option value="fr" >French</option>
|
292
|
-
<option value="de" >German</option>
|
293
|
-
<option value="es" >Spanish</option>
|
294
|
-
<option value="ch" selected="selected">Chinese</option>
|
295
|
-
<option value="ja" >Japanese</option>
|
296
|
-
</select>
|
297
|
-
<input type="submit" value="OK" />
|
298
|
-
</form>
|
299
|
-
<p>
|
300
|
-
<a href="/app/index">Back</a> |
|
301
|
-
<a href="/app/show/1234">Show Foo</a>
|
302
|
-
</p>
|
303
|
-
</pre>
|
304
|
-
<br>
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
</div>
|
309
|
-
</blockquote>
|
310
|
-
|
311
|
-
</body>
|
312
|
-
</html>
|