erubis 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +1 -1
- data/README.txt +1 -1
- data/benchmark/erubybench.rb +1 -1
- data/bin/erubis +1 -1
- data/contrib/erubis +72 -67
- data/contrib/inline-require +1 -1
- data/doc-api/classes/Erubis.html +1 -1
- data/doc-api/classes/Erubis/Context.html +25 -25
- data/doc-api/classes/Erubis/Ec.html +61 -60
- data/doc-api/classes/Erubis/Ejava.html +85 -60
- data/doc-api/classes/Erubis/Ejavascript.html +74 -49
- data/doc-api/classes/Erubis/Engine.html +151 -136
- data/doc-api/classes/Erubis/Eperl.html +87 -61
- data/doc-api/classes/Erubis/Ephp.html +97 -49
- data/doc-api/classes/Erubis/Eruby.html +42 -42
- data/doc-api/classes/Erubis/Escheme.html +60 -60
- data/doc-api/classes/Erubis/Main.html +18 -18
- data/doc-api/classes/Erubis/OptimizedEruby.html +72 -72
- data/doc-api/classes/Erubis/OptimizedXmlEruby.html +6 -6
- data/doc-api/classes/Erubis/TinyEruby.html +30 -30
- data/doc-api/created.rid +1 -1
- data/doc-api/files/__/README_txt.html +1 -1
- data/doc-api/files/erubis/engine/ec_rb.html +2 -2
- data/doc-api/files/erubis/engine/ejava_rb.html +2 -2
- data/doc-api/files/erubis/engine/ejavascript_rb.html +2 -2
- data/doc-api/files/erubis/engine/enhanced_rb.html +1 -1
- data/doc-api/files/erubis/engine/eperl_rb.html +2 -2
- data/doc-api/files/erubis/engine/ephp_rb.html +2 -2
- data/doc-api/files/erubis/engine/eruby_rb.html +1 -1
- data/doc-api/files/erubis/engine/escheme_rb.html +1 -1
- data/doc-api/files/erubis/engine/optimized_rb.html +2 -2
- data/doc-api/files/erubis/engine_rb.html +2 -2
- data/doc-api/files/erubis/enhancer_rb.html +1 -1
- data/doc-api/files/erubis/helper_rb.html +1 -1
- data/doc-api/files/erubis/local-setting_rb.html +1 -1
- data/doc-api/files/erubis/main_rb.html +1 -1
- data/doc-api/files/erubis/tiny_rb.html +1 -1
- data/doc-api/files/erubis_rb.html +1 -1
- data/doc-api/fr_method_index.html +110 -105
- data/lib/erubis.rb +1 -1
- data/lib/erubis/engine.rb +30 -19
- data/lib/erubis/engine/ec.rb +3 -2
- data/lib/erubis/engine/ejava.rb +6 -8
- data/lib/erubis/engine/ejavascript.rb +6 -8
- data/lib/erubis/engine/enhanced.rb +1 -1
- data/lib/erubis/engine/eperl.rb +7 -8
- data/lib/erubis/engine/ephp.rb +8 -10
- data/lib/erubis/engine/eruby.rb +1 -1
- data/lib/erubis/engine/escheme.rb +1 -1
- data/lib/erubis/engine/optimized.rb +1 -1
- data/lib/erubis/enhancer.rb +1 -1
- data/lib/erubis/helper.rb +1 -1
- data/lib/erubis/local-setting.rb +1 -1
- data/lib/erubis/main.rb +2 -2
- data/lib/erubis/tiny.rb +1 -1
- data/test/assert-text-equal.rb +1 -1
- data/test/test-bin.rb +2 -2
- data/test/test-engines.rb +1 -1
- data/test/test-erubis.rb +1 -1
- data/test/test.rb +1 -1
- data/test/testutil.rb +1 -1
- metadata +2 -2
@@ -94,15 +94,16 @@ engine for JavaScript
|
|
94
94
|
<h3 class="section-bar">Methods</h3>
|
95
95
|
|
96
96
|
<div class="name-list">
|
97
|
-
<a href="#
|
98
|
-
<a href="#
|
99
|
-
<a href="#
|
100
|
-
<a href="#
|
101
|
-
<a href="#
|
97
|
+
<a href="#M000037">add_expr_debug</a>
|
98
|
+
<a href="#M000036">add_expr_escaped</a>
|
99
|
+
<a href="#M000035">add_expr_literal</a>
|
100
|
+
<a href="#M000032">add_indent</a>
|
101
|
+
<a href="#M000038">add_postamble</a>
|
102
102
|
<a href="#M000029">add_preamble</a>
|
103
|
-
<a href="#
|
104
|
-
<a href="#
|
103
|
+
<a href="#M000034">add_stmt</a>
|
104
|
+
<a href="#M000033">add_text</a>
|
105
105
|
<a href="#M000030">escape_text</a>
|
106
|
+
<a href="#M000031">escaped_expr</a>
|
106
107
|
<a href="#M000028">new</a>
|
107
108
|
</div>
|
108
109
|
</div>
|
@@ -153,21 +154,21 @@ engine for JavaScript
|
|
153
154
|
|
154
155
|
<h3 class="section-bar">Public Instance methods</h3>
|
155
156
|
|
156
|
-
<div id="method-
|
157
|
-
<a name="
|
157
|
+
<div id="method-M000037" class="method-detail">
|
158
|
+
<a name="M000037"></a>
|
158
159
|
|
159
160
|
<div class="method-heading">
|
160
|
-
<a href="#
|
161
|
+
<a href="#M000037" class="method-signature">
|
161
162
|
<span class="method-name">add_expr_debug</span><span class="method-args">(src, code)</span>
|
162
163
|
</a>
|
163
164
|
</div>
|
164
165
|
|
165
166
|
<div class="method-description">
|
166
167
|
<p><a class="source-toggle" href="#"
|
167
|
-
onclick="toggleCode('
|
168
|
-
<div class="method-source-code" id="
|
168
|
+
onclick="toggleCode('M000037-source');return false;">[Source]</a></p>
|
169
|
+
<div class="method-source-code" id="M000037-source">
|
169
170
|
<pre>
|
170
|
-
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line
|
171
|
+
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line 78</span>
|
171
172
|
<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>)
|
172
173
|
<span class="ruby-identifier">add_indent</span>(<span class="ruby-identifier">src</span>, <span class="ruby-ivar">@indent</span>)
|
173
174
|
<span class="ruby-identifier">code</span>.<span class="ruby-identifier">strip!</span>
|
@@ -178,21 +179,21 @@ engine for JavaScript
|
|
178
179
|
</div>
|
179
180
|
</div>
|
180
181
|
|
181
|
-
<div id="method-
|
182
|
-
<a name="
|
182
|
+
<div id="method-M000036" class="method-detail">
|
183
|
+
<a name="M000036"></a>
|
183
184
|
|
184
185
|
<div class="method-heading">
|
185
|
-
<a href="#
|
186
|
+
<a href="#M000036" class="method-signature">
|
186
187
|
<span class="method-name">add_expr_escaped</span><span class="method-args">(src, code)</span>
|
187
188
|
</a>
|
188
189
|
</div>
|
189
190
|
|
190
191
|
<div class="method-description">
|
191
192
|
<p><a class="source-toggle" href="#"
|
192
|
-
onclick="toggleCode('
|
193
|
-
<div class="method-source-code" id="
|
193
|
+
onclick="toggleCode('M000036-source');return false;">[Source]</a></p>
|
194
|
+
<div class="method-source-code" id="M000036-source">
|
194
195
|
<pre>
|
195
|
-
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line
|
196
|
+
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line 73</span>
|
196
197
|
<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>)
|
197
198
|
<span class="ruby-identifier">add_indent</span>(<span class="ruby-identifier">src</span>, <span class="ruby-ivar">@indent</span>)
|
198
199
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@buf</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">'.push('</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">escaped_expr</span>(<span class="ruby-identifier">code</span>) <span class="ruby-operator"><<</span> <span class="ruby-value str">');'</span>
|
@@ -202,21 +203,21 @@ engine for JavaScript
|
|
202
203
|
</div>
|
203
204
|
</div>
|
204
205
|
|
205
|
-
<div id="method-
|
206
|
-
<a name="
|
206
|
+
<div id="method-M000035" class="method-detail">
|
207
|
+
<a name="M000035"></a>
|
207
208
|
|
208
209
|
<div class="method-heading">
|
209
|
-
<a href="#
|
210
|
+
<a href="#M000035" class="method-signature">
|
210
211
|
<span class="method-name">add_expr_literal</span><span class="method-args">(src, code)</span>
|
211
212
|
</a>
|
212
213
|
</div>
|
213
214
|
|
214
215
|
<div class="method-description">
|
215
216
|
<p><a class="source-toggle" href="#"
|
216
|
-
onclick="toggleCode('
|
217
|
-
<div class="method-source-code" id="
|
217
|
+
onclick="toggleCode('M000035-source');return false;">[Source]</a></p>
|
218
|
+
<div class="method-source-code" id="M000035-source">
|
218
219
|
<pre>
|
219
|
-
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line
|
220
|
+
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line 68</span>
|
220
221
|
<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>)
|
221
222
|
<span class="ruby-identifier">add_indent</span>(<span class="ruby-identifier">src</span>, <span class="ruby-ivar">@indent</span>)
|
222
223
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@buf</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">'.push('</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">code</span>.<span class="ruby-identifier">strip</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">');'</span>
|
@@ -226,21 +227,21 @@ engine for JavaScript
|
|
226
227
|
</div>
|
227
228
|
</div>
|
228
229
|
|
229
|
-
<div id="method-
|
230
|
-
<a name="
|
230
|
+
<div id="method-M000032" class="method-detail">
|
231
|
+
<a name="M000032"></a>
|
231
232
|
|
232
233
|
<div class="method-heading">
|
233
|
-
<a href="#
|
234
|
+
<a href="#M000032" class="method-signature">
|
234
235
|
<span class="method-name">add_indent</span><span class="method-args">(src, indent)</span>
|
235
236
|
</a>
|
236
237
|
</div>
|
237
238
|
|
238
239
|
<div class="method-description">
|
239
240
|
<p><a class="source-toggle" href="#"
|
240
|
-
onclick="toggleCode('
|
241
|
-
<div class="method-source-code" id="
|
241
|
+
onclick="toggleCode('M000032-source');return false;">[Source]</a></p>
|
242
|
+
<div class="method-source-code" id="M000032-source">
|
242
243
|
<pre>
|
243
|
-
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line
|
244
|
+
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line 47</span>
|
244
245
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_indent</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">indent</span>)
|
245
246
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> (<span class="ruby-identifier">src</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">src</span>[<span class="ruby-value">-1</span>] <span class="ruby-operator">==</span> <span class="ruby-value">?\n</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">indent</span> <span class="ruby-operator">:</span> <span class="ruby-value str">' '</span>)
|
246
247
|
<span class="ruby-keyword kw">end</span>
|
@@ -249,21 +250,21 @@ engine for JavaScript
|
|
249
250
|
</div>
|
250
251
|
</div>
|
251
252
|
|
252
|
-
<div id="method-
|
253
|
-
<a name="
|
253
|
+
<div id="method-M000038" class="method-detail">
|
254
|
+
<a name="M000038"></a>
|
254
255
|
|
255
256
|
<div class="method-heading">
|
256
|
-
<a href="#
|
257
|
+
<a href="#M000038" class="method-signature">
|
257
258
|
<span class="method-name">add_postamble</span><span class="method-args">(src)</span>
|
258
259
|
</a>
|
259
260
|
</div>
|
260
261
|
|
261
262
|
<div class="method-description">
|
262
263
|
<p><a class="source-toggle" href="#"
|
263
|
-
onclick="toggleCode('
|
264
|
-
<div class="method-source-code" id="
|
264
|
+
onclick="toggleCode('M000038-source');return false;">[Source]</a></p>
|
265
|
+
<div class="method-source-code" id="M000038-source">
|
265
266
|
<pre>
|
266
|
-
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line
|
267
|
+
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line 84</span>
|
267
268
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_postamble</span>(<span class="ruby-identifier">src</span>)
|
268
269
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"\n"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">src</span>[<span class="ruby-value">-1</span>] <span class="ruby-operator">==</span> <span class="ruby-value">?;</span>
|
269
270
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@indent</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">'document.write('</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@buf</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">".join(\"\"));\n"</span>
|
@@ -296,21 +297,21 @@ engine for JavaScript
|
|
296
297
|
</div>
|
297
298
|
</div>
|
298
299
|
|
299
|
-
<div id="method-
|
300
|
-
<a name="
|
300
|
+
<div id="method-M000034" class="method-detail">
|
301
|
+
<a name="M000034"></a>
|
301
302
|
|
302
303
|
<div class="method-heading">
|
303
|
-
<a href="#
|
304
|
+
<a href="#M000034" class="method-signature">
|
304
305
|
<span class="method-name">add_stmt</span><span class="method-args">(src, code)</span>
|
305
306
|
</a>
|
306
307
|
</div>
|
307
308
|
|
308
309
|
<div class="method-description">
|
309
310
|
<p><a class="source-toggle" href="#"
|
310
|
-
onclick="toggleCode('
|
311
|
-
<div class="method-source-code" id="
|
311
|
+
onclick="toggleCode('M000034-source');return false;">[Source]</a></p>
|
312
|
+
<div class="method-source-code" id="M000034-source">
|
312
313
|
<pre>
|
313
|
-
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line
|
314
|
+
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line 64</span>
|
314
315
|
<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>)
|
315
316
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">code</span>
|
316
317
|
<span class="ruby-keyword kw">end</span>
|
@@ -319,21 +320,21 @@ engine for JavaScript
|
|
319
320
|
</div>
|
320
321
|
</div>
|
321
322
|
|
322
|
-
<div id="method-
|
323
|
-
<a name="
|
323
|
+
<div id="method-M000033" class="method-detail">
|
324
|
+
<a name="M000033"></a>
|
324
325
|
|
325
326
|
<div class="method-heading">
|
326
|
-
<a href="#
|
327
|
+
<a href="#M000033" class="method-signature">
|
327
328
|
<span class="method-name">add_text</span><span class="method-args">(src, text)</span>
|
328
329
|
</a>
|
329
330
|
</div>
|
330
331
|
|
331
332
|
<div class="method-description">
|
332
333
|
<p><a class="source-toggle" href="#"
|
333
|
-
onclick="toggleCode('
|
334
|
-
<div class="method-source-code" id="
|
334
|
+
onclick="toggleCode('M000033-source');return false;">[Source]</a></p>
|
335
|
+
<div class="method-source-code" id="M000033-source">
|
335
336
|
<pre>
|
336
|
-
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line
|
337
|
+
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line 51</span>
|
337
338
|
<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>)
|
338
339
|
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">empty?</span>
|
339
340
|
<span class="ruby-identifier">add_indent</span>(<span class="ruby-identifier">src</span>, <span class="ruby-ivar">@indent</span>)
|
@@ -375,6 +376,30 @@ engine for JavaScript
|
|
375
376
|
</div>
|
376
377
|
</div>
|
377
378
|
|
379
|
+
<div id="method-M000031" class="method-detail">
|
380
|
+
<a name="M000031"></a>
|
381
|
+
|
382
|
+
<div class="method-heading">
|
383
|
+
<a href="#M000031" class="method-signature">
|
384
|
+
<span class="method-name">escaped_expr</span><span class="method-args">(code)</span>
|
385
|
+
</a>
|
386
|
+
</div>
|
387
|
+
|
388
|
+
<div class="method-description">
|
389
|
+
<p><a class="source-toggle" href="#"
|
390
|
+
onclick="toggleCode('M000031-source');return false;">[Source]</a></p>
|
391
|
+
<div class="method-source-code" id="M000031-source">
|
392
|
+
<pre>
|
393
|
+
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line 42</span>
|
394
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escaped_expr</span>(<span class="ruby-identifier">code</span>)
|
395
|
+
<span class="ruby-ivar">@escape</span> <span class="ruby-operator">||=</span> <span class="ruby-value str">'escape'</span>
|
396
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-node">"#{@escape}(#{code.strip})"</span>
|
397
|
+
<span class="ruby-keyword kw">end</span>
|
398
|
+
</pre>
|
399
|
+
</div>
|
400
|
+
</div>
|
401
|
+
</div>
|
402
|
+
|
378
403
|
|
379
404
|
</div>
|
380
405
|
|
@@ -79,11 +79,9 @@
|
|
79
79
|
<div id="contextContent">
|
80
80
|
|
81
81
|
<div id="description">
|
82
|
-
<
|
83
|
-
|
84
|
-
|
85
|
-
</dd>
|
86
|
-
</dl>
|
82
|
+
<p>
|
83
|
+
.[abstract] base engine class
|
84
|
+
</p>
|
87
85
|
|
88
86
|
</div>
|
89
87
|
|
@@ -94,23 +92,23 @@
|
|
94
92
|
<h3 class="section-bar">Methods</h3>
|
95
93
|
|
96
94
|
<div class="name-list">
|
97
|
-
<a href="#
|
98
|
-
<a href="#
|
99
|
-
<a href="#
|
100
|
-
<a href="#
|
101
|
-
<a href="#
|
102
|
-
<a href="#
|
103
|
-
<a href="#
|
104
|
-
<a href="#
|
105
|
-
<a href="#
|
106
|
-
<a href="#
|
107
|
-
<a href="#
|
108
|
-
<a href="#
|
109
|
-
<a href="#
|
110
|
-
<a href="#
|
111
|
-
<a href="#
|
112
|
-
<a href="#
|
113
|
-
<a href="#
|
95
|
+
<a href="#M000075">add_expr</a>
|
96
|
+
<a href="#M000078">add_expr_debug</a>
|
97
|
+
<a href="#M000077">add_expr_escaped</a>
|
98
|
+
<a href="#M000076">add_expr_literal</a>
|
99
|
+
<a href="#M000079">add_postamble</a>
|
100
|
+
<a href="#M000072">add_preamble</a>
|
101
|
+
<a href="#M000074">add_stmt</a>
|
102
|
+
<a href="#M000073">add_text</a>
|
103
|
+
<a href="#M000068">compile</a>
|
104
|
+
<a href="#M000069">compile!</a>
|
105
|
+
<a href="#M000070">escape_text</a>
|
106
|
+
<a href="#M000071">escaped_expr</a>
|
107
|
+
<a href="#M000066">evaluate</a>
|
108
|
+
<a href="#M000064">load_file</a>
|
109
|
+
<a href="#M000063">new</a>
|
110
|
+
<a href="#M000067">pattern_regexp</a>
|
111
|
+
<a href="#M000065">result</a>
|
114
112
|
</div>
|
115
113
|
</div>
|
116
114
|
|
@@ -163,11 +161,11 @@
|
|
163
161
|
<div id="methods">
|
164
162
|
<h3 class="section-bar">Public Class methods</h3>
|
165
163
|
|
166
|
-
<div id="method-
|
167
|
-
<a name="
|
164
|
+
<div id="method-M000064" class="method-detail">
|
165
|
+
<a name="M000064"></a>
|
168
166
|
|
169
167
|
<div class="method-heading">
|
170
|
-
<a href="#
|
168
|
+
<a href="#M000064" class="method-signature">
|
171
169
|
<span class="method-name">load_file</span><span class="method-args">(filename, properties={})</span>
|
172
170
|
</a>
|
173
171
|
</div>
|
@@ -177,8 +175,8 @@
|
|
177
175
|
load file and create engine object
|
178
176
|
</p>
|
179
177
|
<p><a class="source-toggle" href="#"
|
180
|
-
onclick="toggleCode('
|
181
|
-
<div class="method-source-code" id="
|
178
|
+
onclick="toggleCode('M000064-source');return false;">[Source]</a></p>
|
179
|
+
<div class="method-source-code" id="M000064-source">
|
182
180
|
<pre>
|
183
181
|
<span class="ruby-comment cmt"># File erubis/engine.rb, line 93</span>
|
184
182
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">load_file</span>(<span class="ruby-identifier">filename</span>, <span class="ruby-identifier">properties</span>={})
|
@@ -193,24 +191,24 @@ load file and create engine object
|
|
193
191
|
</div>
|
194
192
|
</div>
|
195
193
|
|
196
|
-
<div id="method-
|
197
|
-
<a name="
|
194
|
+
<div id="method-M000063" class="method-detail">
|
195
|
+
<a name="M000063"></a>
|
198
196
|
|
199
197
|
<div class="method-heading">
|
200
|
-
<a href="#
|
198
|
+
<a href="#M000063" class="method-signature">
|
201
199
|
<span class="method-name">new</span><span class="method-args">(input, properties={})</span>
|
202
200
|
</a>
|
203
201
|
</div>
|
204
202
|
|
205
203
|
<div class="method-description">
|
206
204
|
<p><a class="source-toggle" href="#"
|
207
|
-
onclick="toggleCode('
|
208
|
-
<div class="method-source-code" id="
|
205
|
+
onclick="toggleCode('M000063-source');return false;">[Source]</a></p>
|
206
|
+
<div class="method-source-code" id="M000063-source">
|
209
207
|
<pre>
|
210
208
|
<span class="ruby-comment cmt"># File erubis/engine.rb, line 79</span>
|
211
209
|
<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>={})
|
212
210
|
<span class="ruby-comment cmt">#@input = input</span>
|
213
|
-
<span class="ruby-ivar">@pattern</span> = <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:pattern</span>]
|
211
|
+
<span class="ruby-ivar">@pattern</span> = <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:pattern</span>]
|
214
212
|
<span class="ruby-ivar">@filename</span> = <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:filename</span>]
|
215
213
|
<span class="ruby-ivar">@trim</span> = <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:trim</span>] <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">false</span>
|
216
214
|
<span class="ruby-ivar">@preamble</span> = <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:preamble</span>]
|
@@ -225,11 +223,11 @@ load file and create engine object
|
|
225
223
|
|
226
224
|
<h3 class="section-bar">Public Instance methods</h3>
|
227
225
|
|
228
|
-
<div id="method-
|
229
|
-
<a name="
|
226
|
+
<div id="method-M000068" class="method-detail">
|
227
|
+
<a name="M000068"></a>
|
230
228
|
|
231
229
|
<div class="method-heading">
|
232
|
-
<a href="#
|
230
|
+
<a href="#M000068" class="method-signature">
|
233
231
|
<span class="method-name">compile</span><span class="method-args">(input)</span>
|
234
232
|
</a>
|
235
233
|
</div>
|
@@ -239,8 +237,8 @@ load file and create engine object
|
|
239
237
|
compile input string into target language
|
240
238
|
</p>
|
241
239
|
<p><a class="source-toggle" href="#"
|
242
|
-
onclick="toggleCode('
|
243
|
-
<div class="method-source-code" id="
|
240
|
+
onclick="toggleCode('M000068-source');return false;">[Source]</a></p>
|
241
|
+
<div class="method-source-code" id="M000068-source">
|
244
242
|
<pre>
|
245
243
|
<span class="ruby-comment cmt"># File erubis/engine.rb, line 132</span>
|
246
244
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">compile</span>(<span class="ruby-identifier">input</span>)
|
@@ -266,7 +264,7 @@ compile input string into target language
|
|
266
264
|
<span class="ruby-keyword kw">else</span>
|
267
265
|
<span class="ruby-identifier">add_text</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">lspace</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">lspace</span>
|
268
266
|
<span class="ruby-identifier">add_stmt</span>(<span class="ruby-identifier">src</span>, <span class="ruby-value str">"\n"</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">n</span>)
|
269
|
-
<span class="ruby-identifier">add_text</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">rspace</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">
|
267
|
+
<span class="ruby-identifier">add_text</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">rspace</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">rspace</span>
|
270
268
|
<span class="ruby-keyword kw">end</span>
|
271
269
|
<span class="ruby-comment cmt">#flag_trim = @trim && lspace && rspace</span>
|
272
270
|
<span class="ruby-comment cmt">#add_text(src, lspace) if !flag_trim && lspace</span>
|
@@ -307,11 +305,11 @@ compile input string into target language
|
|
307
305
|
</div>
|
308
306
|
</div>
|
309
307
|
|
310
|
-
<div id="method-
|
311
|
-
<a name="
|
308
|
+
<div id="method-M000069" class="method-detail">
|
309
|
+
<a name="M000069"></a>
|
312
310
|
|
313
311
|
<div class="method-heading">
|
314
|
-
<a href="#
|
312
|
+
<a href="#M000069" class="method-signature">
|
315
313
|
<span class="method-name">compile!</span><span class="method-args">(input)</span>
|
316
314
|
</a>
|
317
315
|
</div>
|
@@ -321,8 +319,8 @@ compile input string into target language
|
|
321
319
|
compile input string and set it to @src
|
322
320
|
</p>
|
323
321
|
<p><a class="source-toggle" href="#"
|
324
|
-
onclick="toggleCode('
|
325
|
-
<div class="method-source-code" id="
|
322
|
+
onclick="toggleCode('M000069-source');return false;">[Source]</a></p>
|
323
|
+
<div class="method-source-code" id="M000069-source">
|
326
324
|
<pre>
|
327
325
|
<span class="ruby-comment cmt"># File erubis/engine.rb, line 193</span>
|
328
326
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">compile!</span>(<span class="ruby-identifier">input</span>)
|
@@ -333,22 +331,22 @@ compile input string and set it to @src
|
|
333
331
|
</div>
|
334
332
|
</div>
|
335
333
|
|
336
|
-
<div id="method-
|
337
|
-
<a name="
|
334
|
+
<div id="method-M000066" class="method-detail">
|
335
|
+
<a name="M000066"></a>
|
338
336
|
|
339
337
|
<div class="method-heading">
|
340
|
-
<a href="#
|
338
|
+
<a href="#M000066" class="method-signature">
|
341
339
|
<span class="method-name">evaluate</span><span class="method-args">(context=Context.new)</span>
|
342
340
|
</a>
|
343
341
|
</div>
|
344
342
|
|
345
343
|
<div class="method-description">
|
346
344
|
<p>
|
347
|
-
|
345
|
+
invoke context.instance_eval(@src)
|
348
346
|
</p>
|
349
347
|
<p><a class="source-toggle" href="#"
|
350
|
-
onclick="toggleCode('
|
351
|
-
<div class="method-source-code" id="
|
348
|
+
onclick="toggleCode('M000066-source');return false;">[Source]</a></p>
|
349
|
+
<div class="method-source-code" id="M000066-source">
|
352
350
|
<pre>
|
353
351
|
<span class="ruby-comment cmt"># File erubis/engine.rb, line 113</span>
|
354
352
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">evaluate</span>(<span class="ruby-identifier">context</span>=<span class="ruby-constant">Context</span>.<span class="ruby-identifier">new</span>)
|
@@ -360,22 +358,22 @@ call context.instance_eval(@src)
|
|
360
358
|
</div>
|
361
359
|
</div>
|
362
360
|
|
363
|
-
<div id="method-
|
364
|
-
<a name="
|
361
|
+
<div id="method-M000065" class="method-detail">
|
362
|
+
<a name="M000065"></a>
|
365
363
|
|
366
364
|
<div class="method-heading">
|
367
|
-
<a href="#
|
365
|
+
<a href="#M000065" class="method-signature">
|
368
366
|
<span class="method-name">result</span><span class="method-args">(_binding_or_hash=TOPLEVEL_BINDING)</span>
|
369
367
|
</a>
|
370
368
|
</div>
|
371
369
|
|
372
370
|
<div class="method-description">
|
373
371
|
<p>
|
374
|
-
eval(@src) with binding
|
372
|
+
eval(@src) with binding object
|
375
373
|
</p>
|
376
374
|
<p><a class="source-toggle" href="#"
|
377
|
-
onclick="toggleCode('
|
378
|
-
<div class="method-source-code" id="
|
375
|
+
onclick="toggleCode('M000065-source');return false;">[Source]</a></p>
|
376
|
+
<div class="method-source-code" id="M000065-source">
|
379
377
|
<pre>
|
380
378
|
<span class="ruby-comment cmt"># File erubis/engine.rb, line 102</span>
|
381
379
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">result</span>(<span class="ruby-identifier">_binding_or_hash</span>=<span class="ruby-constant">TOPLEVEL_BINDING</span>)
|
@@ -394,11 +392,11 @@ eval(@src) with binding
|
|
394
392
|
|
395
393
|
<h3 class="section-bar">Protected Instance methods</h3>
|
396
394
|
|
397
|
-
<div id="method-
|
398
|
-
<a name="
|
395
|
+
<div id="method-M000075" class="method-detail">
|
396
|
+
<a name="M000075"></a>
|
399
397
|
|
400
398
|
<div class="method-heading">
|
401
|
-
<a href="#
|
399
|
+
<a href="#M000075" class="method-signature">
|
402
400
|
<span class="method-name">add_expr</span><span class="method-args">(src, code, indicator)</span>
|
403
401
|
</a>
|
404
402
|
</div>
|
@@ -408,10 +406,10 @@ eval(@src) with binding
|
|
408
406
|
add expression code to src
|
409
407
|
</p>
|
410
408
|
<p><a class="source-toggle" href="#"
|
411
|
-
onclick="toggleCode('
|
412
|
-
<div class="method-source-code" id="
|
409
|
+
onclick="toggleCode('M000075-source');return false;">[Source]</a></p>
|
410
|
+
<div class="method-source-code" id="M000075-source">
|
413
411
|
<pre>
|
414
|
-
<span class="ruby-comment cmt"># File erubis/engine.rb, line
|
412
|
+
<span class="ruby-comment cmt"># File erubis/engine.rb, line 237</span>
|
415
413
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_expr</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>, <span class="ruby-identifier">indicator</span>)
|
416
414
|
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">indicator</span>
|
417
415
|
<span class="ruby-keyword kw">when</span> <span class="ruby-value str">'='</span>
|
@@ -427,38 +425,38 @@ add expression code to src
|
|
427
425
|
</div>
|
428
426
|
</div>
|
429
427
|
|
430
|
-
<div id="method-
|
431
|
-
<a name="
|
428
|
+
<div id="method-M000078" class="method-detail">
|
429
|
+
<a name="M000078"></a>
|
432
430
|
|
433
431
|
<div class="method-heading">
|
434
|
-
<a href="#
|
432
|
+
<a href="#M000078" class="method-signature">
|
435
433
|
<span class="method-name">add_expr_debug</span><span class="method-args">(src, code)</span>
|
436
434
|
</a>
|
437
435
|
</div>
|
438
436
|
|
439
437
|
<div class="method-description">
|
440
438
|
<p>
|
441
|
-
.[
|
442
|
-
href="Engine.html#
|
439
|
+
.[abstract] add expression code to src for debug. this is called by <a
|
440
|
+
href="Engine.html#M000075">add_expr</a>().
|
443
441
|
</p>
|
444
442
|
<p><a class="source-toggle" href="#"
|
445
|
-
onclick="toggleCode('
|
446
|
-
<div class="method-source-code" id="
|
443
|
+
onclick="toggleCode('M000078-source');return false;">[Source]</a></p>
|
444
|
+
<div class="method-source-code" id="M000078-source">
|
447
445
|
<pre>
|
448
|
-
<span class="ruby-comment cmt"># File erubis/engine.rb, line
|
446
|
+
<span class="ruby-comment cmt"># File erubis/engine.rb, line 259</span>
|
449
447
|
<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>)
|
450
|
-
<span class="ruby-
|
448
|
+
<span class="ruby-identifier">not_implemented</span>
|
451
449
|
<span class="ruby-keyword kw">end</span>
|
452
450
|
</pre>
|
453
451
|
</div>
|
454
452
|
</div>
|
455
453
|
</div>
|
456
454
|
|
457
|
-
<div id="method-
|
458
|
-
<a name="
|
455
|
+
<div id="method-M000077" class="method-detail">
|
456
|
+
<a name="M000077"></a>
|
459
457
|
|
460
458
|
<div class="method-heading">
|
461
|
-
<a href="#
|
459
|
+
<a href="#M000077" class="method-signature">
|
462
460
|
<span class="method-name">add_expr_escaped</span><span class="method-args">(src, code)</span>
|
463
461
|
</a>
|
464
462
|
</div>
|
@@ -466,13 +464,13 @@ href="Engine.html#M000071">add_expr</a>().
|
|
466
464
|
<div class="method-description">
|
467
465
|
<p>
|
468
466
|
.[abstract] add escaped expression code to src. this is called by <a
|
469
|
-
href="Engine.html#
|
467
|
+
href="Engine.html#M000075">add_expr</a>().
|
470
468
|
</p>
|
471
469
|
<p><a class="source-toggle" href="#"
|
472
|
-
onclick="toggleCode('
|
473
|
-
<div class="method-source-code" id="
|
470
|
+
onclick="toggleCode('M000077-source');return false;">[Source]</a></p>
|
471
|
+
<div class="method-source-code" id="M000077-source">
|
474
472
|
<pre>
|
475
|
-
<span class="ruby-comment cmt"># File erubis/engine.rb, line
|
473
|
+
<span class="ruby-comment cmt"># File erubis/engine.rb, line 254</span>
|
476
474
|
<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>)
|
477
475
|
<span class="ruby-identifier">not_implemented</span>
|
478
476
|
<span class="ruby-keyword kw">end</span>
|
@@ -481,11 +479,11 @@ href="Engine.html#M000071">add_expr</a>().
|
|
481
479
|
</div>
|
482
480
|
</div>
|
483
481
|
|
484
|
-
<div id="method-
|
485
|
-
<a name="
|
482
|
+
<div id="method-M000076" class="method-detail">
|
483
|
+
<a name="M000076"></a>
|
486
484
|
|
487
485
|
<div class="method-heading">
|
488
|
-
<a href="#
|
486
|
+
<a href="#M000076" class="method-signature">
|
489
487
|
<span class="method-name">add_expr_literal</span><span class="method-args">(src, code)</span>
|
490
488
|
</a>
|
491
489
|
</div>
|
@@ -493,13 +491,13 @@ href="Engine.html#M000071">add_expr</a>().
|
|
493
491
|
<div class="method-description">
|
494
492
|
<p>
|
495
493
|
.[abstract] add expression literal code to src. this is called by <a
|
496
|
-
href="Engine.html#
|
494
|
+
href="Engine.html#M000075">add_expr</a>().
|
497
495
|
</p>
|
498
496
|
<p><a class="source-toggle" href="#"
|
499
|
-
onclick="toggleCode('
|
500
|
-
<div class="method-source-code" id="
|
497
|
+
onclick="toggleCode('M000076-source');return false;">[Source]</a></p>
|
498
|
+
<div class="method-source-code" id="M000076-source">
|
501
499
|
<pre>
|
502
|
-
<span class="ruby-comment cmt"># File erubis/engine.rb, line
|
500
|
+
<span class="ruby-comment cmt"># File erubis/engine.rb, line 249</span>
|
503
501
|
<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>)
|
504
502
|
<span class="ruby-identifier">not_implemented</span>
|
505
503
|
<span class="ruby-keyword kw">end</span>
|
@@ -508,63 +506,63 @@ href="Engine.html#M000071">add_expr</a>().
|
|
508
506
|
</div>
|
509
507
|
</div>
|
510
508
|
|
511
|
-
<div id="method-
|
512
|
-
<a name="
|
509
|
+
<div id="method-M000079" class="method-detail">
|
510
|
+
<a name="M000079"></a>
|
513
511
|
|
514
512
|
<div class="method-heading">
|
515
|
-
<a href="#
|
513
|
+
<a href="#M000079" class="method-signature">
|
516
514
|
<span class="method-name">add_postamble</span><span class="method-args">(src)</span>
|
517
515
|
</a>
|
518
516
|
</div>
|
519
517
|
|
520
518
|
<div class="method-description">
|
521
519
|
<p>
|
522
|
-
.[
|
520
|
+
.[abstract] add @postamble to src
|
523
521
|
</p>
|
524
522
|
<p><a class="source-toggle" href="#"
|
525
|
-
onclick="toggleCode('
|
526
|
-
<div class="method-source-code" id="
|
523
|
+
onclick="toggleCode('M000079-source');return false;">[Source]</a></p>
|
524
|
+
<div class="method-source-code" id="M000079-source">
|
527
525
|
<pre>
|
528
|
-
<span class="ruby-comment cmt"># File erubis/engine.rb, line
|
526
|
+
<span class="ruby-comment cmt"># File erubis/engine.rb, line 264</span>
|
529
527
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_postamble</span>(<span class="ruby-identifier">src</span>)
|
530
|
-
<span class="ruby-
|
528
|
+
<span class="ruby-identifier">not_implemented</span>
|
531
529
|
<span class="ruby-keyword kw">end</span>
|
532
530
|
</pre>
|
533
531
|
</div>
|
534
532
|
</div>
|
535
533
|
</div>
|
536
534
|
|
537
|
-
<div id="method-
|
538
|
-
<a name="
|
535
|
+
<div id="method-M000072" class="method-detail">
|
536
|
+
<a name="M000072"></a>
|
539
537
|
|
540
538
|
<div class="method-heading">
|
541
|
-
<a href="#
|
539
|
+
<a href="#M000072" class="method-signature">
|
542
540
|
<span class="method-name">add_preamble</span><span class="method-args">(src)</span>
|
543
541
|
</a>
|
544
542
|
</div>
|
545
543
|
|
546
544
|
<div class="method-description">
|
547
545
|
<p>
|
548
|
-
.[
|
546
|
+
.[abstract] add @preamble to src
|
549
547
|
</p>
|
550
548
|
<p><a class="source-toggle" href="#"
|
551
|
-
onclick="toggleCode('
|
552
|
-
<div class="method-source-code" id="
|
549
|
+
onclick="toggleCode('M000072-source');return false;">[Source]</a></p>
|
550
|
+
<div class="method-source-code" id="M000072-source">
|
553
551
|
<pre>
|
554
|
-
<span class="ruby-comment cmt"># File erubis/engine.rb, line
|
552
|
+
<span class="ruby-comment cmt"># File erubis/engine.rb, line 222</span>
|
555
553
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_preamble</span>(<span class="ruby-identifier">src</span>)
|
556
|
-
<span class="ruby-
|
554
|
+
<span class="ruby-identifier">not_implemented</span>
|
557
555
|
<span class="ruby-keyword kw">end</span>
|
558
556
|
</pre>
|
559
557
|
</div>
|
560
558
|
</div>
|
561
559
|
</div>
|
562
560
|
|
563
|
-
<div id="method-
|
564
|
-
<a name="
|
561
|
+
<div id="method-M000074" class="method-detail">
|
562
|
+
<a name="M000074"></a>
|
565
563
|
|
566
564
|
<div class="method-heading">
|
567
|
-
<a href="#
|
565
|
+
<a href="#M000074" class="method-signature">
|
568
566
|
<span class="method-name">add_stmt</span><span class="method-args">(src, code)</span>
|
569
567
|
</a>
|
570
568
|
</div>
|
@@ -574,10 +572,10 @@ href="Engine.html#M000071">add_expr</a>().
|
|
574
572
|
.[abstract] add statement code to src
|
575
573
|
</p>
|
576
574
|
<p><a class="source-toggle" href="#"
|
577
|
-
onclick="toggleCode('
|
578
|
-
<div class="method-source-code" id="
|
575
|
+
onclick="toggleCode('M000074-source');return false;">[Source]</a></p>
|
576
|
+
<div class="method-source-code" id="M000074-source">
|
579
577
|
<pre>
|
580
|
-
<span class="ruby-comment cmt"># File erubis/engine.rb, line
|
578
|
+
<span class="ruby-comment cmt"># File erubis/engine.rb, line 232</span>
|
581
579
|
<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>)
|
582
580
|
<span class="ruby-identifier">not_implemented</span>
|
583
581
|
<span class="ruby-keyword kw">end</span>
|
@@ -586,11 +584,11 @@ href="Engine.html#M000071">add_expr</a>().
|
|
586
584
|
</div>
|
587
585
|
</div>
|
588
586
|
|
589
|
-
<div id="method-
|
590
|
-
<a name="
|
587
|
+
<div id="method-M000073" class="method-detail">
|
588
|
+
<a name="M000073"></a>
|
591
589
|
|
592
590
|
<div class="method-heading">
|
593
|
-
<a href="#
|
591
|
+
<a href="#M000073" class="method-signature">
|
594
592
|
<span class="method-name">add_text</span><span class="method-args">(src, text)</span>
|
595
593
|
</a>
|
596
594
|
</div>
|
@@ -600,10 +598,10 @@ href="Engine.html#M000071">add_expr</a>().
|
|
600
598
|
.[abstract] add text string to src
|
601
599
|
</p>
|
602
600
|
<p><a class="source-toggle" href="#"
|
603
|
-
onclick="toggleCode('
|
604
|
-
<div class="method-source-code" id="
|
601
|
+
onclick="toggleCode('M000073-source');return false;">[Source]</a></p>
|
602
|
+
<div class="method-source-code" id="M000073-source">
|
605
603
|
<pre>
|
606
|
-
<span class="ruby-comment cmt"># File erubis/engine.rb, line
|
604
|
+
<span class="ruby-comment cmt"># File erubis/engine.rb, line 227</span>
|
607
605
|
<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>)
|
608
606
|
<span class="ruby-identifier">not_implemented</span>
|
609
607
|
<span class="ruby-keyword kw">end</span>
|
@@ -612,64 +610,81 @@ href="Engine.html#M000071">add_expr</a>().
|
|
612
610
|
</div>
|
613
611
|
</div>
|
614
612
|
|
615
|
-
<div id="method-
|
616
|
-
<a name="
|
613
|
+
<div id="method-M000070" class="method-detail">
|
614
|
+
<a name="M000070"></a>
|
617
615
|
|
618
616
|
<div class="method-heading">
|
619
|
-
<a href="#
|
617
|
+
<a href="#M000070" class="method-signature">
|
620
618
|
<span class="method-name">escape_text</span><span class="method-args">(text)</span>
|
621
619
|
</a>
|
622
620
|
</div>
|
623
621
|
|
624
622
|
<div class="method-description">
|
625
623
|
<p>
|
626
|
-
escape text string
|
624
|
+
.[abstract] escape text string
|
625
|
+
</p>
|
626
|
+
<p>
|
627
|
+
ex.
|
627
628
|
</p>
|
629
|
+
<pre>
|
630
|
+
def escape_text(text)
|
631
|
+
return text.dump
|
632
|
+
# or return "'" + text.gsub(/['\\]/, '\\\\\&') + "'"
|
633
|
+
end
|
634
|
+
</pre>
|
628
635
|
<p><a class="source-toggle" href="#"
|
629
|
-
onclick="toggleCode('
|
630
|
-
<div class="method-source-code" id="
|
636
|
+
onclick="toggleCode('M000070-source');return false;">[Source]</a></p>
|
637
|
+
<div class="method-source-code" id="M000070-source">
|
631
638
|
<pre>
|
632
|
-
<span class="ruby-comment cmt"># File erubis/engine.rb, line
|
639
|
+
<span class="ruby-comment cmt"># File erubis/engine.rb, line 206</span>
|
633
640
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escape_text</span>(<span class="ruby-identifier">text</span>)
|
634
|
-
<span class="ruby-
|
641
|
+
<span class="ruby-identifier">not_implemented</span>
|
635
642
|
<span class="ruby-keyword kw">end</span>
|
636
643
|
</pre>
|
637
644
|
</div>
|
638
645
|
</div>
|
639
646
|
</div>
|
640
647
|
|
641
|
-
<div id="method-
|
642
|
-
<a name="
|
648
|
+
<div id="method-M000071" class="method-detail">
|
649
|
+
<a name="M000071"></a>
|
643
650
|
|
644
651
|
<div class="method-heading">
|
645
|
-
<a href="#
|
652
|
+
<a href="#M000071" class="method-signature">
|
646
653
|
<span class="method-name">escaped_expr</span><span class="method-args">(code)</span>
|
647
654
|
</a>
|
648
655
|
</div>
|
649
656
|
|
650
657
|
<div class="method-description">
|
651
658
|
<p>
|
652
|
-
return escaped expression code
|
659
|
+
.[abstract] return escaped expression code
|
653
660
|
</p>
|
661
|
+
<p>
|
662
|
+
ex.
|
663
|
+
</p>
|
664
|
+
<pre>
|
665
|
+
def escaped_expr(code)
|
666
|
+
@escape ||= 'escape'
|
667
|
+
return "#{@escape}(#{code.strip})"
|
668
|
+
end
|
669
|
+
</pre>
|
654
670
|
<p><a class="source-toggle" href="#"
|
655
|
-
onclick="toggleCode('
|
656
|
-
<div class="method-source-code" id="
|
671
|
+
onclick="toggleCode('M000071-source');return false;">[Source]</a></p>
|
672
|
+
<div class="method-source-code" id="M000071-source">
|
657
673
|
<pre>
|
658
|
-
<span class="ruby-comment cmt"># File erubis/engine.rb, line
|
674
|
+
<span class="ruby-comment cmt"># File erubis/engine.rb, line 217</span>
|
659
675
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escaped_expr</span>(<span class="ruby-identifier">code</span>)
|
660
|
-
<span class="ruby-
|
661
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-node">"#{@escape}(#{code.strip})"</span>
|
676
|
+
<span class="ruby-identifier">not_implemented</span>
|
662
677
|
<span class="ruby-keyword kw">end</span>
|
663
678
|
</pre>
|
664
679
|
</div>
|
665
680
|
</div>
|
666
681
|
</div>
|
667
682
|
|
668
|
-
<div id="method-
|
669
|
-
<a name="
|
683
|
+
<div id="method-M000067" class="method-detail">
|
684
|
+
<a name="M000067"></a>
|
670
685
|
|
671
686
|
<div class="method-heading">
|
672
|
-
<a href="#
|
687
|
+
<a href="#M000067" class="method-signature">
|
673
688
|
<span class="method-name">pattern_regexp</span><span class="method-args">(pattern=@pattern)</span>
|
674
689
|
</a>
|
675
690
|
</div>
|
@@ -679,12 +694,12 @@ return escaped expression code
|
|
679
694
|
return regexp of pattern to parse eRuby script
|
680
695
|
</p>
|
681
696
|
<p><a class="source-toggle" href="#"
|
682
|
-
onclick="toggleCode('
|
683
|
-
<div class="method-source-code" id="
|
697
|
+
onclick="toggleCode('M000067-source');return false;">[Source]</a></p>
|
698
|
+
<div class="method-source-code" id="M000067-source">
|
684
699
|
<pre>
|
685
700
|
<span class="ruby-comment cmt"># File erubis/engine.rb, line 121</span>
|
686
701
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pattern_regexp</span>(<span class="ruby-identifier">pattern</span>=<span class="ruby-ivar">@pattern</span>)
|
687
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">pattern</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'<% %>'</span>
|
702
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">pattern</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">pattern</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'<% %>'</span>
|
688
703
|
<span class="ruby-keyword kw">return</span> <span class="ruby-constant">DEFAULT_REGEXP</span>
|
689
704
|
<span class="ruby-keyword kw">else</span>
|
690
705
|
<span class="ruby-identifier">prefix</span>, <span class="ruby-identifier">postfix</span> = <span class="ruby-identifier">pattern</span>.<span class="ruby-identifier">split</span>()
|