erubis 2.6.4 → 2.6.5
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/CHANGES.txt +9 -2
- data/README.txt +1 -1
- data/benchmark/bench.rb +1 -2
- data/bin/erubis +1 -2
- data/contrib/erubis +43 -68
- data/contrib/inline-require +53 -27
- data/doc-api/classes/ActionView/TemplateHandlers/ErubisHandler.html +3 -3
- data/doc-api/classes/Erubis.html +1 -1
- data/doc-api/classes/Erubis/ArrayBufferEnhancer.html +2 -2
- data/doc-api/classes/Erubis/ArrayEnhancer.html +2 -2
- data/doc-api/classes/Erubis/Basic/Converter.html +4 -4
- data/doc-api/classes/Erubis/BiPatternEnhancer.html +2 -2
- data/doc-api/classes/Erubis/CGenerator.html +10 -10
- data/doc-api/classes/Erubis/Context.html +7 -7
- data/doc-api/classes/Erubis/Converter.html +4 -4
- data/doc-api/classes/Erubis/DeleteIndentEnhancer.html +1 -1
- data/doc-api/classes/Erubis/Engine.html +5 -5
- data/doc-api/classes/Erubis/ErboutEnhancer.html +2 -2
- data/doc-api/classes/Erubis/EscapeEnhancer.html +1 -1
- data/doc-api/classes/Erubis/Evaluator.html +3 -3
- data/doc-api/classes/Erubis/Generator.html +10 -10
- data/doc-api/classes/Erubis/HeaderFooterEnhancer.html +2 -2
- data/doc-api/classes/Erubis/Helpers/RailsFormHelper.html +25 -25
- data/doc-api/classes/Erubis/Helpers/RailsHelper.html +8 -8
- data/doc-api/classes/Erubis/Helpers/RailsHelper/TemplateConverter.html +4 -4
- data/doc-api/classes/Erubis/InterpolationEnhancer.html +5 -5
- data/doc-api/classes/Erubis/JavaGenerator.html +9 -9
- data/doc-api/classes/Erubis/JavascriptGenerator.html +10 -10
- data/doc-api/classes/Erubis/Main.html +6 -5
- data/doc-api/classes/Erubis/NoCodeEnhancer.html +5 -5
- data/doc-api/classes/Erubis/NoTextEnhancer.html +1 -1
- data/doc-api/classes/Erubis/OptimizedEruby.html +1 -1
- data/doc-api/classes/Erubis/OptimizedGenerator.html +12 -12
- data/doc-api/classes/Erubis/OptimizedXmlEruby.html +1 -1
- data/doc-api/classes/Erubis/PI/Converter.html +3 -3
- data/doc-api/classes/Erubis/PI/Ec.html +1 -1
- data/doc-api/classes/Erubis/PI/Ejava.html +1 -1
- data/doc-api/classes/Erubis/PI/Ejavascript.html +1 -1
- data/doc-api/classes/Erubis/PI/Eperl.html +1 -1
- data/doc-api/classes/Erubis/PI/Ephp.html +1 -1
- data/doc-api/classes/Erubis/PI/Eruby.html +1 -1
- data/doc-api/classes/Erubis/PI/Escheme.html +1 -1
- data/doc-api/classes/Erubis/PI/TinyEruby.html +4 -4
- data/doc-api/classes/Erubis/PercentLineEnhancer.html +1 -1
- data/doc-api/classes/Erubis/PerlGenerator.html +9 -9
- data/doc-api/classes/Erubis/PhpGenerator.html +9 -9
- data/doc-api/classes/Erubis/PreprocessingEruby.html +2 -2
- data/doc-api/classes/Erubis/PreprocessingHelper.html +3 -3
- data/doc-api/classes/Erubis/PrintEnabledEnhancer.html +3 -3
- data/doc-api/classes/Erubis/PrintOutEnhancer.html +5 -5
- data/doc-api/classes/Erubis/RubyEvaluator.html +3 -3
- data/doc-api/classes/Erubis/RubyGenerator.html +8 -8
- data/doc-api/classes/Erubis/SchemeGenerator.html +10 -10
- data/doc-api/classes/Erubis/SimplifyEnhancer.html +1 -1
- data/doc-api/classes/Erubis/StdoutEnhancer.html +2 -2
- data/doc-api/classes/Erubis/StringBufferEnhancer.html +2 -2
- data/doc-api/classes/Erubis/TinyEruby.html +7 -8
- data/doc-api/classes/Erubis/XmlHelper.html +3 -3
- data/doc-api/created.rid +1 -1
- data/doc-api/files/README_txt.html +2 -2
- data/doc-api/files/erubis/context_rb.html +2 -2
- data/doc-api/files/erubis/converter_rb.html +2 -2
- 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 +2 -2
- 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 +2 -2
- data/doc-api/files/erubis/engine/escheme_rb.html +2 -2
- 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 +2 -2
- data/doc-api/files/erubis/error_rb.html +2 -2
- data/doc-api/files/erubis/evaluator_rb.html +2 -2
- data/doc-api/files/erubis/generator_rb.html +2 -2
- data/doc-api/files/erubis/helper_rb.html +2 -2
- data/doc-api/files/erubis/helpers/rails_form_helper_rb.html +2 -2
- data/doc-api/files/erubis/helpers/rails_helper_rb.html +2 -2
- data/doc-api/files/erubis/local-setting_rb.html +2 -2
- data/doc-api/files/erubis/main_rb.html +2 -2
- data/doc-api/files/erubis/preprocessing_rb.html +2 -2
- data/doc-api/files/erubis/tiny_rb.html +2 -2
- data/doc-api/files/erubis_rb.html +2 -2
- data/doc/users-guide.html +6 -6
- data/lib/erubis.rb +2 -3
- data/lib/erubis/context.rb +1 -2
- data/lib/erubis/converter.rb +1 -2
- data/lib/erubis/engine.rb +1 -2
- data/lib/erubis/engine/ec.rb +1 -2
- data/lib/erubis/engine/ejava.rb +1 -2
- data/lib/erubis/engine/ejavascript.rb +1 -2
- data/lib/erubis/engine/enhanced.rb +1 -2
- data/lib/erubis/engine/eperl.rb +1 -2
- data/lib/erubis/engine/ephp.rb +1 -2
- data/lib/erubis/engine/eruby.rb +1 -2
- data/lib/erubis/engine/escheme.rb +1 -2
- data/lib/erubis/engine/optimized.rb +1 -2
- data/lib/erubis/enhancer.rb +1 -2
- data/lib/erubis/error.rb +1 -2
- data/lib/erubis/evaluator.rb +1 -2
- data/lib/erubis/generator.rb +1 -2
- data/lib/erubis/helper.rb +1 -2
- data/lib/erubis/helpers/rails_form_helper.rb +1 -2
- data/lib/erubis/helpers/rails_helper.rb +1 -2
- data/lib/erubis/local-setting.rb +1 -2
- data/lib/erubis/main.rb +18 -21
- data/lib/erubis/preprocessing.rb +1 -2
- data/lib/erubis/tiny.rb +4 -6
- data/test/assert-text-equal.rb +1 -2
- data/test/test-engines.rb +1 -2
- data/test/test-enhancers.rb +1 -2
- data/test/test-erubis.rb +1 -2
- data/test/test-main.rb +36 -16
- data/test/test-users-guide.rb +1 -2
- data/test/test.rb +1 -2
- data/test/testutil.rb +3 -8
- metadata +2 -2
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
onclick="toggleCode('M000171-source');return false;">[Source]</a></p>
|
|
133
133
|
<div class="method-source-code" id="M000171-source">
|
|
134
134
|
<pre>
|
|
135
|
-
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line
|
|
135
|
+
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line 72</span>
|
|
136
136
|
<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>)
|
|
137
137
|
<span class="ruby-identifier">add_indent</span>(<span class="ruby-identifier">src</span>, <span class="ruby-ivar">@indent</span>)
|
|
138
138
|
<span class="ruby-identifier">code</span>.<span class="ruby-identifier">strip!</span>
|
|
@@ -157,7 +157,7 @@
|
|
|
157
157
|
onclick="toggleCode('M000170-source');return false;">[Source]</a></p>
|
|
158
158
|
<div class="method-source-code" id="M000170-source">
|
|
159
159
|
<pre>
|
|
160
|
-
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line
|
|
160
|
+
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line 68</span>
|
|
161
161
|
<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>)
|
|
162
162
|
<span class="ruby-identifier">add_expr_literal</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">escaped_expr</span>(<span class="ruby-identifier">code</span>))
|
|
163
163
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -180,7 +180,7 @@
|
|
|
180
180
|
onclick="toggleCode('M000169-source');return false;">[Source]</a></p>
|
|
181
181
|
<div class="method-source-code" id="M000169-source">
|
|
182
182
|
<pre>
|
|
183
|
-
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line
|
|
183
|
+
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line 62</span>
|
|
184
184
|
<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>)
|
|
185
185
|
<span class="ruby-identifier">add_indent</span>(<span class="ruby-identifier">src</span>, <span class="ruby-ivar">@indent</span>)
|
|
186
186
|
<span class="ruby-identifier">code</span>.<span class="ruby-identifier">strip!</span>
|
|
@@ -205,7 +205,7 @@
|
|
|
205
205
|
onclick="toggleCode('M000166-source');return false;">[Source]</a></p>
|
|
206
206
|
<div class="method-source-code" id="M000166-source">
|
|
207
207
|
<pre>
|
|
208
|
-
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line
|
|
208
|
+
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line 41</span>
|
|
209
209
|
<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>)
|
|
210
210
|
<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>)
|
|
211
211
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -228,7 +228,7 @@
|
|
|
228
228
|
onclick="toggleCode('M000172-source');return false;">[Source]</a></p>
|
|
229
229
|
<div class="method-source-code" id="M000172-source">
|
|
230
230
|
<pre>
|
|
231
|
-
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line
|
|
231
|
+
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line 78</span>
|
|
232
232
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_postamble</span>(<span class="ruby-identifier">src</span>)
|
|
233
233
|
<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>
|
|
234
234
|
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@docwrite</span>
|
|
@@ -256,7 +256,7 @@
|
|
|
256
256
|
onclick="toggleCode('M000164-source');return false;">[Source]</a></p>
|
|
257
257
|
<div class="method-source-code" id="M000164-source">
|
|
258
258
|
<pre>
|
|
259
|
-
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line
|
|
259
|
+
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line 32</span>
|
|
260
260
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_preamble</span>(<span class="ruby-identifier">src</span>)
|
|
261
261
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{@indent}var #{@buf} = [];"</span>
|
|
262
262
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -279,7 +279,7 @@
|
|
|
279
279
|
onclick="toggleCode('M000168-source');return false;">[Source]</a></p>
|
|
280
280
|
<div class="method-source-code" id="M000168-source">
|
|
281
281
|
<pre>
|
|
282
|
-
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line
|
|
282
|
+
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line 58</span>
|
|
283
283
|
<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>)
|
|
284
284
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">code</span>
|
|
285
285
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -302,7 +302,7 @@
|
|
|
302
302
|
onclick="toggleCode('M000167-source');return false;">[Source]</a></p>
|
|
303
303
|
<div class="method-source-code" id="M000167-source">
|
|
304
304
|
<pre>
|
|
305
|
-
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line
|
|
305
|
+
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line 45</span>
|
|
306
306
|
<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>)
|
|
307
307
|
<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>
|
|
308
308
|
<span class="ruby-identifier">add_indent</span>(<span class="ruby-identifier">src</span>, <span class="ruby-ivar">@indent</span>)
|
|
@@ -334,7 +334,7 @@
|
|
|
334
334
|
onclick="toggleCode('M000165-source');return false;">[Source]</a></p>
|
|
335
335
|
<div class="method-source-code" id="M000165-source">
|
|
336
336
|
<pre>
|
|
337
|
-
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line
|
|
337
|
+
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line 36</span>
|
|
338
338
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escape_text</span>(<span class="ruby-identifier">text</span>)
|
|
339
339
|
<span class="ruby-ivar">@@table_</span> <span class="ruby-operator">||=</span> { <span class="ruby-value str">"\r"</span>=<span class="ruby-operator">></span><span class="ruby-value str">"\\r"</span>, <span class="ruby-value str">"\n"</span>=<span class="ruby-operator">></span><span class="ruby-value str">"\\n\\\n"</span>, <span class="ruby-value str">"\t"</span>=<span class="ruby-operator">></span><span class="ruby-value str">"\\t"</span>, <span class="ruby-value str">'"'</span>=<span class="ruby-operator">></span><span class="ruby-value str">'\\"'</span>, <span class="ruby-value str">"\\"</span>=<span class="ruby-operator">></span><span class="ruby-value str">"\\\\"</span> }
|
|
340
340
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/[\r\n\t"\\]/</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@@table_</span>[<span class="ruby-identifier">m</span>] } <span class="ruby-operator">||</span> <span class="ruby-identifier">text</span>
|
|
@@ -358,7 +358,7 @@
|
|
|
358
358
|
onclick="toggleCode('M000163-source');return false;">[Source]</a></p>
|
|
359
359
|
<div class="method-source-code" id="M000163-source">
|
|
360
360
|
<pre>
|
|
361
|
-
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line
|
|
361
|
+
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line 24</span>
|
|
362
362
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">init_generator</span>(<span class="ruby-identifier">properties</span>={})
|
|
363
363
|
<span class="ruby-keyword kw">super</span>
|
|
364
364
|
<span class="ruby-ivar">@escapefunc</span> <span class="ruby-operator">||=</span> <span class="ruby-value str">'escape'</span>
|
|
@@ -136,7 +136,7 @@ ex.
|
|
|
136
136
|
onclick="toggleCode('M000215-source');return false;">[Source]</a></p>
|
|
137
137
|
<div class="method-source-code" id="M000215-source">
|
|
138
138
|
<pre>
|
|
139
|
-
<span class="ruby-comment cmt"># File erubis/main.rb, line
|
|
139
|
+
<span class="ruby-comment cmt"># File erubis/main.rb, line 39</span>
|
|
140
140
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">main</span>(<span class="ruby-identifier">argv</span>=<span class="ruby-constant">ARGV</span>)
|
|
141
141
|
<span class="ruby-identifier">status</span> = <span class="ruby-value">0</span>
|
|
142
142
|
<span class="ruby-keyword kw">begin</span>
|
|
@@ -166,7 +166,7 @@ ex.
|
|
|
166
166
|
onclick="toggleCode('M000216-source');return false;">[Source]</a></p>
|
|
167
167
|
<div class="method-source-code" id="M000216-source">
|
|
168
168
|
<pre>
|
|
169
|
-
<span class="ruby-comment cmt"># File erubis/main.rb, line
|
|
169
|
+
<span class="ruby-comment cmt"># File erubis/main.rb, line 50</span>
|
|
170
170
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
|
|
171
171
|
<span class="ruby-ivar">@single_options</span> = <span class="ruby-value str">"hvxztTSbeBXNUC"</span>
|
|
172
172
|
<span class="ruby-ivar">@arg_options</span> = <span class="ruby-value str">"pcrfKIlaE"</span> <span class="ruby-comment cmt">#C</span>
|
|
@@ -222,14 +222,14 @@ ex.
|
|
|
222
222
|
onclick="toggleCode('M000217-source');return false;">[Source]</a></p>
|
|
223
223
|
<div class="method-source-code" id="M000217-source">
|
|
224
224
|
<pre>
|
|
225
|
-
<span class="ruby-comment cmt"># File erubis/main.rb, line
|
|
225
|
+
<span class="ruby-comment cmt"># File erubis/main.rb, line 86</span>
|
|
226
226
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">execute</span>(<span class="ruby-identifier">argv</span>=<span class="ruby-constant">ARGV</span>)
|
|
227
227
|
<span class="ruby-comment cmt">## parse command-line options</span>
|
|
228
228
|
<span class="ruby-identifier">options</span>, <span class="ruby-identifier">properties</span> = <span class="ruby-identifier">parse_argv</span>(<span class="ruby-identifier">argv</span>, <span class="ruby-ivar">@single_options</span>, <span class="ruby-ivar">@arg_options</span>)
|
|
229
229
|
<span class="ruby-identifier">filenames</span> = <span class="ruby-identifier">argv</span>
|
|
230
230
|
<span class="ruby-identifier">options</span>[<span class="ruby-value str">'h'</span>] = <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:help</span>]
|
|
231
231
|
<span class="ruby-identifier">opts</span> = <span class="ruby-constant">Object</span>.<span class="ruby-identifier">new</span>
|
|
232
|
-
<span class="ruby-identifier">arr</span> = <span class="ruby-ivar">@option_names</span>.<span class="ruby-identifier">collect</span> {
|
|
232
|
+
<span class="ruby-identifier">arr</span> = <span class="ruby-ivar">@option_names</span>.<span class="ruby-identifier">collect</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">ch</span>, <span class="ruby-identifier">name</span><span class="ruby-operator">|</span> <span class="ruby-node">"def #{name}; @#{name}; end\n"</span> }
|
|
233
233
|
<span class="ruby-identifier">opts</span>.<span class="ruby-identifier">instance_eval</span> <span class="ruby-identifier">arr</span>.<span class="ruby-identifier">join</span>
|
|
234
234
|
<span class="ruby-identifier">options</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ch</span>, <span class="ruby-identifier">val</span><span class="ruby-operator">|</span>
|
|
235
235
|
<span class="ruby-identifier">name</span> = <span class="ruby-ivar">@option_names</span>[<span class="ruby-identifier">ch</span>]
|
|
@@ -305,7 +305,8 @@ ex.
|
|
|
305
305
|
<span class="ruby-identifier">msg</span> = <span class="ruby-value str">"Syntax OK\n"</span>
|
|
306
306
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">filenames</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">filenames</span>.<span class="ruby-identifier">empty?</span>
|
|
307
307
|
<span class="ruby-identifier">filenames</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">filename</span><span class="ruby-operator">|</span>
|
|
308
|
-
<span class="ruby-
|
|
308
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-identifier">filename</span>) <span class="ruby-keyword kw">or</span>
|
|
309
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">CommandOptionError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">"#{filename}: file not found."</span>)
|
|
309
310
|
<span class="ruby-identifier">engine</span>.<span class="ruby-identifier">filename</span> = <span class="ruby-identifier">filename</span>
|
|
310
311
|
<span class="ruby-identifier">engine</span>.<span class="ruby-identifier">convert!</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">filename</span>))
|
|
311
312
|
<span class="ruby-identifier">val</span> = <span class="ruby-identifier">do_action</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">engine</span>, <span class="ruby-identifier">context</span>, <span class="ruby-identifier">filename</span>, <span class="ruby-identifier">opts</span>)
|
|
@@ -135,7 +135,7 @@ this is language independent.
|
|
|
135
135
|
onclick="toggleCode('M000007-source');return false;">[Source]</a></p>
|
|
136
136
|
<div class="method-source-code" id="M000007-source">
|
|
137
137
|
<pre>
|
|
138
|
-
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line
|
|
138
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 317</span>
|
|
139
139
|
<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>)
|
|
140
140
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"\n"</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">code</span>.<span class="ruby-identifier">count</span>(<span class="ruby-value str">"\n"</span>)
|
|
141
141
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -158,7 +158,7 @@ this is language independent.
|
|
|
158
158
|
onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
|
|
159
159
|
<div class="method-source-code" id="M000005-source">
|
|
160
160
|
<pre>
|
|
161
|
-
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line
|
|
161
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 310</span>
|
|
162
162
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_postamble</span>(<span class="ruby-identifier">src</span>)
|
|
163
163
|
<span class="ruby-keyword kw">end</span>
|
|
164
164
|
</pre>
|
|
@@ -180,7 +180,7 @@ this is language independent.
|
|
|
180
180
|
onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
|
|
181
181
|
<div class="method-source-code" id="M000004-source">
|
|
182
182
|
<pre>
|
|
183
|
-
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line
|
|
183
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 307</span>
|
|
184
184
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_preamble</span>(<span class="ruby-identifier">src</span>)
|
|
185
185
|
<span class="ruby-keyword kw">end</span>
|
|
186
186
|
</pre>
|
|
@@ -202,7 +202,7 @@ this is language independent.
|
|
|
202
202
|
onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
|
|
203
203
|
<div class="method-source-code" id="M000008-source">
|
|
204
204
|
<pre>
|
|
205
|
-
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line
|
|
205
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 321</span>
|
|
206
206
|
<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>)
|
|
207
207
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"\n"</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">code</span>.<span class="ruby-identifier">count</span>(<span class="ruby-value str">"\n"</span>)
|
|
208
208
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -225,7 +225,7 @@ this is language independent.
|
|
|
225
225
|
onclick="toggleCode('M000006-source');return false;">[Source]</a></p>
|
|
226
226
|
<div class="method-source-code" id="M000006-source">
|
|
227
227
|
<pre>
|
|
228
|
-
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line
|
|
228
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 313</span>
|
|
229
229
|
<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>)
|
|
230
230
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">text</span>
|
|
231
231
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -131,7 +131,7 @@ this is language independent.
|
|
|
131
131
|
onclick="toggleCode('M000174-source');return false;">[Source]</a></p>
|
|
132
132
|
<div class="method-source-code" id="M000174-source">
|
|
133
133
|
<pre>
|
|
134
|
-
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line
|
|
134
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 282</span>
|
|
135
135
|
<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>)
|
|
136
136
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> (<span class="ruby-value str">"\n"</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">count</span>(<span class="ruby-value str">"\n"</span>))
|
|
137
137
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">text</span>[<span class="ruby-value">-1</span>] <span class="ruby-operator">!=</span> <span class="ruby-value">?\n</span>
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
onclick="toggleCode('M000214-source');return false;">[Source]</a></p>
|
|
139
139
|
<div class="method-source-code" id="M000214-source">
|
|
140
140
|
<pre>
|
|
141
|
-
<span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line
|
|
141
|
+
<span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line 106</span>
|
|
142
142
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">init_converter</span>(<span class="ruby-identifier">properties</span>={})
|
|
143
143
|
<span class="ruby-ivar">@pi</span> = <span class="ruby-value str">'rb'</span>
|
|
144
144
|
<span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">properties</span>)
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
onclick="toggleCode('M000023-source');return false;">[Source]</a></p>
|
|
135
135
|
<div class="method-source-code" id="M000023-source">
|
|
136
136
|
<pre>
|
|
137
|
-
<span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line
|
|
137
|
+
<span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line 20</span>
|
|
138
138
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">init_generator</span>(<span class="ruby-identifier">properties</span>={})
|
|
139
139
|
<span class="ruby-keyword kw">super</span>
|
|
140
140
|
<span class="ruby-ivar">@escapefunc</span> <span class="ruby-operator">||=</span> <span class="ruby-value str">"Erubis::XmlHelper.escape_xml"</span>
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
onclick="toggleCode('M000033-source');return false;">[Source]</a></p>
|
|
163
163
|
<div class="method-source-code" id="M000033-source">
|
|
164
164
|
<pre>
|
|
165
|
-
<span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line
|
|
165
|
+
<span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line 85</span>
|
|
166
166
|
<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>)
|
|
167
167
|
<span class="ruby-identifier">code</span>.<span class="ruby-identifier">strip!</span>
|
|
168
168
|
<span class="ruby-identifier">s</span> = (<span class="ruby-identifier">code</span>.<span class="ruby-identifier">dump</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\A"(.*)"\z/</span>) <span class="ruby-operator">&&</span> <span class="ruby-identifier">$1</span>
|
|
@@ -187,7 +187,7 @@
|
|
|
187
187
|
onclick="toggleCode('M000032-source');return false;">[Source]</a></p>
|
|
188
188
|
<div class="method-source-code" id="M000032-source">
|
|
189
189
|
<pre>
|
|
190
|
-
<span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line
|
|
190
|
+
<span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line 79</span>
|
|
191
191
|
<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>)
|
|
192
192
|
<span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@initialized</span>; <span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"_buf = ''"</span>; <span class="ruby-ivar">@initialized</span> = <span class="ruby-keyword kw">true</span>; <span class="ruby-keyword kw">end</span>
|
|
193
193
|
<span class="ruby-identifier">switch_to_expr</span>(<span class="ruby-identifier">src</span>)
|
|
@@ -212,7 +212,7 @@
|
|
|
212
212
|
onclick="toggleCode('M000031-source');return false;">[Source]</a></p>
|
|
213
213
|
<div class="method-source-code" id="M000031-source">
|
|
214
214
|
<pre>
|
|
215
|
-
<span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line
|
|
215
|
+
<span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line 73</span>
|
|
216
216
|
<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
217
|
<span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@initialized</span>; <span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"_buf = ''"</span>; <span class="ruby-ivar">@initialized</span> = <span class="ruby-keyword kw">true</span>; <span class="ruby-keyword kw">end</span>
|
|
218
218
|
<span class="ruby-identifier">switch_to_expr</span>(<span class="ruby-identifier">src</span>)
|
|
@@ -237,7 +237,7 @@
|
|
|
237
237
|
onclick="toggleCode('M000034-source');return false;">[Source]</a></p>
|
|
238
238
|
<div class="method-source-code" id="M000034-source">
|
|
239
239
|
<pre>
|
|
240
|
-
<span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line
|
|
240
|
+
<span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line 91</span>
|
|
241
241
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_postamble</span>(<span class="ruby-identifier">src</span>)
|
|
242
242
|
<span class="ruby-comment cmt">#super if @initialized</span>
|
|
243
243
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"\n_buf\n"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@initialized</span>
|
|
@@ -261,7 +261,7 @@
|
|
|
261
261
|
onclick="toggleCode('M000028-source');return false;">[Source]</a></p>
|
|
262
262
|
<div class="method-source-code" id="M000028-source">
|
|
263
263
|
<pre>
|
|
264
|
-
<span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line
|
|
264
|
+
<span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line 50</span>
|
|
265
265
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_preamble</span>(<span class="ruby-identifier">src</span>)
|
|
266
266
|
<span class="ruby-comment cmt">#@initialized = false</span>
|
|
267
267
|
<span class="ruby-comment cmt">#@prev_is_expr = false</span>
|
|
@@ -285,7 +285,7 @@
|
|
|
285
285
|
onclick="toggleCode('M000030-source');return false;">[Source]</a></p>
|
|
286
286
|
<div class="method-source-code" id="M000030-source">
|
|
287
287
|
<pre>
|
|
288
|
-
<span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line
|
|
288
|
+
<span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line 66</span>
|
|
289
289
|
<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>)
|
|
290
290
|
<span class="ruby-identifier">switch_to_stmt</span>(<span class="ruby-identifier">src</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@initialized</span>
|
|
291
291
|
<span class="ruby-comment cmt">#super</span>
|
|
@@ -311,7 +311,7 @@
|
|
|
311
311
|
onclick="toggleCode('M000029-source');return false;">[Source]</a></p>
|
|
312
312
|
<div class="method-source-code" id="M000029-source">
|
|
313
313
|
<pre>
|
|
314
|
-
<span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line
|
|
314
|
+
<span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line 55</span>
|
|
315
315
|
<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>)
|
|
316
316
|
<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>
|
|
317
317
|
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@initialized</span>
|
|
@@ -341,7 +341,7 @@
|
|
|
341
341
|
onclick="toggleCode('M000024-source');return false;">[Source]</a></p>
|
|
342
342
|
<div class="method-source-code" id="M000024-source">
|
|
343
343
|
<pre>
|
|
344
|
-
<span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line
|
|
344
|
+
<span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line 29</span>
|
|
345
345
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escape_text</span>(<span class="ruby-identifier">text</span>)
|
|
346
346
|
<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-comment cmt"># "'" => "\\'", '\\' => '\\\\'</span>
|
|
347
347
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -364,7 +364,7 @@
|
|
|
364
364
|
onclick="toggleCode('M000025-source');return false;">[Source]</a></p>
|
|
365
365
|
<div class="method-source-code" id="M000025-source">
|
|
366
366
|
<pre>
|
|
367
|
-
<span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line
|
|
367
|
+
<span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line 33</span>
|
|
368
368
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escaped_expr</span>(<span class="ruby-identifier">code</span>)
|
|
369
369
|
<span class="ruby-ivar">@escapefunc</span> <span class="ruby-operator">||=</span> <span class="ruby-value str">'Erubis::XmlHelper.escape_xml'</span>
|
|
370
370
|
<span class="ruby-keyword kw">return</span> <span class="ruby-node">"#{@escapefunc}(#{code})"</span>
|
|
@@ -388,7 +388,7 @@
|
|
|
388
388
|
onclick="toggleCode('M000026-source');return false;">[Source]</a></p>
|
|
389
389
|
<div class="method-source-code" id="M000026-source">
|
|
390
390
|
<pre>
|
|
391
|
-
<span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line
|
|
391
|
+
<span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line 38</span>
|
|
392
392
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">switch_to_expr</span>(<span class="ruby-identifier">src</span>)
|
|
393
393
|
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@prev_is_expr</span>
|
|
394
394
|
<span class="ruby-ivar">@prev_is_expr</span> = <span class="ruby-keyword kw">true</span>
|
|
@@ -413,7 +413,7 @@
|
|
|
413
413
|
onclick="toggleCode('M000027-source');return false;">[Source]</a></p>
|
|
414
414
|
<div class="method-source-code" id="M000027-source">
|
|
415
415
|
<pre>
|
|
416
|
-
<span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line
|
|
416
|
+
<span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line 44</span>
|
|
417
417
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">switch_to_stmt</span>(<span class="ruby-identifier">src</span>)
|
|
418
418
|
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@prev_is_expr</span>
|
|
419
419
|
<span class="ruby-ivar">@prev_is_expr</span> = <span class="ruby-keyword kw">false</span>
|
|
@@ -138,7 +138,7 @@ code
|
|
|
138
138
|
onclick="toggleCode('M000225-source');return false;">[Source]</a></p>
|
|
139
139
|
<div class="method-source-code" id="M000225-source">
|
|
140
140
|
<pre>
|
|
141
|
-
<span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line
|
|
141
|
+
<span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line 120</span>
|
|
142
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
143
|
<span class="ruby-identifier">switch_to_stmt</span>(<span class="ruby-identifier">src</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">indicator</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'==='</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@initialized</span>
|
|
144
144
|
<span class="ruby-keyword kw">super</span>
|
|
@@ -151,7 +151,7 @@ this class converts ’<?rb … ?>’ and
|
|
|
151
151
|
onclick="toggleCode('M000046-source');return false;">[Source]</a></p>
|
|
152
152
|
<div class="method-source-code" id="M000046-source">
|
|
153
153
|
<pre>
|
|
154
|
-
<span class="ruby-comment cmt"># File erubis/converter.rb, line
|
|
154
|
+
<span class="ruby-comment cmt"># File erubis/converter.rb, line 224</span>
|
|
155
155
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">convert</span>(<span class="ruby-identifier">input</span>)
|
|
156
156
|
<span class="ruby-identifier">code</span> = <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">input</span>)
|
|
157
157
|
<span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@header</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@footer</span> <span class="ruby-operator">?</span> <span class="ruby-node">"#{@header}#{code}#{@footer}"</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">code</span>
|
|
@@ -175,7 +175,7 @@ this class converts ’<?rb … ?>’ and
|
|
|
175
175
|
onclick="toggleCode('M000045-source');return false;">[Source]</a></p>
|
|
176
176
|
<div class="method-source-code" id="M000045-source">
|
|
177
177
|
<pre>
|
|
178
|
-
<span class="ruby-comment cmt"># File erubis/converter.rb, line
|
|
178
|
+
<span class="ruby-comment cmt"># File erubis/converter.rb, line 215</span>
|
|
179
179
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">init_converter</span>(<span class="ruby-identifier">properties</span>={})
|
|
180
180
|
<span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">properties</span>)
|
|
181
181
|
<span class="ruby-ivar">@trim</span> = <span class="ruby-identifier">properties</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">:trim</span>, <span class="ruby-keyword kw">true</span>)
|
|
@@ -205,7 +205,7 @@ this class converts ’<?rb … ?>’ and
|
|
|
205
205
|
onclick="toggleCode('M000047-source');return false;">[Source]</a></p>
|
|
206
206
|
<div class="method-source-code" id="M000047-source">
|
|
207
207
|
<pre>
|
|
208
|
-
<span class="ruby-comment cmt"># File erubis/converter.rb, line
|
|
208
|
+
<span class="ruby-comment cmt"># File erubis/converter.rb, line 231</span>
|
|
209
209
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">convert_input</span>(<span class="ruby-identifier">codebuf</span>, <span class="ruby-identifier">input</span>)
|
|
210
210
|
<span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@regexp</span>
|
|
211
211
|
<span class="ruby-ivar">@pi</span> <span class="ruby-operator">||=</span> <span class="ruby-value str">'e'</span>
|
|
@@ -141,7 +141,7 @@ end
|
|
|
141
141
|
onclick="toggleCode('M000055-source');return false;">[Source]</a></p>
|
|
142
142
|
<div class="method-source-code" id="M000055-source">
|
|
143
143
|
<pre>
|
|
144
|
-
<span class="ruby-comment cmt"># File erubis/engine/ec.rb, line
|
|
144
|
+
<span class="ruby-comment cmt"># File erubis/engine/ec.rb, line 109</span>
|
|
145
145
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">init_converter</span>(<span class="ruby-identifier">properties</span>={})
|
|
146
146
|
<span class="ruby-ivar">@pi</span> = <span class="ruby-value str">'c'</span>
|
|
147
147
|
<span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">properties</span>)
|
|
@@ -141,7 +141,7 @@ end
|
|
|
141
141
|
onclick="toggleCode('M000049-source');return false;">[Source]</a></p>
|
|
142
142
|
<div class="method-source-code" id="M000049-source">
|
|
143
143
|
<pre>
|
|
144
|
-
<span class="ruby-comment cmt"># File erubis/engine/ejava.rb, line
|
|
144
|
+
<span class="ruby-comment cmt"># File erubis/engine/ejava.rb, line 103</span>
|
|
145
145
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">init_converter</span>(<span class="ruby-identifier">properties</span>={})
|
|
146
146
|
<span class="ruby-ivar">@pi</span> = <span class="ruby-value str">'java'</span>
|
|
147
147
|
<span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">properties</span>)
|
|
@@ -141,7 +141,7 @@ end
|
|
|
141
141
|
onclick="toggleCode('M000056-source');return false;">[Source]</a></p>
|
|
142
142
|
<div class="method-source-code" id="M000056-source">
|
|
143
143
|
<pre>
|
|
144
|
-
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line
|
|
144
|
+
<span class="ruby-comment cmt"># File erubis/engine/ejavascript.rb, line 111</span>
|
|
145
145
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">init_converter</span>(<span class="ruby-identifier">properties</span>={})
|
|
146
146
|
<span class="ruby-ivar">@pi</span> = <span class="ruby-value str">'js'</span>
|
|
147
147
|
<span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">properties</span>)
|
|
@@ -141,7 +141,7 @@ end
|
|
|
141
141
|
onclick="toggleCode('M000054-source');return false;">[Source]</a></p>
|
|
142
142
|
<div class="method-source-code" id="M000054-source">
|
|
143
143
|
<pre>
|
|
144
|
-
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line
|
|
144
|
+
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line 87</span>
|
|
145
145
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">init_converter</span>(<span class="ruby-identifier">properties</span>={})
|
|
146
146
|
<span class="ruby-ivar">@pi</span> = <span class="ruby-value str">'perl'</span>
|
|
147
147
|
<span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">properties</span>)
|
|
@@ -141,7 +141,7 @@ end
|
|
|
141
141
|
onclick="toggleCode('M000058-source');return false;">[Source]</a></p>
|
|
142
142
|
<div class="method-source-code" id="M000058-source">
|
|
143
143
|
<pre>
|
|
144
|
-
<span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line
|
|
144
|
+
<span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line 91</span>
|
|
145
145
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">init_converter</span>(<span class="ruby-identifier">properties</span>={})
|
|
146
146
|
<span class="ruby-ivar">@pi</span> = <span class="ruby-value str">'php'</span>
|
|
147
147
|
<span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">properties</span>)
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
onclick="toggleCode('M000048-source');return false;">[Source]</a></p>
|
|
131
131
|
<div class="method-source-code" id="M000048-source">
|
|
132
132
|
<pre>
|
|
133
|
-
<span class="ruby-comment cmt"># File erubis/engine/eruby.rb, line
|
|
133
|
+
<span class="ruby-comment cmt"># File erubis/engine/eruby.rb, line 116</span>
|
|
134
134
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">init_converter</span>(<span class="ruby-identifier">properties</span>={})
|
|
135
135
|
<span class="ruby-ivar">@pi</span> = <span class="ruby-value str">'rb'</span>
|
|
136
136
|
<span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">properties</span>)
|
|
@@ -141,7 +141,7 @@ end
|
|
|
141
141
|
onclick="toggleCode('M000057-source');return false;">[Source]</a></p>
|
|
142
142
|
<div class="method-source-code" id="M000057-source">
|
|
143
143
|
<pre>
|
|
144
|
-
<span class="ruby-comment cmt"># File erubis/engine/escheme.rb, line
|
|
144
|
+
<span class="ruby-comment cmt"># File erubis/engine/escheme.rb, line 106</span>
|
|
145
145
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">init_converter</span>(<span class="ruby-identifier">properties</span>={})
|
|
146
146
|
<span class="ruby-ivar">@pi</span> = <span class="ruby-value str">'scheme'</span>
|
|
147
147
|
<span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">properties</span>)
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
onclick="toggleCode('M000050-source');return false;">[Source]</a></p>
|
|
152
152
|
<div class="method-source-code" id="M000050-source">
|
|
153
153
|
<pre>
|
|
154
|
-
<span class="ruby-comment cmt"># File erubis/tiny.rb, line
|
|
154
|
+
<span class="ruby-comment cmt"># File erubis/tiny.rb, line 79</span>
|
|
155
155
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">input</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">options</span>={})
|
|
156
156
|
<span class="ruby-ivar">@escape</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:escape</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">'Erubis::XmlHelper.escape_xml'</span>
|
|
157
157
|
<span class="ruby-ivar">@src</span> = <span class="ruby-identifier">convert</span>(<span class="ruby-identifier">input</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">input</span>
|
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
onclick="toggleCode('M000051-source');return false;">[Source]</a></p>
|
|
178
178
|
<div class="method-source-code" id="M000051-source">
|
|
179
179
|
<pre>
|
|
180
|
-
<span class="ruby-comment cmt"># File erubis/tiny.rb, line
|
|
180
|
+
<span class="ruby-comment cmt"># File erubis/tiny.rb, line 88</span>
|
|
181
181
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">convert</span>(<span class="ruby-identifier">input</span>)
|
|
182
182
|
<span class="ruby-identifier">src</span> = <span class="ruby-value str">"_buf = '';"</span> <span class="ruby-comment cmt"># preamble</span>
|
|
183
183
|
<span class="ruby-identifier">pos</span> = <span class="ruby-value">0</span>
|
|
@@ -232,7 +232,7 @@
|
|
|
232
232
|
onclick="toggleCode('M000053-source');return false;">[Source]</a></p>
|
|
233
233
|
<div class="method-source-code" id="M000053-source">
|
|
234
234
|
<pre>
|
|
235
|
-
<span class="ruby-comment cmt"># File erubis/tiny.rb, line
|
|
235
|
+
<span class="ruby-comment cmt"># File erubis/tiny.rb, line 132</span>
|
|
236
236
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">evaluate</span>(<span class="ruby-identifier">_context</span>=<span class="ruby-constant">Object</span>.<span class="ruby-identifier">new</span>)
|
|
237
237
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">_context</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
|
|
238
238
|
<span class="ruby-identifier">_obj</span> = <span class="ruby-constant">Object</span>.<span class="ruby-identifier">new</span>
|
|
@@ -269,7 +269,7 @@ end
|
|
|
269
269
|
onclick="toggleCode('M000052-source');return false;">[Source]</a></p>
|
|
270
270
|
<div class="method-source-code" id="M000052-source">
|
|
271
271
|
<pre>
|
|
272
|
-
<span class="ruby-comment cmt"># File erubis/tiny.rb, line
|
|
272
|
+
<span class="ruby-comment cmt"># File erubis/tiny.rb, line 128</span>
|
|
273
273
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">result</span>(<span class="ruby-identifier">_binding</span>=<span class="ruby-constant">TOPLEVEL_BINDING</span>)
|
|
274
274
|
<span class="ruby-identifier">eval</span> <span class="ruby-ivar">@src</span>, <span class="ruby-identifier">_binding</span>
|
|
275
275
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -128,7 +128,7 @@ this is language-independent.
|
|
|
128
128
|
onclick="toggleCode('M000173-source');return false;">[Source]</a></p>
|
|
129
129
|
<div class="method-source-code" id="M000173-source">
|
|
130
130
|
<pre>
|
|
131
|
-
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line
|
|
131
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 449</span>
|
|
132
132
|
<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>)
|
|
133
133
|
<span class="ruby-identifier">pos</span> = <span class="ruby-value">0</span>
|
|
134
134
|
<span class="ruby-identifier">text2</span> = <span class="ruby-value str">''</span>
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
onclick="toggleCode('M000160-source');return false;">[Source]</a></p>
|
|
132
132
|
<div class="method-source-code" id="M000160-source">
|
|
133
133
|
<pre>
|
|
134
|
-
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line
|
|
134
|
+
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line 49</span>
|
|
135
135
|
<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>)
|
|
136
136
|
<span class="ruby-identifier">code</span>.<span class="ruby-identifier">strip!</span>
|
|
137
137
|
<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>)
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
onclick="toggleCode('M000159-source');return false;">[Source]</a></p>
|
|
157
157
|
<div class="method-source-code" id="M000159-source">
|
|
158
158
|
<pre>
|
|
159
|
-
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line
|
|
159
|
+
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line 45</span>
|
|
160
160
|
<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>)
|
|
161
161
|
<span class="ruby-identifier">add_expr_literal</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">escaped_expr</span>(<span class="ruby-identifier">code</span>))
|
|
162
162
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -179,7 +179,7 @@
|
|
|
179
179
|
onclick="toggleCode('M000158-source');return false;">[Source]</a></p>
|
|
180
180
|
<div class="method-source-code" id="M000158-source">
|
|
181
181
|
<pre>
|
|
182
|
-
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line
|
|
182
|
+
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line 40</span>
|
|
183
183
|
<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>)
|
|
184
184
|
<span class="ruby-identifier">code</span>.<span class="ruby-identifier">strip!</span>
|
|
185
185
|
<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-operator"><<</span> <span class="ruby-value str">"); "</span>
|
|
@@ -203,7 +203,7 @@
|
|
|
203
203
|
onclick="toggleCode('M000162-source');return false;">[Source]</a></p>
|
|
204
204
|
<div class="method-source-code" id="M000162-source">
|
|
205
205
|
<pre>
|
|
206
|
-
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line
|
|
206
|
+
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line 59</span>
|
|
207
207
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_postamble</span>(<span class="ruby-identifier">src</span>)
|
|
208
208
|
<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>
|
|
209
209
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -226,7 +226,7 @@
|
|
|
226
226
|
onclick="toggleCode('M000155-source');return false;">[Source]</a></p>
|
|
227
227
|
<div class="method-source-code" id="M000155-source">
|
|
228
228
|
<pre>
|
|
229
|
-
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line
|
|
229
|
+
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line 28</span>
|
|
230
230
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_preamble</span>(<span class="ruby-identifier">src</span>)
|
|
231
231
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"use HTML::Entities; "</span>;
|
|
232
232
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -249,7 +249,7 @@
|
|
|
249
249
|
onclick="toggleCode('M000161-source');return false;">[Source]</a></p>
|
|
250
250
|
<div class="method-source-code" id="M000161-source">
|
|
251
251
|
<pre>
|
|
252
|
-
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line
|
|
252
|
+
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line 55</span>
|
|
253
253
|
<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>)
|
|
254
254
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">code</span>
|
|
255
255
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -272,7 +272,7 @@
|
|
|
272
272
|
onclick="toggleCode('M000157-source');return false;">[Source]</a></p>
|
|
273
273
|
<div class="method-source-code" id="M000157-source">
|
|
274
274
|
<pre>
|
|
275
|
-
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line
|
|
275
|
+
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line 36</span>
|
|
276
276
|
<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>)
|
|
277
277
|
<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>
|
|
278
278
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -295,7 +295,7 @@
|
|
|
295
295
|
onclick="toggleCode('M000156-source');return false;">[Source]</a></p>
|
|
296
296
|
<div class="method-source-code" id="M000156-source">
|
|
297
297
|
<pre>
|
|
298
|
-
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line
|
|
298
|
+
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line 32</span>
|
|
299
299
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escape_text</span>(<span class="ruby-identifier">text</span>)
|
|
300
300
|
<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>
|
|
301
301
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -318,7 +318,7 @@
|
|
|
318
318
|
onclick="toggleCode('M000154-source');return false;">[Source]</a></p>
|
|
319
319
|
<div class="method-source-code" id="M000154-source">
|
|
320
320
|
<pre>
|
|
321
|
-
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line
|
|
321
|
+
<span class="ruby-comment cmt"># File erubis/engine/eperl.rb, line 22</span>
|
|
322
322
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">init_generator</span>(<span class="ruby-identifier">properties</span>={})
|
|
323
323
|
<span class="ruby-keyword kw">super</span>
|
|
324
324
|
<span class="ruby-ivar">@escapefunc</span> <span class="ruby-operator">||=</span> <span class="ruby-value str">'encode_entities'</span>
|