erubis 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 Perl
|
|
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="#
|
102
|
-
<a href="#
|
103
|
-
<a href="#
|
104
|
-
<a href="#
|
105
|
-
<a href="#
|
97
|
+
<a href="#M000099">add_expr_debug</a>
|
98
|
+
<a href="#M000098">add_expr_escaped</a>
|
99
|
+
<a href="#M000097">add_expr_literal</a>
|
100
|
+
<a href="#M000101">add_postamble</a>
|
101
|
+
<a href="#M000093">add_preamble</a>
|
102
|
+
<a href="#M000100">add_stmt</a>
|
103
|
+
<a href="#M000095">add_text</a>
|
104
|
+
<a href="#M000094">escape_text</a>
|
105
|
+
<a href="#M000096">escaped_expr</a>
|
106
|
+
<a href="#M000092">new</a>
|
106
107
|
</div>
|
107
108
|
</div>
|
108
109
|
|
@@ -124,19 +125,19 @@ engine for Perl
|
|
124
125
|
<div id="methods">
|
125
126
|
<h3 class="section-bar">Public Class methods</h3>
|
126
127
|
|
127
|
-
<div id="method-
|
128
|
-
<a name="
|
128
|
+
<div id="method-M000092" class="method-detail">
|
129
|
+
<a name="M000092"></a>
|
129
130
|
|
130
131
|
<div class="method-heading">
|
131
|
-
<a href="#
|
132
|
+
<a href="#M000092" class="method-signature">
|
132
133
|
<span class="method-name">new</span><span class="method-args">(input, properties={})</span>
|
133
134
|
</a>
|
134
135
|
</div>
|
135
136
|
|
136
137
|
<div class="method-description">
|
137
138
|
<p><a class="source-toggle" href="#"
|
138
|
-
onclick="toggleCode('
|
139
|
-
<div class="method-source-code" id="
|
139
|
+
onclick="toggleCode('M000092-source');return false;">[Source]</a></p>
|
140
|
+
<div class="method-source-code" id="M000092-source">
|
140
141
|
<pre>
|
141
142
|
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line 25</span>
|
142
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>={})
|
@@ -150,21 +151,21 @@ engine for Perl
|
|
150
151
|
|
151
152
|
<h3 class="section-bar">Public Instance methods</h3>
|
152
153
|
|
153
|
-
<div id="method-
|
154
|
-
<a name="
|
154
|
+
<div id="method-M000099" class="method-detail">
|
155
|
+
<a name="M000099"></a>
|
155
156
|
|
156
157
|
<div class="method-heading">
|
157
|
-
<a href="#
|
158
|
+
<a href="#M000099" class="method-signature">
|
158
159
|
<span class="method-name">add_expr_debug</span><span class="method-args">(src, code)</span>
|
159
160
|
</a>
|
160
161
|
</div>
|
161
162
|
|
162
163
|
<div class="method-description">
|
163
164
|
<p><a class="source-toggle" href="#"
|
164
|
-
onclick="toggleCode('
|
165
|
-
<div class="method-source-code" id="
|
165
|
+
onclick="toggleCode('M000099-source');return false;">[Source]</a></p>
|
166
|
+
<div class="method-source-code" id="M000099-source">
|
166
167
|
<pre>
|
167
|
-
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line
|
168
|
+
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line 55</span>
|
168
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>)
|
169
170
|
<span class="ruby-identifier">code</span>.<span class="ruby-identifier">strip!</span>
|
170
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">"\\'"</span>)
|
@@ -175,21 +176,21 @@ engine for Perl
|
|
175
176
|
</div>
|
176
177
|
</div>
|
177
178
|
|
178
|
-
<div id="method-
|
179
|
-
<a name="
|
179
|
+
<div id="method-M000098" class="method-detail">
|
180
|
+
<a name="M000098"></a>
|
180
181
|
|
181
182
|
<div class="method-heading">
|
182
|
-
<a href="#
|
183
|
+
<a href="#M000098" class="method-signature">
|
183
184
|
<span class="method-name">add_expr_escaped</span><span class="method-args">(src, code)</span>
|
184
185
|
</a>
|
185
186
|
</div>
|
186
187
|
|
187
188
|
<div class="method-description">
|
188
189
|
<p><a class="source-toggle" href="#"
|
189
|
-
onclick="toggleCode('
|
190
|
-
<div class="method-source-code" id="
|
190
|
+
onclick="toggleCode('M000098-source');return false;">[Source]</a></p>
|
191
|
+
<div class="method-source-code" id="M000098-source">
|
191
192
|
<pre>
|
192
|
-
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line
|
193
|
+
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line 51</span>
|
193
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>)
|
194
195
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@func</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"("</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>
|
195
196
|
<span class="ruby-keyword kw">end</span>
|
@@ -198,21 +199,21 @@ engine for Perl
|
|
198
199
|
</div>
|
199
200
|
</div>
|
200
201
|
|
201
|
-
<div id="method-
|
202
|
-
<a name="
|
202
|
+
<div id="method-M000097" class="method-detail">
|
203
|
+
<a name="M000097"></a>
|
203
204
|
|
204
205
|
<div class="method-heading">
|
205
|
-
<a href="#
|
206
|
+
<a href="#M000097" class="method-signature">
|
206
207
|
<span class="method-name">add_expr_literal</span><span class="method-args">(src, code)</span>
|
207
208
|
</a>
|
208
209
|
</div>
|
209
210
|
|
210
211
|
<div class="method-description">
|
211
212
|
<p><a class="source-toggle" href="#"
|
212
|
-
onclick="toggleCode('
|
213
|
-
<div class="method-source-code" id="
|
213
|
+
onclick="toggleCode('M000097-source');return false;">[Source]</a></p>
|
214
|
+
<div class="method-source-code" id="M000097-source">
|
214
215
|
<pre>
|
215
|
-
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line
|
216
|
+
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line 47</span>
|
216
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>)
|
217
218
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@func</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"("</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>
|
218
219
|
<span class="ruby-keyword kw">end</span>
|
@@ -221,21 +222,21 @@ engine for Perl
|
|
221
222
|
</div>
|
222
223
|
</div>
|
223
224
|
|
224
|
-
<div id="method-
|
225
|
-
<a name="
|
225
|
+
<div id="method-M000101" class="method-detail">
|
226
|
+
<a name="M000101"></a>
|
226
227
|
|
227
228
|
<div class="method-heading">
|
228
|
-
<a href="#
|
229
|
+
<a href="#M000101" class="method-signature">
|
229
230
|
<span class="method-name">add_postamble</span><span class="method-args">(src)</span>
|
230
231
|
</a>
|
231
232
|
</div>
|
232
233
|
|
233
234
|
<div class="method-description">
|
234
235
|
<p><a class="source-toggle" href="#"
|
235
|
-
onclick="toggleCode('
|
236
|
-
<div class="method-source-code" id="
|
236
|
+
onclick="toggleCode('M000101-source');return false;">[Source]</a></p>
|
237
|
+
<div class="method-source-code" id="M000101-source">
|
237
238
|
<pre>
|
238
|
-
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line
|
239
|
+
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line 65</span>
|
239
240
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_postamble</span>(<span class="ruby-identifier">src</span>)
|
240
241
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"\n"</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>
|
241
242
|
<span class="ruby-keyword kw">end</span>
|
@@ -244,43 +245,44 @@ engine for Perl
|
|
244
245
|
</div>
|
245
246
|
</div>
|
246
247
|
|
247
|
-
<div id="method-
|
248
|
-
<a name="
|
248
|
+
<div id="method-M000093" class="method-detail">
|
249
|
+
<a name="M000093"></a>
|
249
250
|
|
250
251
|
<div class="method-heading">
|
251
|
-
<a href="#
|
252
|
+
<a href="#M000093" class="method-signature">
|
252
253
|
<span class="method-name">add_preamble</span><span class="method-args">(src)</span>
|
253
254
|
</a>
|
254
255
|
</div>
|
255
256
|
|
256
257
|
<div class="method-description">
|
257
258
|
<p><a class="source-toggle" href="#"
|
258
|
-
onclick="toggleCode('
|
259
|
-
<div class="method-source-code" id="
|
259
|
+
onclick="toggleCode('M000093-source');return false;">[Source]</a></p>
|
260
|
+
<div class="method-source-code" id="M000093-source">
|
260
261
|
<pre>
|
261
262
|
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line 30</span>
|
262
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>
|
263
265
|
<span class="ruby-keyword kw">end</span>
|
264
266
|
</pre>
|
265
267
|
</div>
|
266
268
|
</div>
|
267
269
|
</div>
|
268
270
|
|
269
|
-
<div id="method-
|
270
|
-
<a name="
|
271
|
+
<div id="method-M000100" class="method-detail">
|
272
|
+
<a name="M000100"></a>
|
271
273
|
|
272
274
|
<div class="method-heading">
|
273
|
-
<a href="#
|
275
|
+
<a href="#M000100" class="method-signature">
|
274
276
|
<span class="method-name">add_stmt</span><span class="method-args">(src, code)</span>
|
275
277
|
</a>
|
276
278
|
</div>
|
277
279
|
|
278
280
|
<div class="method-description">
|
279
281
|
<p><a class="source-toggle" href="#"
|
280
|
-
onclick="toggleCode('
|
281
|
-
<div class="method-source-code" id="
|
282
|
+
onclick="toggleCode('M000100-source');return false;">[Source]</a></p>
|
283
|
+
<div class="method-source-code" id="M000100-source">
|
282
284
|
<pre>
|
283
|
-
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line
|
285
|
+
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line 61</span>
|
284
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>)
|
285
287
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">code</span>
|
286
288
|
<span class="ruby-keyword kw">end</span>
|
@@ -289,21 +291,21 @@ engine for Perl
|
|
289
291
|
</div>
|
290
292
|
</div>
|
291
293
|
|
292
|
-
<div id="method-
|
293
|
-
<a name="
|
294
|
+
<div id="method-M000095" class="method-detail">
|
295
|
+
<a name="M000095"></a>
|
294
296
|
|
295
297
|
<div class="method-heading">
|
296
|
-
<a href="#
|
298
|
+
<a href="#M000095" class="method-signature">
|
297
299
|
<span class="method-name">add_text</span><span class="method-args">(src, text)</span>
|
298
300
|
</a>
|
299
301
|
</div>
|
300
302
|
|
301
303
|
<div class="method-description">
|
302
304
|
<p><a class="source-toggle" href="#"
|
303
|
-
onclick="toggleCode('
|
304
|
-
<div class="method-source-code" id="
|
305
|
+
onclick="toggleCode('M000095-source');return false;">[Source]</a></p>
|
306
|
+
<div class="method-source-code" id="M000095-source">
|
305
307
|
<pre>
|
306
|
-
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line
|
308
|
+
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line 38</span>
|
307
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>)
|
308
310
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@func</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"('"</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">escape_text</span>(<span class="ruby-identifier">text</span>) <span class="ruby-operator"><<</span> <span class="ruby-value str">"'); "</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">empty?</span>
|
309
311
|
<span class="ruby-keyword kw">end</span>
|
@@ -312,21 +314,21 @@ engine for Perl
|
|
312
314
|
</div>
|
313
315
|
</div>
|
314
316
|
|
315
|
-
<div id="method-
|
316
|
-
<a name="
|
317
|
+
<div id="method-M000094" class="method-detail">
|
318
|
+
<a name="M000094"></a>
|
317
319
|
|
318
320
|
<div class="method-heading">
|
319
|
-
<a href="#
|
321
|
+
<a href="#M000094" class="method-signature">
|
320
322
|
<span class="method-name">escape_text</span><span class="method-args">(text)</span>
|
321
323
|
</a>
|
322
324
|
</div>
|
323
325
|
|
324
326
|
<div class="method-description">
|
325
327
|
<p><a class="source-toggle" href="#"
|
326
|
-
onclick="toggleCode('
|
327
|
-
<div class="method-source-code" id="
|
328
|
+
onclick="toggleCode('M000094-source');return false;">[Source]</a></p>
|
329
|
+
<div class="method-source-code" id="M000094-source">
|
328
330
|
<pre>
|
329
|
-
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line
|
331
|
+
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line 34</span>
|
330
332
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escape_text</span>(<span class="ruby-identifier">text</span>)
|
331
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">'\\\\\&'</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">text</span>
|
332
334
|
<span class="ruby-keyword kw">end</span>
|
@@ -335,6 +337,30 @@ engine for Perl
|
|
335
337
|
</div>
|
336
338
|
</div>
|
337
339
|
|
340
|
+
<div id="method-M000096" class="method-detail">
|
341
|
+
<a name="M000096"></a>
|
342
|
+
|
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
|
+
|
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">"escape(#{code.strip})"</span>
|
358
|
+
<span class="ruby-keyword kw">end</span>
|
359
|
+
</pre>
|
360
|
+
</div>
|
361
|
+
</div>
|
362
|
+
</div>
|
363
|
+
|
338
364
|
|
339
365
|
</div>
|
340
366
|
|
@@ -94,13 +94,15 @@ engine for PHP
|
|
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="#
|
102
|
-
<a href="#
|
103
|
-
<a href="#
|
97
|
+
<a href="#M000055">add_expr_debug</a>
|
98
|
+
<a href="#M000054">add_expr_escaped</a>
|
99
|
+
<a href="#M000053">add_expr_literal</a>
|
100
|
+
<a href="#M000057">add_postamble</a>
|
101
|
+
<a href="#M000049">add_preamble</a>
|
102
|
+
<a href="#M000056">add_stmt</a>
|
103
|
+
<a href="#M000051">add_text</a>
|
104
|
+
<a href="#M000050">escape_text</a>
|
105
|
+
<a href="#M000052">escaped_expr</a>
|
104
106
|
</div>
|
105
107
|
</div>
|
106
108
|
|
@@ -122,21 +124,21 @@ engine for PHP
|
|
122
124
|
<div id="methods">
|
123
125
|
<h3 class="section-bar">Public Instance methods</h3>
|
124
126
|
|
125
|
-
<div id="method-
|
126
|
-
<a name="
|
127
|
+
<div id="method-M000055" class="method-detail">
|
128
|
+
<a name="M000055"></a>
|
127
129
|
|
128
130
|
<div class="method-heading">
|
129
|
-
<a href="#
|
131
|
+
<a href="#M000055" class="method-signature">
|
130
132
|
<span class="method-name">add_expr_debug</span><span class="method-args">(src, code)</span>
|
131
133
|
</a>
|
132
134
|
</div>
|
133
135
|
|
134
136
|
<div class="method-description">
|
135
137
|
<p><a class="source-toggle" href="#"
|
136
|
-
onclick="toggleCode('
|
137
|
-
<div class="method-source-code" id="
|
138
|
+
onclick="toggleCode('M000055-source');return false;">[Source]</a></p>
|
139
|
+
<div class="method-source-code" id="M000055-source">
|
138
140
|
<pre>
|
139
|
-
<span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line
|
141
|
+
<span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line 48</span>
|
140
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>)
|
141
143
|
<span class="ruby-identifier">code</span>.<span class="ruby-identifier">strip!</span>
|
142
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">"\\'"</span>)
|
@@ -147,21 +149,21 @@ engine for PHP
|
|
147
149
|
</div>
|
148
150
|
</div>
|
149
151
|
|
150
|
-
<div id="method-
|
151
|
-
<a name="
|
152
|
+
<div id="method-M000054" class="method-detail">
|
153
|
+
<a name="M000054"></a>
|
152
154
|
|
153
155
|
<div class="method-heading">
|
154
|
-
<a href="#
|
156
|
+
<a href="#M000054" class="method-signature">
|
155
157
|
<span class="method-name">add_expr_escaped</span><span class="method-args">(src, code)</span>
|
156
158
|
</a>
|
157
159
|
</div>
|
158
160
|
|
159
161
|
<div class="method-description">
|
160
162
|
<p><a class="source-toggle" href="#"
|
161
|
-
onclick="toggleCode('
|
162
|
-
<div class="method-source-code" id="
|
163
|
+
onclick="toggleCode('M000054-source');return false;">[Source]</a></p>
|
164
|
+
<div class="method-source-code" id="M000054-source">
|
163
165
|
<pre>
|
164
|
-
<span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line
|
166
|
+
<span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line 44</span>
|
165
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>)
|
166
168
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"<?php echo #{escaped_expr(code)}; ?>"</span>
|
167
169
|
<span class="ruby-keyword kw">end</span>
|
@@ -170,21 +172,21 @@ engine for PHP
|
|
170
172
|
</div>
|
171
173
|
</div>
|
172
174
|
|
173
|
-
<div id="method-
|
174
|
-
<a name="
|
175
|
+
<div id="method-M000053" class="method-detail">
|
176
|
+
<a name="M000053"></a>
|
175
177
|
|
176
178
|
<div class="method-heading">
|
177
|
-
<a href="#
|
179
|
+
<a href="#M000053" class="method-signature">
|
178
180
|
<span class="method-name">add_expr_literal</span><span class="method-args">(src, code)</span>
|
179
181
|
</a>
|
180
182
|
</div>
|
181
183
|
|
182
184
|
<div class="method-description">
|
183
185
|
<p><a class="source-toggle" href="#"
|
184
|
-
onclick="toggleCode('
|
185
|
-
<div class="method-source-code" id="
|
186
|
+
onclick="toggleCode('M000053-source');return false;">[Source]</a></p>
|
187
|
+
<div class="method-source-code" id="M000053-source">
|
186
188
|
<pre>
|
187
|
-
<span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line
|
189
|
+
<span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line 40</span>
|
188
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>)
|
189
191
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"<?php echo #{code.strip}; ?>"</span>
|
190
192
|
<span class="ruby-keyword kw">end</span>
|
@@ -193,21 +195,67 @@ engine for PHP
|
|
193
195
|
</div>
|
194
196
|
</div>
|
195
197
|
|
196
|
-
<div id="method-
|
197
|
-
<a name="
|
198
|
+
<div id="method-M000057" class="method-detail">
|
199
|
+
<a name="M000057"></a>
|
198
200
|
|
199
201
|
<div class="method-heading">
|
200
|
-
<a href="#
|
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">
|
201
249
|
<span class="method-name">add_stmt</span><span class="method-args">(src, code)</span>
|
202
250
|
</a>
|
203
251
|
</div>
|
204
252
|
|
205
253
|
<div class="method-description">
|
206
254
|
<p><a class="source-toggle" href="#"
|
207
|
-
onclick="toggleCode('
|
208
|
-
<div class="method-source-code" id="
|
255
|
+
onclick="toggleCode('M000056-source');return false;">[Source]</a></p>
|
256
|
+
<div class="method-source-code" id="M000056-source">
|
209
257
|
<pre>
|
210
|
-
<span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line
|
258
|
+
<span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line 54</span>
|
211
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>)
|
212
260
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"<?php"</span>
|
213
261
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">" "</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>
|
@@ -223,21 +271,21 @@ engine for PHP
|
|
223
271
|
</div>
|
224
272
|
</div>
|
225
273
|
|
226
|
-
<div id="method-
|
227
|
-
<a name="
|
274
|
+
<div id="method-M000051" class="method-detail">
|
275
|
+
<a name="M000051"></a>
|
228
276
|
|
229
277
|
<div class="method-heading">
|
230
|
-
<a href="#
|
278
|
+
<a href="#M000051" class="method-signature">
|
231
279
|
<span class="method-name">add_text</span><span class="method-args">(src, text)</span>
|
232
280
|
</a>
|
233
281
|
</div>
|
234
282
|
|
235
283
|
<div class="method-description">
|
236
284
|
<p><a class="source-toggle" href="#"
|
237
|
-
onclick="toggleCode('
|
238
|
-
<div class="method-source-code" id="
|
285
|
+
onclick="toggleCode('M000051-source');return false;">[Source]</a></p>
|
286
|
+
<div class="method-source-code" id="M000051-source">
|
239
287
|
<pre>
|
240
|
-
<span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line
|
288
|
+
<span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line 31</span>
|
241
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>)
|
242
290
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">escape_text</span>(<span class="ruby-identifier">text</span>)
|
243
291
|
<span class="ruby-keyword kw">end</span>
|
@@ -246,21 +294,21 @@ engine for PHP
|
|
246
294
|
</div>
|
247
295
|
</div>
|
248
296
|
|
249
|
-
<div id="method-
|
250
|
-
<a name="
|
297
|
+
<div id="method-M000050" class="method-detail">
|
298
|
+
<a name="M000050"></a>
|
251
299
|
|
252
300
|
<div class="method-heading">
|
253
|
-
<a href="#
|
301
|
+
<a href="#M000050" class="method-signature">
|
254
302
|
<span class="method-name">escape_text</span><span class="method-args">(text)</span>
|
255
303
|
</a>
|
256
304
|
</div>
|
257
305
|
|
258
306
|
<div class="method-description">
|
259
307
|
<p><a class="source-toggle" href="#"
|
260
|
-
onclick="toggleCode('
|
261
|
-
<div class="method-source-code" id="
|
308
|
+
onclick="toggleCode('M000050-source');return false;">[Source]</a></p>
|
309
|
+
<div class="method-source-code" id="M000050-source">
|
262
310
|
<pre>
|
263
|
-
<span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line
|
311
|
+
<span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line 27</span>
|
264
312
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escape_text</span>(<span class="ruby-identifier">text</span>)
|
265
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">/<\?xml\b/</span>, <span class="ruby-value str">'<<?php ?>?xml'</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">text</span>
|
266
314
|
<span class="ruby-keyword kw">end</span>
|
@@ -269,21 +317,21 @@ engine for PHP
|
|
269
317
|
</div>
|
270
318
|
</div>
|
271
319
|
|
272
|
-
<div id="method-
|
273
|
-
<a name="
|
320
|
+
<div id="method-M000052" class="method-detail">
|
321
|
+
<a name="M000052"></a>
|
274
322
|
|
275
323
|
<div class="method-heading">
|
276
|
-
<a href="#
|
324
|
+
<a href="#M000052" class="method-signature">
|
277
325
|
<span class="method-name">escaped_expr</span><span class="method-args">(code)</span>
|
278
326
|
</a>
|
279
327
|
</div>
|
280
328
|
|
281
329
|
<div class="method-description">
|
282
330
|
<p><a class="source-toggle" href="#"
|
283
|
-
onclick="toggleCode('
|
284
|
-
<div class="method-source-code" id="
|
331
|
+
onclick="toggleCode('M000052-source');return false;">[Source]</a></p>
|
332
|
+
<div class="method-source-code" id="M000052-source">
|
285
333
|
<pre>
|
286
|
-
<span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line
|
334
|
+
<span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line 35</span>
|
287
335
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escaped_expr</span>(<span class="ruby-identifier">code</span>)
|
288
336
|
<span class="ruby-ivar">@escape</span> <span class="ruby-operator">||=</span> <span class="ruby-value str">'htmlspecialchars'</span>
|
289
337
|
<span class="ruby-keyword kw">return</span> <span class="ruby-node">"#{@escape}(#{code.strip})"</span>
|