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
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
onclick="toggleCode('M000125-source');return false;">[Source]</a></p>
|
|
132
132
|
<div class="method-source-code" id="M000125-source">
|
|
133
133
|
<pre>
|
|
134
|
-
<span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line
|
|
134
|
+
<span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line 46</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('M000124-source');return false;">[Source]</a></p>
|
|
157
157
|
<div class="method-source-code" id="M000124-source">
|
|
158
158
|
<pre>
|
|
159
|
-
<span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line
|
|
159
|
+
<span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line 42</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('M000123-source');return false;">[Source]</a></p>
|
|
180
180
|
<div class="method-source-code" id="M000123-source">
|
|
181
181
|
<pre>
|
|
182
|
-
<span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line
|
|
182
|
+
<span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line 37</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-node">"<?php echo #{code}; ?>"</span>
|
|
@@ -203,7 +203,7 @@
|
|
|
203
203
|
onclick="toggleCode('M000127-source');return false;">[Source]</a></p>
|
|
204
204
|
<div class="method-source-code" id="M000127-source">
|
|
205
205
|
<pre>
|
|
206
|
-
<span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line
|
|
206
|
+
<span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line 63</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-comment cmt"># empty</span>
|
|
209
209
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -226,7 +226,7 @@
|
|
|
226
226
|
onclick="toggleCode('M000120-source');return false;">[Source]</a></p>
|
|
227
227
|
<div class="method-source-code" id="M000120-source">
|
|
228
228
|
<pre>
|
|
229
|
-
<span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line
|
|
229
|
+
<span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line 25</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-comment cmt"># empty</span>
|
|
232
232
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -249,7 +249,7 @@
|
|
|
249
249
|
onclick="toggleCode('M000126-source');return false;">[Source]</a></p>
|
|
250
250
|
<div class="method-source-code" id="M000126-source">
|
|
251
251
|
<pre>
|
|
252
|
-
<span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line
|
|
252
|
+
<span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line 52</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-value str">"<?php"</span>
|
|
255
255
|
<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>
|
|
@@ -279,7 +279,7 @@
|
|
|
279
279
|
onclick="toggleCode('M000122-source');return false;">[Source]</a></p>
|
|
280
280
|
<div class="method-source-code" id="M000122-source">
|
|
281
281
|
<pre>
|
|
282
|
-
<span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line
|
|
282
|
+
<span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line 33</span>
|
|
283
283
|
<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>)
|
|
284
284
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">escape_text</span>(<span class="ruby-identifier">text</span>)
|
|
285
285
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -302,7 +302,7 @@
|
|
|
302
302
|
onclick="toggleCode('M000121-source');return false;">[Source]</a></p>
|
|
303
303
|
<div class="method-source-code" id="M000121-source">
|
|
304
304
|
<pre>
|
|
305
|
-
<span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line
|
|
305
|
+
<span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line 29</span>
|
|
306
306
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escape_text</span>(<span class="ruby-identifier">text</span>)
|
|
307
307
|
<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>
|
|
308
308
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -325,7 +325,7 @@
|
|
|
325
325
|
onclick="toggleCode('M000119-source');return false;">[Source]</a></p>
|
|
326
326
|
<div class="method-source-code" id="M000119-source">
|
|
327
327
|
<pre>
|
|
328
|
-
<span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line
|
|
328
|
+
<span class="ruby-comment cmt"># File erubis/engine/ephp.rb, line 20</span>
|
|
329
329
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">init_generator</span>(<span class="ruby-identifier">properties</span>={})
|
|
330
330
|
<span class="ruby-keyword kw">super</span>
|
|
331
331
|
<span class="ruby-ivar">@escapefunc</span> <span class="ruby-operator">||=</span> <span class="ruby-value str">'htmlspecialchars'</span>
|
|
@@ -131,7 +131,7 @@ for preprocessing
|
|
|
131
131
|
onclick="toggleCode('M000203-source');return false;">[Source]</a></p>
|
|
132
132
|
<div class="method-source-code" id="M000203-source">
|
|
133
133
|
<pre>
|
|
134
|
-
<span class="ruby-comment cmt"># File erubis/preprocessing.rb, line
|
|
134
|
+
<span class="ruby-comment cmt"># File erubis/preprocessing.rb, line 17</span>
|
|
135
135
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">input</span>, <span class="ruby-identifier">params</span>={})
|
|
136
136
|
<span class="ruby-identifier">params</span> = <span class="ruby-identifier">params</span>.<span class="ruby-identifier">dup</span>
|
|
137
137
|
<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:pattern</span>] <span class="ruby-operator">||=</span> <span class="ruby-value str">'\[% %\]'</span> <span class="ruby-comment cmt"># use '[%= %]' instead of '<%= %>'</span>
|
|
@@ -159,7 +159,7 @@ for preprocessing
|
|
|
159
159
|
onclick="toggleCode('M000204-source');return false;">[Source]</a></p>
|
|
160
160
|
<div class="method-source-code" id="M000204-source">
|
|
161
161
|
<pre>
|
|
162
|
-
<span class="ruby-comment cmt"># File erubis/preprocessing.rb, line
|
|
162
|
+
<span class="ruby-comment cmt"># File erubis/preprocessing.rb, line 24</span>
|
|
163
163
|
<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>)
|
|
164
164
|
<span class="ruby-identifier">add_expr_literal</span>(<span class="ruby-identifier">src</span>, <span class="ruby-node">"_decode((#{code}))"</span>)
|
|
165
165
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -139,7 +139,7 @@ Alias for <a href="PreprocessingHelper.html#M000142">_p</a>
|
|
|
139
139
|
onclick="toggleCode('M000143-source');return false;">[Source]</a></p>
|
|
140
140
|
<div class="method-source-code" id="M000143-source">
|
|
141
141
|
<pre>
|
|
142
|
-
<span class="ruby-comment cmt"># File erubis/preprocessing.rb, line
|
|
142
|
+
<span class="ruby-comment cmt"># File erubis/preprocessing.rb, line 42</span>
|
|
143
143
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_P</span>(<span class="ruby-identifier">arg</span>)
|
|
144
144
|
<span class="ruby-keyword kw">return</span> <span class="ruby-node">"<%=h(#{arg})%>"</span>
|
|
145
145
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -162,7 +162,7 @@ Alias for <a href="PreprocessingHelper.html#M000142">_p</a>
|
|
|
162
162
|
onclick="toggleCode('M000145-source');return false;">[Source]</a></p>
|
|
163
163
|
<div class="method-source-code" id="M000145-source">
|
|
164
164
|
<pre>
|
|
165
|
-
<span class="ruby-comment cmt"># File erubis/preprocessing.rb, line
|
|
165
|
+
<span class="ruby-comment cmt"># File erubis/preprocessing.rb, line 48</span>
|
|
166
166
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_decode</span>(<span class="ruby-identifier">arg</span>)
|
|
167
167
|
<span class="ruby-identifier">arg</span> = <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">to_s</span>
|
|
168
168
|
<span class="ruby-identifier">arg</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/%3C%25(?:=|%3D)(.*?)%25%3E/</span>) { <span class="ruby-node">"<%=#{CGI.unescape($1)}%>"</span> }
|
|
@@ -188,7 +188,7 @@ Alias for <a href="PreprocessingHelper.html#M000142">_p</a>
|
|
|
188
188
|
onclick="toggleCode('M000142-source');return false;">[Source]</a></p>
|
|
189
189
|
<div class="method-source-code" id="M000142-source">
|
|
190
190
|
<pre>
|
|
191
|
-
<span class="ruby-comment cmt"># File erubis/preprocessing.rb, line
|
|
191
|
+
<span class="ruby-comment cmt"># File erubis/preprocessing.rb, line 38</span>
|
|
192
192
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_p</span>(<span class="ruby-identifier">arg</span>)
|
|
193
193
|
<span class="ruby-keyword kw">return</span> <span class="ruby-node">"<%=#{arg}%>"</span>
|
|
194
194
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -131,7 +131,7 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
131
131
|
onclick="toggleCode('M000151-source');return false;">[Source]</a></p>
|
|
132
132
|
<div class="method-source-code" id="M000151-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 127</span>
|
|
135
135
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_preamble</span>(<span class="ruby-identifier">src</span>)
|
|
136
136
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"@_buf = "</span>
|
|
137
137
|
<span class="ruby-keyword kw">super</span>
|
|
@@ -155,7 +155,7 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
155
155
|
onclick="toggleCode('M000153-source');return false;">[Source]</a></p>
|
|
156
156
|
<div class="method-source-code" id="M000153-source">
|
|
157
157
|
<pre>
|
|
158
|
-
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line
|
|
158
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 138</span>
|
|
159
159
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">evaluate</span>(<span class="ruby-identifier">context</span>=<span class="ruby-keyword kw">nil</span>)
|
|
160
160
|
<span class="ruby-identifier">_src</span> = <span class="ruby-ivar">@src</span>
|
|
161
161
|
<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>)
|
|
@@ -186,7 +186,7 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
186
186
|
onclick="toggleCode('M000152-source');return false;">[Source]</a></p>
|
|
187
187
|
<div class="method-source-code" id="M000152-source">
|
|
188
188
|
<pre>
|
|
189
|
-
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line
|
|
189
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 132</span>
|
|
190
190
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">print</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
|
191
191
|
<span class="ruby-identifier">args</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
|
|
192
192
|
<span class="ruby-ivar">@_buf</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">to_s</span>
|
|
@@ -129,7 +129,7 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
129
129
|
onclick="toggleCode('M000180-source');return false;">[Source]</a></p>
|
|
130
130
|
<div class="method-source-code" id="M000180-source">
|
|
131
131
|
<pre>
|
|
132
|
-
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line
|
|
132
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 102</span>
|
|
133
133
|
<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>)
|
|
134
134
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">' print '</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>
|
|
135
135
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -152,7 +152,7 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
152
152
|
onclick="toggleCode('M000179-source');return false;">[Source]</a></p>
|
|
153
153
|
<div class="method-source-code" id="M000179-source">
|
|
154
154
|
<pre>
|
|
155
|
-
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line
|
|
155
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 98</span>
|
|
156
156
|
<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>)
|
|
157
157
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">' print(('</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">code</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">').to_s);'</span>
|
|
158
158
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -175,7 +175,7 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
175
175
|
onclick="toggleCode('M000181-source');return false;">[Source]</a></p>
|
|
176
176
|
<div class="method-source-code" id="M000181-source">
|
|
177
177
|
<pre>
|
|
178
|
-
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line
|
|
178
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 106</span>
|
|
179
179
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_postamble</span>(<span class="ruby-identifier">src</span>)
|
|
180
180
|
<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>
|
|
181
181
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -198,7 +198,7 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
198
198
|
onclick="toggleCode('M000177-source');return false;">[Source]</a></p>
|
|
199
199
|
<div class="method-source-code" id="M000177-source">
|
|
200
200
|
<pre>
|
|
201
|
-
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line
|
|
201
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 91</span>
|
|
202
202
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_preamble</span>(<span class="ruby-identifier">src</span>)
|
|
203
203
|
<span class="ruby-keyword kw">end</span>
|
|
204
204
|
</pre>
|
|
@@ -220,7 +220,7 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
220
220
|
onclick="toggleCode('M000178-source');return false;">[Source]</a></p>
|
|
221
221
|
<div class="method-source-code" id="M000178-source">
|
|
222
222
|
<pre>
|
|
223
|
-
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line
|
|
223
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 94</span>
|
|
224
224
|
<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>)
|
|
225
225
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">" print '"</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>
|
|
226
226
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -135,7 +135,7 @@ define singleton method to it.
|
|
|
135
135
|
onclick="toggleCode('M000197-source');return false;">[Source]</a></p>
|
|
136
136
|
<div class="method-source-code" id="M000197-source">
|
|
137
137
|
<pre>
|
|
138
|
-
<span class="ruby-comment cmt"># File erubis/evaluator.rb, line
|
|
138
|
+
<span class="ruby-comment cmt"># File erubis/evaluator.rb, line 79</span>
|
|
139
139
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">def_method</span>(<span class="ruby-identifier">object</span>, <span class="ruby-identifier">method_name</span>, <span class="ruby-identifier">filename</span>=<span class="ruby-keyword kw">nil</span>)
|
|
140
140
|
<span class="ruby-identifier">m</span> = <span class="ruby-identifier">object</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Module</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">:module_eval</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">:instance_eval</span>
|
|
141
141
|
<span class="ruby-identifier">object</span>.<span class="ruby-identifier">__send__</span>(<span class="ruby-identifier">m</span>, <span class="ruby-node">"def #{method_name}; #{@src}; end"</span>, <span class="ruby-identifier">filename</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@filename</span> <span class="ruby-operator">||</span> <span class="ruby-value str">'(erubis)'</span>)
|
|
@@ -162,7 +162,7 @@ invoke context.instance_eval(@src)
|
|
|
162
162
|
onclick="toggleCode('M000196-source');return false;">[Source]</a></p>
|
|
163
163
|
<div class="method-source-code" id="M000196-source">
|
|
164
164
|
<pre>
|
|
165
|
-
<span class="ruby-comment cmt"># File erubis/evaluator.rb, line
|
|
165
|
+
<span class="ruby-comment cmt"># File erubis/evaluator.rb, line 69</span>
|
|
166
166
|
<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>)
|
|
167
167
|
<span class="ruby-identifier">_context</span> = <span class="ruby-constant">Context</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">_context</span>) <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>)
|
|
168
168
|
<span class="ruby-comment cmt">#return _context.instance_eval(@src, @filename || '(erubis)')</span>
|
|
@@ -192,7 +192,7 @@ eval(@src) with binding object
|
|
|
192
192
|
onclick="toggleCode('M000195-source');return false;">[Source]</a></p>
|
|
193
193
|
<div class="method-source-code" id="M000195-source">
|
|
194
194
|
<pre>
|
|
195
|
-
<span class="ruby-comment cmt"># File erubis/evaluator.rb, line
|
|
195
|
+
<span class="ruby-comment cmt"># File erubis/evaluator.rb, line 53</span>
|
|
196
196
|
<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>)
|
|
197
197
|
<span class="ruby-identifier">_arg</span> = <span class="ruby-identifier">_binding_or_hash</span>
|
|
198
198
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">_arg</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
|
|
@@ -137,7 +137,7 @@ code generator for Ruby
|
|
|
137
137
|
onclick="toggleCode('M000118-source');return false;">[Source]</a></p>
|
|
138
138
|
<div class="method-source-code" id="M000118-source">
|
|
139
139
|
<pre>
|
|
140
|
-
<span class="ruby-comment cmt"># File erubis/engine/eruby.rb, line
|
|
140
|
+
<span class="ruby-comment cmt"># File erubis/engine/eruby.rb, line 62</span>
|
|
141
141
|
<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>)
|
|
142
142
|
<span class="ruby-identifier">code</span>.<span class="ruby-identifier">strip!</span>
|
|
143
143
|
<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>
|
|
@@ -162,7 +162,7 @@ code generator for Ruby
|
|
|
162
162
|
onclick="toggleCode('M000117-source');return false;">[Source]</a></p>
|
|
163
163
|
<div class="method-source-code" id="M000117-source">
|
|
164
164
|
<pre>
|
|
165
|
-
<span class="ruby-comment cmt"># File erubis/engine/eruby.rb, line
|
|
165
|
+
<span class="ruby-comment cmt"># File erubis/engine/eruby.rb, line 58</span>
|
|
166
166
|
<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>)
|
|
167
167
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">' _buf << '</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>
|
|
168
168
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -185,7 +185,7 @@ code generator for Ruby
|
|
|
185
185
|
onclick="toggleCode('M000116-source');return false;">[Source]</a></p>
|
|
186
186
|
<div class="method-source-code" id="M000116-source">
|
|
187
187
|
<pre>
|
|
188
|
-
<span class="ruby-comment cmt"># File erubis/engine/eruby.rb, line
|
|
188
|
+
<span class="ruby-comment cmt"># File erubis/engine/eruby.rb, line 54</span>
|
|
189
189
|
<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>)
|
|
190
190
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">' _buf << ('</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">code</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">').to_s;'</span>
|
|
191
191
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -208,7 +208,7 @@ code generator for Ruby
|
|
|
208
208
|
onclick="toggleCode('M000115-source');return false;">[Source]</a></p>
|
|
209
209
|
<div class="method-source-code" id="M000115-source">
|
|
210
210
|
<pre>
|
|
211
|
-
<span class="ruby-comment cmt"># File erubis/engine/eruby.rb, line
|
|
211
|
+
<span class="ruby-comment cmt"># File erubis/engine/eruby.rb, line 48</span>
|
|
212
212
|
<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>)
|
|
213
213
|
<span class="ruby-comment cmt">#src << code << ';'</span>
|
|
214
214
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">code</span>
|
|
@@ -233,7 +233,7 @@ code generator for Ruby
|
|
|
233
233
|
onclick="toggleCode('M000114-source');return false;">[Source]</a></p>
|
|
234
234
|
<div class="method-source-code" id="M000114-source">
|
|
235
235
|
<pre>
|
|
236
|
-
<span class="ruby-comment cmt"># File erubis/engine/eruby.rb, line
|
|
236
|
+
<span class="ruby-comment cmt"># File erubis/engine/eruby.rb, line 44</span>
|
|
237
237
|
<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>)
|
|
238
238
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">" _buf << '"</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>
|
|
239
239
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -256,7 +256,7 @@ code generator for Ruby
|
|
|
256
256
|
onclick="toggleCode('M000112-source');return false;">[Source]</a></p>
|
|
257
257
|
<div class="method-source-code" id="M000112-source">
|
|
258
258
|
<pre>
|
|
259
|
-
<span class="ruby-comment cmt"># File erubis/engine/eruby.rb, line
|
|
259
|
+
<span class="ruby-comment cmt"># File erubis/engine/eruby.rb, line 30</span>
|
|
260
260
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escape_text</span>(<span class="ruby-identifier">text</span>)
|
|
261
261
|
<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>
|
|
262
262
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -279,7 +279,7 @@ code generator for Ruby
|
|
|
279
279
|
onclick="toggleCode('M000113-source');return false;">[Source]</a></p>
|
|
280
280
|
<div class="method-source-code" id="M000113-source">
|
|
281
281
|
<pre>
|
|
282
|
-
<span class="ruby-comment cmt"># File erubis/engine/eruby.rb, line
|
|
282
|
+
<span class="ruby-comment cmt"># File erubis/engine/eruby.rb, line 34</span>
|
|
283
283
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escaped_expr</span>(<span class="ruby-identifier">code</span>)
|
|
284
284
|
<span class="ruby-keyword kw">return</span> <span class="ruby-node">"#{@escapefunc}(#{code})"</span>
|
|
285
285
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -302,7 +302,7 @@ code generator for Ruby
|
|
|
302
302
|
onclick="toggleCode('M000111-source');return false;">[Source]</a></p>
|
|
303
303
|
<div class="method-source-code" id="M000111-source">
|
|
304
304
|
<pre>
|
|
305
|
-
<span class="ruby-comment cmt"># File erubis/engine/eruby.rb, line
|
|
305
|
+
<span class="ruby-comment cmt"># File erubis/engine/eruby.rb, line 21</span>
|
|
306
306
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">init_generator</span>(<span class="ruby-identifier">properties</span>={})
|
|
307
307
|
<span class="ruby-keyword kw">super</span>
|
|
308
308
|
<span class="ruby-ivar">@escapefunc</span> <span class="ruby-operator">||=</span> <span class="ruby-value str">"Erubis::XmlHelper.escape_xml"</span>
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
onclick="toggleCode('M000043-source');return false;">[Source]</a></p>
|
|
133
133
|
<div class="method-source-code" id="M000043-source">
|
|
134
134
|
<pre>
|
|
135
|
-
<span class="ruby-comment cmt"># File erubis/engine/escheme.rb, line
|
|
135
|
+
<span class="ruby-comment cmt"># File erubis/engine/escheme.rb, line 71</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">s</span> = (<span class="ruby-identifier">code</span>.<span class="ruby-identifier">strip!</span> <span class="ruby-operator">||</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>)
|
|
138
138
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"(display \"*** debug: #{s}=\")(display #{code.strip})(display \"\\n\")"</span>
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
onclick="toggleCode('M000042-source');return false;">[Source]</a></p>
|
|
157
157
|
<div class="method-source-code" id="M000042-source">
|
|
158
158
|
<pre>
|
|
159
|
-
<span class="ruby-comment cmt"># File erubis/engine/escheme.rb, line
|
|
159
|
+
<span class="ruby-comment cmt"># File erubis/engine/escheme.rb, line 67</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('M000041-source');return false;">[Source]</a></p>
|
|
180
180
|
<div class="method-source-code" id="M000041-source">
|
|
181
181
|
<pre>
|
|
182
|
-
<span class="ruby-comment cmt"># File erubis/engine/escheme.rb, line
|
|
182
|
+
<span class="ruby-comment cmt"># File erubis/engine/escheme.rb, line 62</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-node">"(#{@func} #{code})"</span>
|
|
@@ -203,7 +203,7 @@
|
|
|
203
203
|
onclick="toggleCode('M000044-source');return false;">[Source]</a></p>
|
|
204
204
|
<div class="method-source-code" id="M000044-source">
|
|
205
205
|
<pre>
|
|
206
|
-
<span class="ruby-comment cmt"># File erubis/engine/escheme.rb, line
|
|
206
|
+
<span class="ruby-comment cmt"># File erubis/engine/escheme.rb, line 76</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-keyword kw">return</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@func</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'_add'</span>
|
|
209
209
|
<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>
|
|
@@ -228,7 +228,7 @@
|
|
|
228
228
|
onclick="toggleCode('M000036-source');return false;">[Source]</a></p>
|
|
229
229
|
<div class="method-source-code" id="M000036-source">
|
|
230
230
|
<pre>
|
|
231
|
-
<span class="ruby-comment cmt"># File erubis/engine/escheme.rb, line
|
|
231
|
+
<span class="ruby-comment cmt"># File erubis/engine/escheme.rb, line 28</span>
|
|
232
232
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_preamble</span>(<span class="ruby-identifier">src</span>)
|
|
233
233
|
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@func</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'_add'</span>
|
|
234
234
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"(let ((_buf '())) "</span> <span class="ruby-operator">+</span> \
|
|
@@ -254,7 +254,7 @@
|
|
|
254
254
|
onclick="toggleCode('M000040-source');return false;">[Source]</a></p>
|
|
255
255
|
<div class="method-source-code" id="M000040-source">
|
|
256
256
|
<pre>
|
|
257
|
-
<span class="ruby-comment cmt"># File erubis/engine/escheme.rb, line
|
|
257
|
+
<span class="ruby-comment cmt"># File erubis/engine/escheme.rb, line 58</span>
|
|
258
258
|
<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>)
|
|
259
259
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">code</span>
|
|
260
260
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -277,7 +277,7 @@
|
|
|
277
277
|
onclick="toggleCode('M000039-source');return false;">[Source]</a></p>
|
|
278
278
|
<div class="method-source-code" id="M000039-source">
|
|
279
279
|
<pre>
|
|
280
|
-
<span class="ruby-comment cmt"># File erubis/engine/escheme.rb, line
|
|
280
|
+
<span class="ruby-comment cmt"># File erubis/engine/escheme.rb, line 47</span>
|
|
281
281
|
<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>)
|
|
282
282
|
<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>
|
|
283
283
|
<span class="ruby-identifier">t</span> = <span class="ruby-identifier">escape_text</span>(<span class="ruby-identifier">text</span>)
|
|
@@ -307,7 +307,7 @@
|
|
|
307
307
|
onclick="toggleCode('M000037-source');return false;">[Source]</a></p>
|
|
308
308
|
<div class="method-source-code" id="M000037-source">
|
|
309
309
|
<pre>
|
|
310
|
-
<span class="ruby-comment cmt"># File erubis/engine/escheme.rb, line
|
|
310
|
+
<span class="ruby-comment cmt"># File erubis/engine/escheme.rb, line 36</span>
|
|
311
311
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escape_text</span>(<span class="ruby-identifier">text</span>)
|
|
312
312
|
<span class="ruby-ivar">@table_</span> <span class="ruby-operator">||=</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> }
|
|
313
313
|
<span class="ruby-identifier">text</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/["\\]/</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>] }
|
|
@@ -332,7 +332,7 @@
|
|
|
332
332
|
onclick="toggleCode('M000038-source');return false;">[Source]</a></p>
|
|
333
333
|
<div class="method-source-code" id="M000038-source">
|
|
334
334
|
<pre>
|
|
335
|
-
<span class="ruby-comment cmt"># File erubis/engine/escheme.rb, line
|
|
335
|
+
<span class="ruby-comment cmt"># File erubis/engine/escheme.rb, line 42</span>
|
|
336
336
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escaped_expr</span>(<span class="ruby-identifier">code</span>)
|
|
337
337
|
<span class="ruby-identifier">code</span>.<span class="ruby-identifier">strip!</span>
|
|
338
338
|
<span class="ruby-keyword kw">return</span> <span class="ruby-node">"(#{@escapefunc} #{code})"</span>
|
|
@@ -356,7 +356,7 @@
|
|
|
356
356
|
onclick="toggleCode('M000035-source');return false;">[Source]</a></p>
|
|
357
357
|
<div class="method-source-code" id="M000035-source">
|
|
358
358
|
<pre>
|
|
359
|
-
<span class="ruby-comment cmt"># File erubis/engine/escheme.rb, line
|
|
359
|
+
<span class="ruby-comment cmt"># File erubis/engine/escheme.rb, line 22</span>
|
|
360
360
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">init_generator</span>(<span class="ruby-identifier">properties</span>={})
|
|
361
361
|
<span class="ruby-keyword kw">super</span>
|
|
362
362
|
<span class="ruby-ivar">@escapefunc</span> <span class="ruby-operator">||=</span> <span class="ruby-value str">'escape'</span>
|
|
@@ -144,7 +144,7 @@ DEFAULT_REGEXP = /(^[ \t]*)?<%(=+|\#)?(.*?)-?%>([ \t]*\r?\n)?/m
|
|
|
144
144
|
onclick="toggleCode('M000059-source');return false;">[Source]</a></p>
|
|
145
145
|
<div class="method-source-code" id="M000059-source">
|
|
146
146
|
<pre>
|
|
147
|
-
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line
|
|
147
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 342</span>
|
|
148
148
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">convert</span>(<span class="ruby-identifier">input</span>)
|
|
149
149
|
<span class="ruby-identifier">src</span> = <span class="ruby-value str">""</span>
|
|
150
150
|
<span class="ruby-identifier">add_preamble</span>(<span class="ruby-identifier">src</span>)
|
|
@@ -126,7 +126,7 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
126
126
|
onclick="toggleCode('M000061-source');return false;">[Source]</a></p>
|
|
127
127
|
<div class="method-source-code" id="M000061-source">
|
|
128
128
|
<pre>
|
|
129
|
-
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line
|
|
129
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 73</span>
|
|
130
130
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_postamble</span>(<span class="ruby-identifier">src</span>)
|
|
131
131
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"\n''\n"</span>
|
|
132
132
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -149,7 +149,7 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
149
149
|
onclick="toggleCode('M000060-source');return false;">[Source]</a></p>
|
|
150
150
|
<div class="method-source-code" id="M000060-source">
|
|
151
151
|
<pre>
|
|
152
|
-
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line
|
|
152
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 69</span>
|
|
153
153
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_preamble</span>(<span class="ruby-identifier">src</span>)
|
|
154
154
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"_buf = $stdout;"</span>
|
|
155
155
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -126,7 +126,7 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
126
126
|
onclick="toggleCode('M000022-source');return false;">[Source]</a></p>
|
|
127
127
|
<div class="method-source-code" id="M000022-source">
|
|
128
128
|
<pre>
|
|
129
|
-
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line
|
|
129
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 214</span>
|
|
130
130
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_postamble</span>(<span class="ruby-identifier">src</span>)
|
|
131
131
|
<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>
|
|
132
132
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"_buf.to_s\n"</span>
|
|
@@ -150,7 +150,7 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
150
150
|
onclick="toggleCode('M000021-source');return false;">[Source]</a></p>
|
|
151
151
|
<div class="method-source-code" id="M000021-source">
|
|
152
152
|
<pre>
|
|
153
|
-
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line
|
|
153
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 210</span>
|
|
154
154
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_preamble</span>(<span class="ruby-identifier">src</span>)
|
|
155
155
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"_buf = '';"</span>
|
|
156
156
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -166,7 +166,7 @@ ex.
|
|
|
166
166
|
onclick="toggleCode('M000205-source');return false;">[Source]</a></p>
|
|
167
167
|
<div class="method-source-code" id="M000205-source">
|
|
168
168
|
<pre>
|
|
169
|
-
<span class="ruby-comment cmt"># File erubis/tiny.rb, line
|
|
169
|
+
<span class="ruby-comment cmt"># File erubis/tiny.rb, line 19</span>
|
|
170
170
|
<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>)
|
|
171
171
|
<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>
|
|
172
172
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -191,15 +191,14 @@ ex.
|
|
|
191
191
|
onclick="toggleCode('M000206-source');return false;">[Source]</a></p>
|
|
192
192
|
<div class="method-source-code" id="M000206-source">
|
|
193
193
|
<pre>
|
|
194
|
-
<span class="ruby-comment cmt"># File erubis/tiny.rb, line
|
|
194
|
+
<span class="ruby-comment cmt"># File erubis/tiny.rb, line 26</span>
|
|
195
195
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">convert</span>(<span class="ruby-identifier">input</span>)
|
|
196
196
|
<span class="ruby-identifier">src</span> = <span class="ruby-value str">"_buf = '';"</span> <span class="ruby-comment cmt"># preamble</span>
|
|
197
197
|
<span class="ruby-identifier">pos</span> = <span class="ruby-value">0</span>
|
|
198
198
|
<span class="ruby-identifier">input</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-constant">EMBEDDED_PATTERN</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">indicator</span>, <span class="ruby-identifier">code</span><span class="ruby-operator">|</span>
|
|
199
|
-
<span class="ruby-identifier">
|
|
200
|
-
<span class="ruby-identifier">
|
|
201
|
-
<span class="ruby-identifier">
|
|
202
|
-
<span class="ruby-identifier">pos</span> = <span class="ruby-identifier">match</span>.<span class="ruby-identifier">end</span>(<span class="ruby-value">0</span>)
|
|
199
|
+
<span class="ruby-identifier">m</span> = <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">last_match</span>
|
|
200
|
+
<span class="ruby-identifier">text</span> = <span class="ruby-identifier">input</span>[<span class="ruby-identifier">pos</span><span class="ruby-operator">...</span><span class="ruby-identifier">m</span>.<span class="ruby-identifier">begin</span>(<span class="ruby-value">0</span>)]
|
|
201
|
+
<span class="ruby-identifier">pos</span> = <span class="ruby-identifier">m</span>.<span class="ruby-identifier">end</span>(<span class="ruby-value">0</span>)
|
|
203
202
|
<span class="ruby-comment cmt">#src << " _buf << '" << escape_text(text) << "';"</span>
|
|
204
203
|
<span class="ruby-identifier">text</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/['\\]/</span>, <span class="ruby-value str">'\\\\\&'</span>)
|
|
205
204
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">" _buf << '"</span> <span class="ruby-operator"><<</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>
|
|
@@ -238,7 +237,7 @@ ex.
|
|
|
238
237
|
onclick="toggleCode('M000208-source');return false;">[Source]</a></p>
|
|
239
238
|
<div class="method-source-code" id="M000208-source">
|
|
240
239
|
<pre>
|
|
241
|
-
<span class="ruby-comment cmt"># File erubis/tiny.rb, line
|
|
240
|
+
<span class="ruby-comment cmt"># File erubis/tiny.rb, line 61</span>
|
|
242
241
|
<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>)
|
|
243
242
|
<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>)
|
|
244
243
|
<span class="ruby-identifier">_obj</span> = <span class="ruby-constant">Object</span>.<span class="ruby-identifier">new</span>
|
|
@@ -275,7 +274,7 @@ end
|
|
|
275
274
|
onclick="toggleCode('M000207-source');return false;">[Source]</a></p>
|
|
276
275
|
<div class="method-source-code" id="M000207-source">
|
|
277
276
|
<pre>
|
|
278
|
-
<span class="ruby-comment cmt"># File erubis/tiny.rb, line
|
|
277
|
+
<span class="ruby-comment cmt"># File erubis/tiny.rb, line 57</span>
|
|
279
278
|
<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>)
|
|
280
279
|
<span class="ruby-identifier">eval</span> <span class="ruby-ivar">@src</span>, <span class="ruby-identifier">_binding</span>
|
|
281
280
|
<span class="ruby-keyword kw">end</span>
|