erubis 2.0.1 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. data/ChangeLog +150 -2
  2. data/LGPL +504 -0
  3. data/README.txt +14 -8
  4. data/benchmark/erubybench.rb +1 -1
  5. data/benchmark/erubybench.rhtml +3 -3
  6. data/bin/erubis +1 -1
  7. data/bin/notext +154 -0
  8. data/contrib/erubis +1036 -374
  9. data/contrib/inline-require +5 -3
  10. data/doc-api/classes/Erubis.html +43 -1
  11. data/doc-api/classes/Erubis/ArrayBufferEnhancer.html +14 -14
  12. data/doc-api/classes/Erubis/ArrayEnhancer.html +14 -14
  13. data/doc-api/classes/Erubis/Basic.html +112 -0
  14. data/doc-api/classes/Erubis/Basic/Converter.html +318 -0
  15. data/doc-api/classes/Erubis/Basic/Engine.html +130 -0
  16. data/doc-api/classes/Erubis/BiPatternEnhancer.html +14 -14
  17. data/doc-api/classes/Erubis/CGenerator.html +386 -0
  18. data/doc-api/classes/Erubis/Context.html +31 -32
  19. data/doc-api/classes/Erubis/Converter.html +231 -0
  20. data/doc-api/classes/Erubis/Ec.html +9 -283
  21. data/doc-api/classes/Erubis/Ejava.html +9 -274
  22. data/doc-api/classes/Erubis/Ejavascript.html +9 -298
  23. data/doc-api/classes/Erubis/Engine.html +68 -508
  24. data/doc-api/classes/Erubis/Eperl.html +9 -259
  25. data/doc-api/classes/Erubis/Ephp.html +9 -239
  26. data/doc-api/classes/Erubis/ErubisError.html +2 -2
  27. data/doc-api/classes/Erubis/Eruby.html +4 -187
  28. data/doc-api/classes/Erubis/EscapeEnhancer.html +9 -11
  29. data/doc-api/classes/Erubis/Escheme.html +9 -272
  30. data/doc-api/classes/Erubis/Evaluator.html +212 -0
  31. data/doc-api/classes/Erubis/Generator.html +410 -0
  32. data/doc-api/classes/Erubis/HeaderFooterEnhancer.html +16 -16
  33. data/doc-api/classes/Erubis/Helper.html +112 -0
  34. data/doc-api/classes/Erubis/Helper/CachedRailsTemplate.html +198 -0
  35. data/doc-api/classes/Erubis/Helper/RailsTemplate.html +366 -0
  36. data/doc-api/classes/Erubis/JavaGenerator.html +359 -0
  37. data/doc-api/classes/Erubis/JavascriptGenerator.html +381 -0
  38. data/doc-api/classes/Erubis/Main.html +27 -25
  39. data/doc-api/classes/Erubis/NoCodeEnhancer.html +249 -0
  40. data/doc-api/classes/Erubis/NoCodeEruby.html +120 -0
  41. data/doc-api/classes/Erubis/NoTextEnhancer.html +8 -8
  42. data/doc-api/classes/Erubis/NotSupportedError.html +119 -0
  43. data/doc-api/classes/Erubis/OptimizedEruby.html +22 -304
  44. data/doc-api/classes/Erubis/OptimizedGenerator.html +439 -0
  45. data/doc-api/classes/Erubis/OptimizedXmlEruby.html +7 -7
  46. data/doc-api/classes/Erubis/PI.html +124 -0
  47. data/doc-api/classes/Erubis/PI/Converter.html +318 -0
  48. data/doc-api/classes/Erubis/PI/Ec.html +166 -0
  49. data/doc-api/classes/Erubis/PI/Ejava.html +166 -0
  50. data/doc-api/classes/Erubis/PI/Ejavascript.html +166 -0
  51. data/doc-api/classes/Erubis/PI/Engine.html +122 -0
  52. data/doc-api/classes/Erubis/PI/Eperl.html +166 -0
  53. data/doc-api/classes/Erubis/PI/Ephp.html +166 -0
  54. data/doc-api/classes/Erubis/PI/Eruby.html +155 -0
  55. data/doc-api/classes/Erubis/PI/Escheme.html +166 -0
  56. data/doc-api/classes/Erubis/PI/TinyEruby.html +305 -0
  57. data/doc-api/classes/Erubis/PercentLineEnhancer.html +7 -7
  58. data/doc-api/classes/Erubis/PerlGenerator.html +344 -0
  59. data/doc-api/classes/Erubis/PhpGenerator.html +350 -0
  60. data/doc-api/classes/Erubis/PrintEnabledEnhancer.html +24 -24
  61. data/doc-api/classes/Erubis/PrintOutEnhancer.html +35 -35
  62. data/doc-api/classes/Erubis/RubyEvaluator.html +190 -0
  63. data/doc-api/classes/Erubis/RubyGenerator.html +327 -0
  64. data/doc-api/classes/Erubis/SchemeGenerator.html +382 -0
  65. data/doc-api/classes/Erubis/SimplifyEnhancer.html +17 -13
  66. data/doc-api/classes/Erubis/StdoutEnhancer.html +14 -14
  67. data/doc-api/classes/Erubis/StringBufferEnhancer.html +14 -14
  68. data/doc-api/classes/Erubis/TinyEruby.html +45 -40
  69. data/doc-api/classes/Erubis/XmlHelper.html +14 -14
  70. data/doc-api/created.rid +1 -1
  71. data/doc-api/files/__/README_txt.html +27 -9
  72. data/doc-api/files/erubis/context_rb.html +107 -0
  73. data/doc-api/files/erubis/converter_rb.html +114 -0
  74. data/doc-api/files/erubis/engine/ec_rb.html +2 -2
  75. data/doc-api/files/erubis/engine/ejava_rb.html +2 -2
  76. data/doc-api/files/erubis/engine/ejavascript_rb.html +2 -2
  77. data/doc-api/files/erubis/engine/enhanced_rb.html +2 -2
  78. data/doc-api/files/erubis/engine/eperl_rb.html +2 -2
  79. data/doc-api/files/erubis/engine/ephp_rb.html +2 -2
  80. data/doc-api/files/erubis/engine/eruby_rb.html +3 -2
  81. data/doc-api/files/erubis/engine/escheme_rb.html +2 -2
  82. data/doc-api/files/erubis/engine/optimized_rb.html +2 -2
  83. data/doc-api/files/erubis/engine_rb.html +6 -3
  84. data/doc-api/files/erubis/enhancer_rb.html +2 -9
  85. data/doc-api/files/erubis/error_rb.html +107 -0
  86. data/doc-api/files/erubis/evaluator_rb.html +115 -0
  87. data/doc-api/files/erubis/generator_rb.html +114 -0
  88. data/doc-api/files/erubis/helper/rails_rb.html +140 -0
  89. data/doc-api/files/erubis/helper_rb.html +1 -1
  90. data/doc-api/files/erubis/local-setting_rb.html +1 -1
  91. data/doc-api/files/erubis/main_rb.html +2 -2
  92. data/doc-api/files/erubis/tiny_rb.html +2 -2
  93. data/doc-api/files/erubis_rb.html +2 -2
  94. data/doc-api/fr_class_index.html +32 -0
  95. data/doc-api/fr_file_index.html +6 -0
  96. data/doc-api/fr_method_index.html +178 -136
  97. data/doc/users-guide.html +538 -199
  98. data/examples/{Makefile → basic/Makefile} +11 -11
  99. data/examples/basic/example.ec +42 -0
  100. data/examples/{example.ejava → basic/example.ejava} +5 -1
  101. data/examples/{example.ejavascript → basic/example.ejs} +0 -0
  102. data/examples/{example.eperl → basic/example.eperl} +2 -2
  103. data/examples/{example.ephp → basic/example.ephp} +0 -0
  104. data/examples/{example.eruby → basic/example.eruby} +0 -0
  105. data/examples/{example.escheme → basic/example.escheme} +0 -0
  106. data/examples/pi/Makefile +54 -0
  107. data/examples/pi/example.ec +42 -0
  108. data/examples/pi/example.ejava +45 -0
  109. data/examples/pi/example.ejs +16 -0
  110. data/examples/pi/example.eperl +16 -0
  111. data/examples/pi/example.ephp +17 -0
  112. data/examples/pi/example.eruby +15 -0
  113. data/examples/pi/example.escheme +26 -0
  114. data/lib/erubis.rb +15 -8
  115. data/lib/erubis/context.rb +54 -0
  116. data/lib/erubis/converter.rb +307 -0
  117. data/lib/erubis/engine.rb +57 -227
  118. data/lib/erubis/engine/ec.rb +31 -20
  119. data/lib/erubis/engine/ejava.rb +33 -21
  120. data/lib/erubis/engine/ejavascript.rb +30 -18
  121. data/lib/erubis/engine/enhanced.rb +7 -2
  122. data/lib/erubis/engine/eperl.rb +33 -19
  123. data/lib/erubis/engine/ephp.rb +32 -14
  124. data/lib/erubis/engine/eruby.rb +34 -7
  125. data/lib/erubis/engine/escheme.rb +34 -15
  126. data/lib/erubis/engine/optimized.rb +25 -11
  127. data/lib/erubis/enhancer.rb +53 -19
  128. data/lib/erubis/error.rb +24 -0
  129. data/lib/erubis/evaluator.rb +71 -0
  130. data/lib/erubis/generator.rb +83 -0
  131. data/lib/erubis/helper.rb +1 -1
  132. data/lib/erubis/helper/rails.rb +159 -0
  133. data/lib/erubis/local-setting.rb +1 -1
  134. data/lib/erubis/main.rb +87 -46
  135. data/lib/erubis/tiny.rb +81 -7
  136. data/test/assert-text-equal.rb +1 -1
  137. data/test/test-engines.rb +8 -9
  138. data/test/test-erubis.rb +196 -18
  139. data/test/{test-bin.rb → test-main.rb} +123 -21
  140. data/test/test-notext.rb +27 -0
  141. data/test/test.rb +5 -3
  142. data/test/testutil.rb +25 -36
  143. metadata +75 -13
  144. data/COPYING +0 -340
  145. data/examples/example.ec +0 -24
