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
@@ -65,8 +65,8 @@
65
65
  <tr class="top-aligned-row">
66
66
  <td><strong>Parent:</strong></td>
67
67
  <td>
68
- <a href="Engine.html">
69
- Engine
68
+ <a href="Basic/Engine.html">
69
+ Basic::Engine
70
70
  </a>
71
71
  </td>
72
72
  </tr>
@@ -90,279 +90,29 @@ engine for Perl
90
90
 
91
91
  </div>
92
92
 
93
- <div id="method-list">
94
- <h3 class="section-bar">Methods</h3>
95
-
96
- <div class="name-list">
97
- <a href="#M000099">add_expr_debug</a>&nbsp;&nbsp;
98
- <a href="#M000098">add_expr_escaped</a>&nbsp;&nbsp;
99
- <a href="#M000097">add_expr_literal</a>&nbsp;&nbsp;
100
- <a href="#M000101">add_postamble</a>&nbsp;&nbsp;
101
- <a href="#M000093">add_preamble</a>&nbsp;&nbsp;
102
- <a href="#M000100">add_stmt</a>&nbsp;&nbsp;
103
- <a href="#M000095">add_text</a>&nbsp;&nbsp;
104
- <a href="#M000094">escape_text</a>&nbsp;&nbsp;
105
- <a href="#M000096">escaped_expr</a>&nbsp;&nbsp;
106
- <a href="#M000092">new</a>&nbsp;&nbsp;
107
- </div>
108
- </div>
109
93
 
110
94
  </div>
111
95
 
112
96
 
113
97
  <!-- if includes -->
98
+ <div id="includes">
99
+ <h3 class="section-bar">Included Modules</h3>
114
100
 
