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
@@ -1,166 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>Class: Tenjin::ErubisTemplate</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
-
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
-
<script type="text/javascript">
|
13
|
-
// <![CDATA[
|
14
|
-
|
15
|
-
function popupCode( url ) {
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
-
}
|
18
|
-
|
19
|
-
function toggleCode( id ) {
|
20
|
-
if ( document.getElementById )
|
21
|
-
elem = document.getElementById( id );
|
22
|
-
else if ( document.all )
|
23
|
-
elem = eval( "document.all." + id );
|
24
|
-
else
|
25
|
-
return false;
|
26
|
-
|
27
|
-
elemStyle = elem.style;
|
28
|
-
|
29
|
-
if ( elemStyle.display != "block" ) {
|
30
|
-
elemStyle.display = "block"
|
31
|
-
} else {
|
32
|
-
elemStyle.display = "none"
|
33
|
-
}
|
34
|
-
|
35
|
-
return true;
|
36
|
-
}
|
37
|
-
|
38
|
-
// Make codeblocks hidden by default
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
-
|
41
|
-
// ]]>
|
42
|
-
</script>
|
43
|
-
|
44
|
-
</head>
|
45
|
-
<body>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<div id="classHeader">
|
50
|
-
<table class="header-table">
|
51
|
-
<tr class="top-aligned-row">
|
52
|
-
<td><strong>Class</strong></td>
|
53
|
-
<td class="class-name-in-header">Tenjin::ErubisTemplate</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../../files/lib/tenjin_rb.html">
|
59
|
-
lib/tenjin.rb
|
60
|
-
</a>
|
61
|
-
<br />
|
62
|
-
</td>
|
63
|
-
</tr>
|
64
|
-
|
65
|
-
<tr class="top-aligned-row">
|
66
|
-
<td><strong>Parent:</strong></td>
|
67
|
-
<td>
|
68
|
-
<a href="Template.html">
|
69
|
-
Tenjin::Template
|
70
|
-
</a>
|
71
|
-
</td>
|
72
|
-
</tr>
|
73
|
-
</table>
|
74
|
-
</div>
|
75
|
-
<!-- banner header -->
|
76
|
-
|
77
|
-
<div id="bodyContent">
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
<div id="contextContent">
|
82
|
-
|
83
|
-
<div id="description">
|
84
|
-
<p>
|
85
|
-
template class to use eRuby template file (*.rhtml) instead of <a
|
86
|
-
href="../Tenjin.html">Tenjin</a> template file (*.rbhtml). requires
|
87
|
-
‘erubis’ (<a
|
88
|
-
href="http://www.kuwata-lab.com/erubis">www.kuwata-lab.com/erubis</a>).
|
89
|
-
</p>
|
90
|
-
<p>
|
91
|
-
ex.
|
92
|
-
</p>
|
93
|
-
<pre>
|
94
|
-
require 'erubis'
|
95
|
-
require 'tenjin'
|
96
|
-
engine = Tenjin::Engine.new(:templateclass=>Tenjin::ErubisTemplate)
|
97
|
-
</pre>
|
98
|
-
|
99
|
-
</div>
|
100
|
-
|
101
|
-
|
102
|
-
</div>
|
103
|
-
|
104
|
-
<div id="method-list">
|
105
|
-
<h3 class="section-bar">Methods</h3>
|
106
|
-
|
107
|
-
<div class="name-list">
|
108
|
-
<a href="#M000018">parse_stmts</a>
|
109
|
-
</div>
|
110
|
-
</div>
|
111
|
-
|
112
|
-
</div>
|
113
|
-
|
114
|
-
|
115
|
-
<!-- if includes -->
|
116
|
-
|
117
|
-
<div id="section">
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
<!-- if method_list -->
|
127
|
-
<div id="methods">
|
128
|
-
<h3 class="section-bar">Protected Instance methods</h3>
|
129
|
-
|
130
|
-
<div id="method-M000018" class="method-detail">
|
131
|
-
<a name="M000018"></a>
|
132
|
-
|
133
|
-
<div class="method-heading">
|
134
|
-
<a href="#M000018" class="method-signature">
|
135
|
-
<span class="method-name">parse_stmts</span><span class="method-args">(input)</span>
|
136
|
-
</a>
|
137
|
-
</div>
|
138
|
-
|
139
|
-
<div class="method-description">
|
140
|
-
<p><a class="source-toggle" href="#"
|
141
|
-
onclick="toggleCode('M000018-source');return false;">[Source]</a></p>
|
142
|
-
<div class="method-source-code" id="M000018-source">
|
143
|
-
<pre>
|
144
|
-
<span class="ruby-comment cmt"># File lib/tenjin.rb, line 766</span>
|
145
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_stmts</span>(<span class="ruby-identifier">input</span>)
|
146
|
-
<span class="ruby-identifier">eruby</span> = <span class="ruby-constant">Erubis</span><span class="ruby-operator">::</span><span class="ruby-constant">Eruby</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">input</span>, <span class="ruby-identifier">:preamble=</span><span class="ruby-operator">></span><span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">:postamble=</span><span class="ruby-operator">></span><span class="ruby-keyword kw">false</span>)
|
147
|
-
<span class="ruby-ivar">@script</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">eruby</span>.<span class="ruby-identifier">src</span>
|
148
|
-
<span class="ruby-keyword kw">end</span>
|
149
|
-
</pre>
|
150
|
-
</div>
|
151
|
-
</div>
|
152
|
-
</div>
|
153
|
-
|
154
|
-
|
155
|
-
</div>
|
156
|
-
|
157
|
-
|
158
|
-
</div>
|
159
|
-
|
160
|
-
|
161
|
-
<div id="validator-badges">
|
162
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
163
|
-
</div>
|
164
|
-
|
165
|
-
</body>
|
166
|
-
</html>
|
@@ -1,359 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>Module: Tenjin::HtmlHelper</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
-
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
-
<script type="text/javascript">
|
13
|
-
// <![CDATA[
|
14
|
-
|
15
|
-
function popupCode( url ) {
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
-
}
|
18
|
-
|
19
|
-
function toggleCode( id ) {
|
20
|
-
if ( document.getElementById )
|
21
|
-
elem = document.getElementById( id );
|
22
|
-
else if ( document.all )
|
23
|
-
elem = eval( "document.all." + id );
|
24
|
-
else
|
25
|
-
return false;
|
26
|
-
|
27
|
-
elemStyle = elem.style;
|
28
|
-
|
29
|
-
if ( elemStyle.display != "block" ) {
|
30
|
-
elemStyle.display = "block"
|
31
|
-
} else {
|
32
|
-
elemStyle.display = "none"
|
33
|
-
}
|
34
|
-
|
35
|
-
return true;
|
36
|
-
}
|
37
|
-
|
38
|
-
// Make codeblocks hidden by default
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
-
|
41
|
-
// ]]>
|
42
|
-
</script>
|
43
|
-
|
44
|
-
</head>
|
45
|
-
<body>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<div id="classHeader">
|
50
|
-
<table class="header-table">
|
51
|
-
<tr class="top-aligned-row">
|
52
|
-
<td><strong>Module</strong></td>
|
53
|
-
<td class="class-name-in-header">Tenjin::HtmlHelper</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../../files/lib/tenjin_rb.html">
|
59
|
-
lib/tenjin.rb
|
60
|
-
</a>
|
61
|
-
<br />
|
62
|
-
</td>
|
63
|
-
</tr>
|
64
|
-
|
65
|
-
</table>
|
66
|
-
</div>
|
67
|
-
<!-- banner header -->
|
68
|
-
|
69
|
-
<div id="bodyContent">
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
<div id="contextContent">
|
74
|
-
|
75
|
-
<div id="description">
|
76
|
-
<p>
|
77
|
-
helper module for <a href="Context.html">Context</a> class
|
78
|
-
</p>
|
79
|
-
|
80
|
-
</div>
|
81
|
-
|
82
|
-
|
83
|
-
</div>
|
84
|
-
|
85
|
-
<div id="method-list">
|
86
|
-
<h3 class="section-bar">Methods</h3>
|
87
|
-
|
88
|
-
<div class="name-list">
|
89
|
-
<a href="#M000004">checked</a>
|
90
|
-
<a href="#M000006">disabled</a>
|
91
|
-
<a href="#M000002">escape</a>
|
92
|
-
<a href="#M000001">escape_xml</a>
|
93
|
-
<a href="#M000007">nl2br</a>
|
94
|
-
<a href="#M000005">selected</a>
|
95
|
-
<a href="#M000003">tagattr</a>
|
96
|
-
<a href="#M000008">text2html</a>
|
97
|
-
</div>
|
98
|
-
</div>
|
99
|
-
|
100
|
-
</div>
|
101
|
-
|
102
|
-
|
103
|
-
<!-- if includes -->
|
104
|
-
|
105
|
-
<div id="section">
|
106
|
-
|
107
|
-
|
108
|
-
<div id="constants-list">
|
109
|
-
<h3 class="section-bar">Constants</h3>
|
110
|
-
|
111
|
-
<div class="name-list">
|
112
|
-
<table summary="Constants">
|
113
|
-
<tr class="top-aligned-row context-row">
|
114
|
-
<td class="context-item-name">XML_ESCAPE_TABLE</td>
|
115
|
-
<td>=</td>
|
116
|
-
<td class="context-item-value">{ '&'=>'&amp;', '<'=>'&lt;', '>'=>'&gt;', '"'=>'&quot;', "'"=>'&#039;' }</td>
|
117
|
-
</tr>
|
118
|
-
</table>
|
119
|
-
</div>
|
120
|
-
</div>
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
<!-- if method_list -->
|
128
|
-
<div id="methods">
|
129
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
130
|
-
|
131
|
-
<div id="method-M000004" class="method-detail">
|
132
|
-
<a name="M000004"></a>
|
133
|
-
|
134
|
-
<div class="method-heading">
|
135
|
-
<a href="#M000004" class="method-signature">
|
136
|
-
<span class="method-name">checked</span><span class="method-args">(expr)</span>
|
137
|
-
</a>
|
138
|
-
</div>
|
139
|
-
|
140
|
-
<div class="method-description">
|
141
|
-
<p>
|
142
|
-
return ’ checked="<a
|
143
|
-
href="HtmlHelper.html#M000004">checked</a>"’ if expr is not
|
144
|
-
false or nil
|
145
|
-
</p>
|
146
|
-
<p><a class="source-toggle" href="#"
|
147
|
-
onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
|
148
|
-
<div class="method-source-code" id="M000004-source">
|
149
|
-
<pre>
|
150
|
-
<span class="ruby-comment cmt"># File lib/tenjin.rb, line 73</span>
|
151
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">checked</span>(<span class="ruby-identifier">expr</span>)
|
152
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">expr</span> <span class="ruby-operator">?</span> <span class="ruby-value str">' checked="checked"'</span> <span class="ruby-operator">:</span> <span class="ruby-value str">''</span>
|
153
|
-
<span class="ruby-keyword kw">end</span>
|
154
|
-
</pre>
|
155
|
-
</div>
|
156
|
-
</div>
|
157
|
-
</div>
|
158
|
-
|
159
|
-
<div id="method-M000006" class="method-detail">
|
160
|
-
<a name="M000006"></a>
|
161
|
-
|
162
|
-
<div class="method-heading">
|
163
|
-
<a href="#M000006" class="method-signature">
|
164
|
-
<span class="method-name">disabled</span><span class="method-args">(expr)</span>
|
165
|
-
</a>
|
166
|
-
</div>
|
167
|
-
|
168
|
-
<div class="method-description">
|
169
|
-
<p>
|
170
|
-
return ’ disabled="<a
|
171
|
-
href="HtmlHelper.html#M000006">disabled</a>"’ if expr is not
|
172
|
-
false or nil
|
173
|
-
</p>
|
174
|
-
<p><a class="source-toggle" href="#"
|
175
|
-
onclick="toggleCode('M000006-source');return false;">[Source]</a></p>
|
176
|
-
<div class="method-source-code" id="M000006-source">
|
177
|
-
<pre>
|
178
|
-
<span class="ruby-comment cmt"># File lib/tenjin.rb, line 83</span>
|
179
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">disabled</span>(<span class="ruby-identifier">expr</span>)
|
180
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">expr</span> <span class="ruby-operator">?</span> <span class="ruby-value str">' disabled="disabled"'</span> <span class="ruby-operator">:</span> <span class="ruby-value str">''</span>
|
181
|
-
<span class="ruby-keyword kw">end</span>
|
182
|
-
</pre>
|
183
|
-
</div>
|
184
|
-
</div>
|
185
|
-
</div>
|
186
|
-
|
187
|
-
<div id="method-M000002" class="method-detail">
|
188
|
-
<a name="M000002"></a>
|
189
|
-
|
190
|
-
<div class="method-heading">
|
191
|
-
<span class="method-name">escape</span><span class="method-args">(s)</span>
|
192
|
-
</div>
|
193
|
-
|
194
|
-
<div class="method-description">
|
195
|
-
<p>
|
196
|
-
Alias for <a href="HtmlHelper.html#M000001">escape_xml</a>
|
197
|
-
</p>
|
198
|
-
</div>
|
199
|
-
</div>
|
200
|
-
|
201
|
-
<div id="method-M000001" class="method-detail">
|
202
|
-
<a name="M000001"></a>
|
203
|
-
|
204
|
-
<div class="method-heading">
|
205
|
-
<a href="#M000001" class="method-signature">
|
206
|
-
<span class="method-name">escape_xml</span><span class="method-args">(s)</span>
|
207
|
-
</a>
|
208
|
-
</div>
|
209
|
-
|
210
|
-
<div class="method-description">
|
211
|
-
<p><a class="source-toggle" href="#"
|
212
|
-
onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
|
213
|
-
<div class="method-source-code" id="M000001-source">
|
214
|
-
<pre>
|
215
|
-
<span class="ruby-comment cmt"># File lib/tenjin.rb, line 45</span>
|
216
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escape_xml</span>(<span class="ruby-identifier">s</span>)
|
217
|
-
<span class="ruby-comment cmt">#return s.gsub(/[&<>"]/) { XML_ESCAPE_TABLE[$&] }</span>
|
218
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/[&<>"]/</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-constant">XML_ESCAPE_TABLE</span>[<span class="ruby-identifier">s</span>] }
|
219
|
-
<span class="ruby-comment cmt">##</span>
|
220
|
-
<span class="ruby-comment cmt">#s = s.gsub(/&/, '&amp;')</span>
|
221
|
-
<span class="ruby-comment cmt">#s.gsub!(/</, '&lt;')</span>
|
222
|
-
<span class="ruby-comment cmt">#s.gsub!(/>/, '&gt;')</span>
|
223
|
-
<span class="ruby-comment cmt">#s.gsub!(/"/, '&quot;')</span>
|
224
|
-
<span class="ruby-comment cmt">#return s</span>
|
225
|
-
<span class="ruby-comment cmt">##</span>
|
226
|
-
<span class="ruby-comment cmt">#return s.gsub(/&/, '&amp;').gsub(/</, '&lt;').gsub(/>/, '&gt;').gsub(/"/, '&quot;')</span>
|
227
|
-
<span class="ruby-keyword kw">end</span>
|
228
|
-
</pre>
|
229
|
-
</div>
|
230
|
-
</div>
|
231
|
-
</div>
|
232
|
-
|
233
|
-
<div id="method-M000007" class="method-detail">
|
234
|
-
<a name="M000007"></a>
|
235
|
-
|
236
|
-
<div class="method-heading">
|
237
|
-
<a href="#M000007" class="method-signature">
|
238
|
-
<span class="method-name">nl2br</span><span class="method-args">(text)</span>
|
239
|
-
</a>
|
240
|
-
</div>
|
241
|
-
|
242
|
-
<div class="method-description">
|
243
|
-
<p>
|
244
|
-
convert "\n" into "<br />\n"
|
245
|
-
</p>
|
246
|
-
<p><a class="source-toggle" href="#"
|
247
|
-
onclick="toggleCode('M000007-source');return false;">[Source]</a></p>
|
248
|
-
<div class="method-source-code" id="M000007-source">
|
249
|
-
<pre>
|
250
|
-
<span class="ruby-comment cmt"># File lib/tenjin.rb, line 88</span>
|
251
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">nl2br</span>(<span class="ruby-identifier">text</span>)
|
252
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/\n/</span>, <span class="ruby-value str">"<br />\n"</span>)
|
253
|
-
<span class="ruby-keyword kw">end</span>
|
254
|
-
</pre>
|
255
|
-
</div>
|
256
|
-
</div>
|
257
|
-
</div>
|
258
|
-
|
259
|
-
<div id="method-M000005" class="method-detail">
|
260
|
-
<a name="M000005"></a>
|
261
|
-
|
262
|
-
<div class="method-heading">
|
263
|
-
<a href="#M000005" class="method-signature">
|
264
|
-
<span class="method-name">selected</span><span class="method-args">(expr)</span>
|
265
|
-
</a>
|
266
|
-
</div>
|
267
|
-
|
268
|
-
<div class="method-description">
|
269
|
-
<p>
|
270
|
-
return ’ selected="<a
|
271
|
-
href="HtmlHelper.html#M000005">selected</a>"’ if expr is not
|
272
|
-
false or nil
|
273
|
-
</p>
|
274
|
-
<p><a class="source-toggle" href="#"
|
275
|
-
onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
|
276
|
-
<div class="method-source-code" id="M000005-source">
|
277
|
-
<pre>
|
278
|
-
<span class="ruby-comment cmt"># File lib/tenjin.rb, line 78</span>
|
279
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">selected</span>(<span class="ruby-identifier">expr</span>)
|
280
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">expr</span> <span class="ruby-operator">?</span> <span class="ruby-value str">' selected="selected"'</span> <span class="ruby-operator">:</span> <span class="ruby-value str">''</span>
|
281
|
-
<span class="ruby-keyword kw">end</span>
|
282
|
-
</pre>
|
283
|
-
</div>
|
284
|
-
</div>
|
285
|
-
</div>
|
286
|
-
|
287
|
-
<div id="method-M000003" class="method-detail">
|
288
|
-
<a name="M000003"></a>
|
289
|
-
|
290
|
-
<div class="method-heading">
|
291
|
-
<a href="#M000003" class="method-signature">
|
292
|
-
<span class="method-name">tagattr</span><span class="method-args">(name, expr, value=nil, escape=true)</span>
|
293
|
-
</a>
|
294
|
-
</div>
|
295
|
-
|
296
|
-
<div class="method-description">
|
297
|
-
<p>
|
298
|
-
(experimental) return ’ name="value"’ if expr is not
|
299
|
-
false nor nil. if value is nil or false then expr is used as value.
|
300
|
-
</p>
|
301
|
-
<p><a class="source-toggle" href="#"
|
302
|
-
onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
|
303
|
-
<div class="method-source-code" id="M000003-source">
|
304
|
-
<pre>
|
305
|
-
<span class="ruby-comment cmt"># File lib/tenjin.rb, line 62</span>
|
306
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tagattr</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">expr</span>, <span class="ruby-identifier">value</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">escape</span>=<span class="ruby-keyword kw">true</span>)
|
307
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">expr</span>
|
308
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-value str">''</span>
|
309
|
-
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">escape</span>
|
310
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-node">" #{name}=\"#{escape_xml((value || expr).to_s)}\""</span>
|
311
|
-
<span class="ruby-keyword kw">else</span>
|
312
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-node">" #{name}=\"#{value || expr}\""</span>
|
313
|
-
<span class="ruby-keyword kw">end</span>
|
314
|
-
<span class="ruby-keyword kw">end</span>
|
315
|
-
</pre>
|
316
|
-
</div>
|
317
|
-
</div>
|
318
|
-
</div>
|
319
|
-
|
320
|
-
<div id="method-M000008" class="method-detail">
|
321
|
-
<a name="M000008"></a>
|
322
|
-
|
323
|
-
<div class="method-heading">
|
324
|
-
<a href="#M000008" class="method-signature">
|
325
|
-
<span class="method-name">text2html</span><span class="method-args">(text)</span>
|
326
|
-
</a>
|
327
|
-
</div>
|
328
|
-
|
329
|
-
<div class="method-description">
|
330
|
-
<p>
|
331
|
-
convert "\n" and " " into "<br />\n"
|
332
|
-
and " &nbsp;"
|
333
|
-
</p>
|
334
|
-
<p><a class="source-toggle" href="#"
|
335
|
-
onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
|
336
|
-
<div class="method-source-code" id="M000008-source">
|
337
|
-
<pre>
|
338
|
-
<span class="ruby-comment cmt"># File lib/tenjin.rb, line 93</span>
|
339
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">text2html</span>(<span class="ruby-identifier">text</span>)
|
340
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">nl2br</span>(<span class="ruby-identifier">escape_xml</span>(<span class="ruby-identifier">text</span>.<span class="ruby-identifier">to_s</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/ /</span>, <span class="ruby-value str">' &nbsp;'</span>))
|
341
|
-
<span class="ruby-keyword kw">end</span>
|
342
|
-
</pre>
|
343
|
-
</div>
|
344
|
-
</div>
|
345
|
-
</div>
|
346
|
-
|
347
|
-
|
348
|
-
</div>
|
349
|
-
|
350
|
-
|
351
|
-
</div>
|
352
|
-
|
353
|
-
|
354
|
-
<div id="validator-badges">
|
355
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
356
|
-
</div>
|
357
|
-
|
358
|
-
</body>
|
359
|
-
</html>
|