@@ -0,0 +1,212 @@
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: Erubis::Evaluator</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">Erubis::Evaluator</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/erubis/evaluator_rb.html">
59
+ erubis/evaluator.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
+ evaluate code
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="#M000060">evaluate</a>&nbsp;&nbsp;
90
+ <a href="#M000058">init_evaluator</a>&nbsp;&nbsp;
91
+ <a href="#M000059">result</a>&nbsp;&nbsp;
92
+ </div>
93
+ </div>
94
+
95
+ </div>
96
+
97
+
98
+ <!-- if includes -->
99
+
100
+ <div id="section">
101
+
102
+
103
+
104
+
105
+
106
+ <div id="attribute-list">
107
+ <h3 class="section-bar">Attributes</h3>
108
+
109
+ <div class="name-list">
110
+ <table>
111
+ <tr class="top-aligned-row context-row">
112
+ <td class="context-item-name">filename</td>
113
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
114
+ <td class="context-item-desc"></td>
115
+ </tr>
116
+ <tr class="top-aligned-row context-row">
117
+ <td class="context-item-name">src</td>
118
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
119
+ <td class="context-item-desc"></td>
120
+ </tr>
121
+ </table>
122
+ </div>
123
+ </div>
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-M000060" class="method-detail">
132
+ <a name="M000060"></a>
133
+
134
+ <div class="method-heading">
135
+ <a href="#M000060" class="method-signature">
136
+ <span class="method-name">evaluate</span><span class="method-args">(*args)</span>
137
+ </a>
138
+ </div>
139
+
140
+ <div class="method-description">
141
+ <p><a class="source-toggle" href="#"
142
+ onclick="toggleCode('M000060-source');return false;">[Source]</a></p>
143
+ <div class="method-source-code" id="M000060-source">
144
+ <pre>
145
+ <span class="ruby-comment cmt"># File erubis/evaluator.rb, line 33</span>
146
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">evaluate</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
147
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">NotSupportedError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;evaluation of code except Ruby is not supported.&quot;</span>)
148
+ <span class="ruby-keyword kw">end</span>
149
+ </pre>
150
+ </div>
151
+ </div>
152
+ </div>
153
+
154
+ <div id="method-M000058" class="method-detail">
155
+ <a name="M000058"></a>
156
+
157
+ <div class="method-heading">
158
+ <a href="#M000058" class="method-signature">
159
+ <span class="method-name">init_evaluator</span><span class="method-args">(properties)</span>
160
+ </a>
161
+ </div>
162
+
163
+ <div class="method-description">
164
+ <p><a class="source-toggle" href="#"
165
+ onclick="toggleCode('M000058-source');return false;">[Source]</a></p>
166
+ <div class="method-source-code" id="M000058-source">
167
+ <pre>
168
+ <span class="ruby-comment cmt"># File erubis/evaluator.rb, line 25</span>
169
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">init_evaluator</span>(<span class="ruby-identifier">properties</span>)
170
+ <span class="ruby-ivar">@filename</span> = <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:filename</span>]
171
+ <span class="ruby-keyword kw">end</span>
172
+ </pre>
173
+ </div>
174
+ </div>
175
+ </div>
176
+
177
+ <div id="method-M000059" class="method-detail">
178
+ <a name="M000059"></a>
179
+
180
+ <div class="method-heading">
181
+ <a href="#M000059" class="method-signature">
182
+ <span class="method-name">result</span><span class="method-args">(*args)</span>
183
+ </a>
184
+ </div>
185
+
186
+ <div class="method-description">
187
+ <p><a class="source-toggle" href="#"
188
+ onclick="toggleCode('M000059-source');return false;">[Source]</a></p>
189
+ <div class="method-source-code" id="M000059-source">
190
+ <pre>
191
+ <span class="ruby-comment cmt"># File erubis/evaluator.rb, line 29</span>
192
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">result</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
193
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">NotSupportedError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;evaluation of code except Ruby is not supported.&quot;</span>)
194
+ <span class="ruby-keyword kw">end</span>
195
+ </pre>
196
+ </div>
197
+ </div>
198
+ </div>
199
+
200
+
201
+ </div>
202
+
203
+
204
+ </div>
205
+
206
+
207
+ <div id="validator-badges">
208
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
209
+ </div>
210
+
211
+ </body>
212
+ </html>
@@ -0,0 +1,410 @@
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: Erubis::Generator</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">Erubis::Generator</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/erubis/generator_rb.html">
59
+ erubis/generator.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
+
76
+
77
+ </div>
78
+
79
+ <div id="method-list">
80
+ <h3 class="section-bar">Methods</h3>
81
+
82
+ <div class="name-list">
83
+ <a href="#M000016">add_expr_debug</a>&nbsp;&nbsp;
84
+ <a href="#M000015">add_expr_escaped</a>&nbsp;&nbsp;
85
+ <a href="#M000014">add_expr_literal</a>&nbsp;&nbsp;
86
+ <a href="#M000017">add_postamble</a>&nbsp;&nbsp;
87
+ <a href="#M000011">add_preamble</a>&nbsp;&nbsp;
88
+ <a href="#M000013">add_stmt</a>&nbsp;&nbsp;
89
+ <a href="#M000012">add_text</a>&nbsp;&nbsp;
90
+ <a href="#M000009">escape_text</a>&nbsp;&nbsp;
91
+ <a href="#M000010">escaped_expr</a>&nbsp;&nbsp;
92
+ <a href="#M000008">init_generator</a>&nbsp;&nbsp;
93
+ </div>
94
+ </div>
95
+
96
+ </div>
97
+
98
+
99
+ <!-- if includes -->
100
+
101
+ <div id="section">
102
+
103
+
104
+
105
+
106
+
107
+ <div id="attribute-list">
108
+ <h3 class="section-bar">Attributes</h3>
109
+
110
+ <div class="name-list">
111
+ <table>
112
+ <tr class="top-aligned-row context-row">
113
+ <td class="context-item-name">escapefunc</td>
114
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
115
+ <td class="context-item-desc"></td>
116
+ </tr>
117
+ </table>
118
+ </div>
119
+ </div>
120
+
121
+
122
+
123
+ <!-- if method_list -->
124
+ <div id="methods">
125
+ <h3 class="section-bar">Public Instance methods</h3>
126
+
127
+ <div id="method-M000016" class="method-detail">
128
+ <a name="M000016"></a>
129
+
130
+ <div class="method-heading">
131
+ <a href="#M000016" class="method-signature">
132
+ <span class="method-name">add_expr_debug</span><span class="method-args">(src, code)</span>
133
+ </a>
134
+ </div>
135
+
136
+ <div class="method-description">
137
+ <p>
138
+ (abstract) add expression code to src for debug. this is called by
139
+ add_expr().
140
+ </p>
141
+ <p><a class="source-toggle" href="#"
142
+ onclick="toggleCode('M000016-source');return false;">[Source]</a></p>
143
+ <div class="method-source-code" id="M000016-source">
144
+ <pre>
145
+ <span class="ruby-comment cmt"># File erubis/generator.rb, line 70</span>
146
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_expr_debug</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>)
147
+ <span class="ruby-identifier">not_implemented</span>
148
+ <span class="ruby-keyword kw">end</span>
149
+ </pre>
150
+ </div>
151
+ </div>
152
+ </div>
153
+
154
+ <div id="method-M000015" class="method-detail">
155
+ <a name="M000015"></a>
156
+
157
+ <div class="method-heading">
158
+ <a href="#M000015" class="method-signature">
159
+ <span class="method-name">add_expr_escaped</span><span class="method-args">(src, code)</span>
160
+ </a>
161
+ </div>
162
+
163
+ <div class="method-description">
164
+ <p>
165
+ (abstract) add escaped expression code to src. this is called by
166
+ add_expr().
167
+ </p>
168
+ <p><a class="source-toggle" href="#"
169
+ onclick="toggleCode('M000015-source');return false;">[Source]</a></p>
170
+ <div class="method-source-code" id="M000015-source">
171
+ <pre>
172
+ <span class="ruby-comment cmt"># File erubis/generator.rb, line 65</span>
173
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_expr_escaped</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>)
174
+ <span class="ruby-identifier">not_implemented</span>
175
+ <span class="ruby-keyword kw">end</span>
176
+ </pre>
177
+ </div>
178
+ </div>
179
+ </div>
180
+
181
+ <div id="method-M000014" class="method-detail">
182
+ <a name="M000014"></a>
183
+
184
+ <div class="method-heading">
185
+ <a href="#M000014" class="method-signature">
186
+ <span class="method-name">add_expr_literal</span><span class="method-args">(src, code)</span>
187
+ </a>
188
+ </div>
189
+
190
+ <div class="method-description">
191
+ <p>
192
+ (abstract) add expression literal code to src. this is called by
193
+ add_expr().
194
+ </p>
195
+ <p><a class="source-toggle" href="#"
196
+ onclick="toggleCode('M000014-source');return false;">[Source]</a></p>
197
+ <div class="method-source-code" id="M000014-source">
198
+ <pre>
199
+ <span class="ruby-comment cmt"># File erubis/generator.rb, line 60</span>
200
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_expr_literal</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>)
201
+ <span class="ruby-identifier">not_implemented</span>
202
+ <span class="ruby-keyword kw">end</span>
203
+ </pre>
204
+ </div>
205
+ </div>
206
+ </div>
207
+
208
+ <div id="method-M000017" class="method-detail">
209
+ <a name="M000017"></a>
210
+
211
+ <div class="method-heading">
212
+ <a href="#M000017" class="method-signature">
213
+ <span class="method-name">add_postamble</span><span class="method-args">(src)</span>
214
+ </a>
215
+ </div>
216
+
217
+ <div class="method-description">
218
+ <p>
219
+ (abstract) add @postamble to src
220
+ </p>
221
+ <p><a class="source-toggle" href="#"
222
+ onclick="toggleCode('M000017-source');return false;">[Source]</a></p>
223
+ <div class="method-source-code" id="M000017-source">
224
+ <pre>
225
+ <span class="ruby-comment cmt"># File erubis/generator.rb, line 75</span>
226
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_postamble</span>(<span class="ruby-identifier">src</span>)
227
+ <span class="ruby-identifier">not_implemented</span>
228
+ <span class="ruby-keyword kw">end</span>
229
+ </pre>
230
+ </div>
231
+ </div>
232
+ </div>
233
+
234
+ <div id="method-M000011" class="method-detail">
235
+ <a name="M000011"></a>
236
+
237
+ <div class="method-heading">
238
+ <a href="#M000011" class="method-signature">
239
+ <span class="method-name">add_preamble</span><span class="method-args">(src)</span>
240
+ </a>
241
+ </div>
242
+
243
+ <div class="method-description">
244
+ <p>
245
+ (abstract) add @preamble to src
246
+ </p>
247
+ <p><a class="source-toggle" href="#"
248
+ onclick="toggleCode('M000011-source');return false;">[Source]</a></p>
249
+ <div class="method-source-code" id="M000011-source">
250
+ <pre>
251
+ <span class="ruby-comment cmt"># File erubis/generator.rb, line 45</span>
252
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_preamble</span>(<span class="ruby-identifier">src</span>)
253
+ <span class="ruby-identifier">not_implemented</span>
254
+ <span class="ruby-keyword kw">end</span>
255
+ </pre>
256
+ </div>
257
+ </div>
258
+ </div>
259
+
260
+ <div id="method-M000013" class="method-detail">
261
+ <a name="M000013"></a>
262
+
263
+ <div class="method-heading">
264
+ <a href="#M000013" class="method-signature">
265
+ <span class="method-name">add_stmt</span><span class="method-args">(src, code)</span>
266
+ </a>
267
+ </div>
268
+
269
+ <div class="method-description">
270
+ <p>
271
+ (abstract) add statement code to src
272
+ </p>
273
+ <p><a class="source-toggle" href="#"
274
+ onclick="toggleCode('M000013-source');return false;">[Source]</a></p>
275
+ <div class="method-source-code" id="M000013-source">
276
+ <pre>
277
+ <span class="ruby-comment cmt"># File erubis/generator.rb, line 55</span>
278
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_stmt</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>)
279
+ <span class="ruby-identifier">not_implemented</span>
280
+ <span class="ruby-keyword kw">end</span>
281
+ </pre>
282
+ </div>
283
+ </div>
284
+ </div>
285
+
286
+ <div id="method-M000012" class="method-detail">
287
+ <a name="M000012"></a>
288
+
289
+ <div class="method-heading">
290
+ <a href="#M000012" class="method-signature">
291
+ <span class="method-name">add_text</span><span class="method-args">(src, text)</span>
292
+ </a>
293
+ </div>
294
+
295
+ <div class="method-description">
296
+ <p>
297
+ (abstract) add text string to src
298
+ </p>
299
+ <p><a class="source-toggle" href="#"
300
+ onclick="toggleCode('M000012-source');return false;">[Source]</a></p>
301
+ <div class="method-source-code" id="M000012-source">
302
+ <pre>
303
+ <span class="ruby-comment cmt"># File erubis/generator.rb, line 50</span>
304
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_text</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">text</span>)
305
+ <span class="ruby-identifier">not_implemented</span>
306
+ <span class="ruby-keyword kw">end</span>
307
+ </pre>
308
+ </div>
309
+ </div>
310
+ </div>
311
+
312
+ <div id="method-M000009" class="method-detail">
313
+ <a name="M000009"></a>
314
+
315
+ <div class="method-heading">
316
+ <a href="#M000009" class="method-signature">
317
+ <span class="method-name">escape_text</span><span class="method-args">(text)</span>
318
+ </a>
319
+ </div>
320
+
321
+ <div class="method-description">
322
+ <p>
323
+ (abstract) escape text string
324
+ </p>
325
+ <p>
326
+ ex.
327
+ </p>
328
+ <pre>
329
+ def escape_text(text)
330
+ return text.dump
331
+ # or return &quot;'&quot; + text.gsub(/['\\]/, '\\\\\&amp;') + &quot;'&quot;
332
+ end
333
+ </pre>
334
+ <p><a class="source-toggle" href="#"
335
+ onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
336
+ <div class="method-source-code" id="M000009-source">
337
+ <pre>
338
+ <span class="ruby-comment cmt"># File erubis/generator.rb, line 34</span>
339
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escape_text</span>(<span class="ruby-identifier">text</span>)
340
+ <span class="ruby-identifier">not_implemented</span>
341
+ <span class="ruby-keyword kw">end</span>
342
+ </pre>
343
+ </div>
344
+ </div>
345
+ </div>
346
+
347
+ <div id="method-M000010" class="method-detail">
348
+ <a name="M000010"></a>
349
+
350
+ <div class="method-heading">
351
+ <a href="#M000010" class="method-signature">
352
+ <span class="method-name">escaped_expr</span><span class="method-args">(code)</span>
353
+ </a>
354
+ </div>
355
+
356
+ <div class="method-description">
357
+ <p>
358
+ return escaped expression code (ex. &#8216;h(&#8230;)&#8217; or
359
+ &#8216;htmlspecialchars(&#8230;)&#8217;)
360
+ </p>
361
+ <p><a class="source-toggle" href="#"
362
+ onclick="toggleCode('M000010-source');return false;">[Source]</a></p>
363
+ <div class="method-source-code" id="M000010-source">
364
+ <pre>
365
+ <span class="ruby-comment cmt"># File erubis/generator.rb, line 39</span>
366
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escaped_expr</span>(<span class="ruby-identifier">code</span>)
367
+ <span class="ruby-identifier">code</span>.<span class="ruby-identifier">strip!</span>
368
+ <span class="ruby-keyword kw">return</span> <span class="ruby-node">&quot;#{@escapefunc}(#{code})&quot;</span>
369
+ <span class="ruby-keyword kw">end</span>
370
+ </pre>
371
+ </div>
372
+ </div>
373
+ </div>
374
+
375
+ <div id="method-M000008" class="method-detail">
376
+ <a name="M000008"></a>
377
+
378
+ <div class="method-heading">
379
+ <a href="#M000008" class="method-signature">
380
+ <span class="method-name">init_generator</span><span class="method-args">(properties={})</span>
381
+ </a>
382
+ </div>
383
+
384
+ <div class="method-description">
385
+ <p><a class="source-toggle" href="#"
386
+ onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
387
+ <div class="method-source-code" id="M000008-source">
388
+ <pre>
389
+ <span class="ruby-comment cmt"># File erubis/generator.rb, line 22</span>
390
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">init_generator</span>(<span class="ruby-identifier">properties</span>={})
391
+ <span class="ruby-ivar">@escapefunc</span> = <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:escapefunc</span>]
392
+ <span class="ruby-keyword kw">end</span>
393
+ </pre>
394
+ </div>
395
+ </div>
396
+ </div>
397
+
398
+
399
+ </div>
400
+
401
+
402
+ </div>
403
+
404
+
405
+ <div id="validator-badges">
406
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
407
+ </div>
408
+
409
+ </body>
410
+ </html>