115
- <div id="section">
116
-
117
-
118
-
119
-
120
-
121
-
122
-
123
-
124
- <!-- if method_list -->
125
- <div id="methods">
126
- <h3 class="section-bar">Public Class methods</h3>
127
-
128
- <div id="method-M000092" class="method-detail">
129
- <a name="M000092"></a>
130
-
131
- <div class="method-heading">
132
- <a href="#M000092" class="method-signature">
133
- <span class="method-name">new</span><span class="method-args">(input, properties={})</span>
134
- </a>
135
- </div>
136
-
137
- <div class="method-description">
138
- <p><a class="source-toggle" href="#"
139
- onclick="toggleCode('M000092-source');return false;">[Source]</a></p>
140
- <div class="method-source-code" id="M000092-source">
141
- <pre>
142
- <span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line 25</span>
143
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">input</span>, <span class="ruby-identifier">properties</span>={})
144
- <span class="ruby-ivar">@func</span> = <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:func</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">'print'</span>
145
- <span class="ruby-keyword kw">super</span>
146
- <span class="ruby-keyword kw">end</span>
147
- </pre>
148
- </div>
149
- </div>
150
- </div>
151
-
152
- <h3 class="section-bar">Public Instance methods</h3>
153
-
154
- <div id="method-M000099" class="method-detail">
155
- <a name="M000099"></a>
156
-
157
- <div class="method-heading">
158
- <a href="#M000099" class="method-signature">
159
- <span class="method-name">add_expr_debug</span><span class="method-args">(src, code)</span>
160
- </a>
161
- </div>
162
-
163
- <div class="method-description">
164
- <p><a class="source-toggle" href="#"
165
- onclick="toggleCode('M000099-source');return false;">[Source]</a></p>
166
- <div class="method-source-code" id="M000099-source">
167
- <pre>
168
- <span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line 55</span>
169
- <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>)
170
- <span class="ruby-identifier">code</span>.<span class="ruby-identifier">strip!</span>
171
- <span class="ruby-identifier">s</span> = <span class="ruby-identifier">code</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/\'/</span>, <span class="ruby-value str">&quot;\\'&quot;</span>)
172
- <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@func</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;('*** debug: #{code}=', #{code}, \&quot;\\n\&quot;);&quot;</span>
173
- <span class="ruby-keyword kw">end</span>
174
- </pre>
175
- </div>
176
- </div>
177
- </div>
178
-
179
- <div id="method-M000098" class="method-detail">
180
- <a name="M000098"></a>
181
-
182
- <div class="method-heading">
183
- <a href="#M000098" class="method-signature">
184
- <span class="method-name">add_expr_escaped</span><span class="method-args">(src, code)</span>
185
- </a>
186
- </div>
187
-
188
- <div class="method-description">
189
- <p><a class="source-toggle" href="#"
190
- onclick="toggleCode('M000098-source');return false;">[Source]</a></p>
191
- <div class="method-source-code" id="M000098-source">
192
- <pre>
193
- <span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line 51</span>
194
- <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>)
195
- <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@func</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;(&quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">escaped_expr</span>(<span class="ruby-identifier">code</span>) <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;); &quot;</span>
196
- <span class="ruby-keyword kw">end</span>
197
- </pre>
198
- </div>
199
- </div>
200
- </div>
201
-
202
- <div id="method-M000097" class="method-detail">
203
- <a name="M000097"></a>
204
-
205
- <div class="method-heading">
206
- <a href="#M000097" class="method-signature">
207
- <span class="method-name">add_expr_literal</span><span class="method-args">(src, code)</span>
208
- </a>
209
- </div>
210
-
211
- <div class="method-description">
212
- <p><a class="source-toggle" href="#"
213
- onclick="toggleCode('M000097-source');return false;">[Source]</a></p>
214
- <div class="method-source-code" id="M000097-source">
215
- <pre>
216
- <span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line 47</span>
217
- <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>)
218
- <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@func</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;(&quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">code</span>.<span class="ruby-identifier">strip</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;); &quot;</span>
219
- <span class="ruby-keyword kw">end</span>
220
- </pre>
221
- </div>
222
- </div>
223
- </div>
224
-
225
- <div id="method-M000101" class="method-detail">
226
- <a name="M000101"></a>
227
-
228
- <div class="method-heading">
229
- <a href="#M000101" class="method-signature">
230
- <span class="method-name">add_postamble</span><span class="method-args">(src)</span>
231
- </a>
232
- </div>
233
-
234
- <div class="method-description">
235
- <p><a class="source-toggle" href="#"
236
- onclick="toggleCode('M000101-source');return false;">[Source]</a></p>
237
- <div class="method-source-code" id="M000101-source">
238
- <pre>
239
- <span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line 65</span>
240
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_postamble</span>(<span class="ruby-identifier">src</span>)
241
- <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;\n&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">src</span>[<span class="ruby-value">-1</span>] <span class="ruby-operator">==</span> <span class="ruby-value">?\n</span>
242
- <span class="ruby-keyword kw">end</span>
243
- </pre>
244
- </div>
245
- </div>
246
- </div>
247
-
248
- <div id="method-M000093" class="method-detail">
249
- <a name="M000093"></a>
250
-
251
- <div class="method-heading">
252
- <a href="#M000093" class="method-signature">
253
- <span class="method-name">add_preamble</span><span class="method-args">(src)</span>
254
- </a>
255
- </div>
256
-
257
- <div class="method-description">
258
- <p><a class="source-toggle" href="#"
259
- onclick="toggleCode('M000093-source');return false;">[Source]</a></p>
260
- <div class="method-source-code" id="M000093-source">
261
- <pre>
262
- <span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line 30</span>
263
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_preamble</span>(<span class="ruby-identifier">src</span>)
264
- <span class="ruby-comment cmt"># empty</span>
265
- <span class="ruby-keyword kw">end</span>
266
- </pre>
267
- </div>
268
- </div>
269
- </div>
270
-
271
- <div id="method-M000100" class="method-detail">
272
- <a name="M000100"></a>
273
-
274
- <div class="method-heading">
275
- <a href="#M000100" class="method-signature">
276
- <span class="method-name">add_stmt</span><span class="method-args">(src, code)</span>
277
- </a>
278
- </div>
279
-
280
- <div class="method-description">
281
- <p><a class="source-toggle" href="#"
282
- onclick="toggleCode('M000100-source');return false;">[Source]</a></p>
283
- <div class="method-source-code" id="M000100-source">
284
- <pre>
285
- <span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line 61</span>
286
- <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>)
287
- <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">code</span>
288
- <span class="ruby-keyword kw">end</span>
289
- </pre>
290
- </div>
291
- </div>
101
+ <div id="includes-list">
102
+ <span class="include-name"><a href="PerlGenerator.html">PerlGenerator</a></span>
292
103
  </div>
104
+ </div>
293
105
 
294
- <div id="method-M000095" class="method-detail">
295
- <a name="M000095"></a>
106
+ <div id="section">
296
107
 
297
- <div class="method-heading">
298
- <a href="#M000095" class="method-signature">
299
- <span class="method-name">add_text</span><span class="method-args">(src, text)</span>
300
- </a>
301
- </div>
302
-
303
- <div class="method-description">
304
- <p><a class="source-toggle" href="#"
305
- onclick="toggleCode('M000095-source');return false;">[Source]</a></p>
306
- <div class="method-source-code" id="M000095-source">
307
- <pre>
308
- <span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line 38</span>
309
- <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>)
310
- <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@func</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;('&quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">escape_text</span>(<span class="ruby-identifier">text</span>) <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;'); &quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">empty?</span>
311
- <span class="ruby-keyword kw">end</span>
312
- </pre>
313
- </div>
314
- </div>
315
- </div>
316
108
 
317
- <div id="method-M000094" class="method-detail">
318
- <a name="M000094"></a>
319
109
 
320
- <div class="method-heading">
321
- <a href="#M000094" class="method-signature">
322
- <span class="method-name">escape_text</span><span class="method-args">(text)</span>
323
- </a>
324
- </div>
325
-
326
- <div class="method-description">
327
- <p><a class="source-toggle" href="#"
328
- onclick="toggleCode('M000094-source');return false;">[Source]</a></p>
329
- <div class="method-source-code" id="M000094-source">
330
- <pre>
331
- <span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line 34</span>
332
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escape_text</span>(<span class="ruby-identifier">text</span>)
333
- <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/['\\]/</span>, <span class="ruby-value str">'\\\\\&amp;'</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">text</span>
334
- <span class="ruby-keyword kw">end</span>
335
- </pre>
336
- </div>
337
- </div>
338
- </div>
339
110
 
340
- <div id="method-M000096" class="method-detail">
341
- <a name="M000096"></a>
342
111
 
343
- <div class="method-heading">
344
- <a href="#M000096" class="method-signature">
345
- <span class="method-name">escaped_expr</span><span class="method-args">(code)</span>
346
- </a>
347
- </div>
348
112
 
349
- <div class="method-description">
350
- <p><a class="source-toggle" href="#"
351
- onclick="toggleCode('M000096-source');return false;">[Source]</a></p>
352
- <div class="method-source-code" id="M000096-source">
353
- <pre>
354
- <span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line 42</span>
355
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escaped_expr</span>(<span class="ruby-identifier">code</span>)
356
- <span class="ruby-ivar">@escape</span> <span class="ruby-operator">||=</span> <span class="ruby-value str">'escape'</span>
357
- <span class="ruby-keyword kw">return</span> <span class="ruby-node">&quot;escape(#{code.strip})&quot;</span>
358
- <span class="ruby-keyword kw">end</span>
359
- </pre>
360
- </div>
361
- </div>
362
- </div>
363
113
 
364
114
 
365
- </div>
115
+ <!-- if method_list -->
366
116
 
367
117
 
368
118
  </div>
@@ -65,8 +65,8 @@
65
65
  <tr class="top-aligned-row">
66
66
  <td><strong>Parent:</strong></td>
67
67
  <td>
68
- <a href="Engine.html">
69
- Engine
68
+ <a href="Basic/Engine.html">
69
+ Basic::Engine
70
70
  </a>
71
71
  </td>
72
72
  </tr>
@@ -90,259 +90,29 @@ engine for PHP
90
90
 
91
91
  </div>
92
92
 
93
- <div id="method-list">
94
- <h3 class="section-bar">Methods</h3>
95
-
96
- <div class="name-list">
97
- <a href="#M000055">add_expr_debug</a>&nbsp;&nbsp;
98
- <a href="#M000054">add_expr_escaped</a>&nbsp;&nbsp;
99
- <a href="#M000053">add_expr_literal</a>&nbsp;&nbsp;
100
- <a href="#M000057">add_postamble</a>&nbsp;&nbsp;
101
- <a href="#M000049">add_preamble</a>&nbsp;&nbsp;
102
- <a href="#M000056">add_stmt</a>&nbsp;&nbsp;
103
- <a href="#M000051">add_text</a>&nbsp;&nbsp;
104
- <a href="#M000050">escape_text</a>&nbsp;&nbsp;
105
- <a href="#M000052">escaped_expr</a>&nbsp;&nbsp;
106
- </div>
107
- </div>
108
93
 
109
94
  </div>
110
95
 
111
96
 
112
97
  <!-- if includes -->
98
+ <div id="includes">
99
+ <h3 class="section-bar">Included Modules</h3>
113
100
 
114
- <div id="section">
115
-
116
-
117
-
118
-
119
-
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-M000055" class="method-detail">
128
- <a name="M000055"></a>
129
-
130
- <div class="method-heading">
131
- <a href="#M000055" 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><a class="source-toggle" href="#"
138
- onclick="toggleCode('M000055-source');return false;">[Source]</a></p>
139
- <div class="method-source-code" id="M000055-source">
140
- <pre>
141
- <span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line 48</span>
142
- <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>)
143
- <span class="ruby-identifier">code</span>.<span class="ruby-identifier">strip!</span>
144
- <span class="ruby-identifier">s</span> = <span class="ruby-identifier">code</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/\'/</span>, <span class="ruby-value str">&quot;\\'&quot;</span>)
145
- <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;&lt;?php error_log('*** debug: #{s}='.(#{code}), 0); ?&gt;&quot;</span>
146
- <span class="ruby-keyword kw">end</span>
147
- </pre>
148
- </div>
149
- </div>
150
- </div>
151
-
152
- <div id="method-M000054" class="method-detail">
153
- <a name="M000054"></a>
154
-
155
- <div class="method-heading">
156
- <a href="#M000054" class="method-signature">
157
- <span class="method-name">add_expr_escaped</span><span class="method-args">(src, code)</span>
158
- </a>
159
- </div>
160
-
161
- <div class="method-description">
162
- <p><a class="source-toggle" href="#"
163
- onclick="toggleCode('M000054-source');return false;">[Source]</a></p>
164
- <div class="method-source-code" id="M000054-source">
165
- <pre>
166
- <span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line 44</span>
167
- <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>)
168
- <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;&lt;?php echo #{escaped_expr(code)}; ?&gt;&quot;</span>
169
- <span class="ruby-keyword kw">end</span>
170
- </pre>
171
- </div>
172
- </div>
173
- </div>
174
-
175
- <div id="method-M000053" class="method-detail">
176
- <a name="M000053"></a>
177
-
178
- <div class="method-heading">
179
- <a href="#M000053" class="method-signature">
180
- <span class="method-name">add_expr_literal</span><span class="method-args">(src, code)</span>
181
- </a>
182
- </div>
183
-
184
- <div class="method-description">
185
- <p><a class="source-toggle" href="#"
186
- onclick="toggleCode('M000053-source');return false;">[Source]</a></p>
187
- <div class="method-source-code" id="M000053-source">
188
- <pre>
189
- <span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line 40</span>
190
- <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>)
191
- <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;&lt;?php echo #{code.strip}; ?&gt;&quot;</span>
192
- <span class="ruby-keyword kw">end</span>
193
- </pre>
194
- </div>
195
- </div>
196
- </div>
197
-
198
- <div id="method-M000057" class="method-detail">
199
- <a name="M000057"></a>
200
-
201
- <div class="method-heading">
202
- <a href="#M000057" class="method-signature">
203
- <span class="method-name">add_postamble</span><span class="method-args">(src)</span>
204
- </a>
205
- </div>
206
-
207
- <div class="method-description">
208
- <p><a class="source-toggle" href="#"
209
- onclick="toggleCode('M000057-source');return false;">[Source]</a></p>
210
- <div class="method-source-code" id="M000057-source">
211
- <pre>
212
- <span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line 65</span>
213
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_postamble</span>(<span class="ruby-identifier">src</span>)
214
- <span class="ruby-comment cmt"># empty</span>
215
- <span class="ruby-keyword kw">end</span>
216
- </pre>
217
- </div>
218
- </div>
219
- </div>
220
-
221
- <div id="method-M000049" class="method-detail">
222
- <a name="M000049"></a>
223
-
224
- <div class="method-heading">
225
- <a href="#M000049" class="method-signature">
226
- <span class="method-name">add_preamble</span><span class="method-args">(src)</span>
227
- </a>
228
- </div>
229
-
230
- <div class="method-description">
231
- <p><a class="source-toggle" href="#"
232
- onclick="toggleCode('M000049-source');return false;">[Source]</a></p>
233
- <div class="method-source-code" id="M000049-source">
234
- <pre>
235
- <span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line 23</span>
236
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_preamble</span>(<span class="ruby-identifier">src</span>)
237
- <span class="ruby-comment cmt"># empty</span>
238
- <span class="ruby-keyword kw">end</span>
239
- </pre>
240
- </div>
241
- </div>
242
- </div>
243
-
244
- <div id="method-M000056" class="method-detail">
245
- <a name="M000056"></a>
246
-
247
- <div class="method-heading">
248
- <a href="#M000056" class="method-signature">
249
- <span class="method-name">add_stmt</span><span class="method-args">(src, code)</span>
250
- </a>
251
- </div>
252
-
253
- <div class="method-description">
254
- <p><a class="source-toggle" href="#"
255
- onclick="toggleCode('M000056-source');return false;">[Source]</a></p>
256
- <div class="method-source-code" id="M000056-source">
257
- <pre>
258
- <span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line 54</span>
259
- <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>)
260
- <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;&lt;?php&quot;</span>
261
- <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot; &quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">code</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">!=</span> <span class="ruby-value">?\ </span><span class="ruby-comment cmt">#</span>
262
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">code</span>[<span class="ruby-value">-1</span>] <span class="ruby-operator">==</span> <span class="ruby-value">?\n</span>
263
- <span class="ruby-identifier">code</span>.<span class="ruby-identifier">chomp!</span>
264
- <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">code</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;?&gt;\n&quot;</span>
265
- <span class="ruby-keyword kw">else</span>
266
- <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">code</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;?&gt;&quot;</span>
267
- <span class="ruby-keyword kw">end</span>
268
- <span class="ruby-keyword kw">end</span>
269
- </pre>
270
- </div>
271
- </div>
101
+ <div id="includes-list">
102
+ <span class="include-name"><a href="PhpGenerator.html">PhpGenerator</a></span>
272
103
  </div>
104
+ </div>
273
105
 
274
- <div id="method-M000051" class="method-detail">
275
- <a name="M000051"></a>
106
+ <div id="section">
276
107
 
277
- <div class="method-heading">
278
- <a href="#M000051" class="method-signature">
279
- <span class="method-name">add_text</span><span class="method-args">(src, text)</span>
280
- </a>
281
- </div>
282
-
283
- <div class="method-description">
284
- <p><a class="source-toggle" href="#"
285
- onclick="toggleCode('M000051-source');return false;">[Source]</a></p>
286
- <div class="method-source-code" id="M000051-source">
287
- <pre>
288
- <span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line 31</span>
289
- <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>)
290
- <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">escape_text</span>(<span class="ruby-identifier">text</span>)
291
- <span class="ruby-keyword kw">end</span>
292
- </pre>
293
- </div>
294
- </div>
295
- </div>
296
108
 
297
- <div id="method-M000050" class="method-detail">
298
- <a name="M000050"></a>
299
109
 
300
- <div class="method-heading">
301
- <a href="#M000050" class="method-signature">
302
- <span class="method-name">escape_text</span><span class="method-args">(text)</span>
303
- </a>
304
- </div>
305
-
306
- <div class="method-description">
307
- <p><a class="source-toggle" href="#"
308
- onclick="toggleCode('M000050-source');return false;">[Source]</a></p>
309
- <div class="method-source-code" id="M000050-source">
310
- <pre>
311
- <span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line 27</span>
312
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escape_text</span>(<span class="ruby-identifier">text</span>)
313
- <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/&lt;\?xml\b/</span>, <span class="ruby-value str">'&lt;&lt;?php ?&gt;?xml'</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">text</span>
314
- <span class="ruby-keyword kw">end</span>
315
- </pre>
316
- </div>
317
- </div>
318
- </div>
319
110
 
320
- <div id="method-M000052" class="method-detail">
321
- <a name="M000052"></a>
322
111
 
323
- <div class="method-heading">
324
- <a href="#M000052" class="method-signature">
325
- <span class="method-name">escaped_expr</span><span class="method-args">(code)</span>
326
- </a>
327
- </div>
328
112
 
329
- <div class="method-description">
330
- <p><a class="source-toggle" href="#"
331
- onclick="toggleCode('M000052-source');return false;">[Source]</a></p>
332
- <div class="method-source-code" id="M000052-source">
333
- <pre>
334
- <span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line 35</span>
335
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escaped_expr</span>(<span class="ruby-identifier">code</span>)
336
- <span class="ruby-ivar">@escape</span> <span class="ruby-operator">||=</span> <span class="ruby-value str">'htmlspecialchars'</span>
337
- <span class="ruby-keyword kw">return</span> <span class="ruby-node">&quot;#{@escape}(#{code.strip})&quot;</span>
338
- <span class="ruby-keyword kw">end</span>
339
- </pre>
340
- </div>
341
- </div>
342
- </div>
343
113
 
344
114
 
345
- </div>
115
+ <!-- if method_list -->
346
116
 
347
117
 
348
118
  </div>