erubis 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/{ChangeLog → CHANGES} +139 -6
- data/MIT-LICENSE +20 -0
- data/README.txt +20 -5
- data/benchmark/erubybench.rb +465 -229
- data/benchmark/erubybench.rhtml +39 -15
- data/benchmark/erubybench.yaml +126 -46
- data/bin/erubis +2 -2
- data/bin/notext +3 -3
- data/contrib/action_view_base_rb.patch +23 -0
- data/contrib/erubis +466 -308
- data/contrib/inline-require +2 -2
- data/doc-api/classes/ERB.html +101 -0
- data/doc-api/classes/Erubis.html +59 -6
- data/doc-api/classes/Erubis/ArrayEnhancer.html +12 -12
- data/doc-api/classes/Erubis/Basic/Converter.html +61 -57
- data/doc-api/classes/Erubis/BiPatternEnhancer.html +14 -14
- data/doc-api/classes/Erubis/CGenerator.html +60 -60
- data/doc-api/classes/Erubis/Context.html +125 -29
- data/doc-api/classes/Erubis/Converter.html +73 -22
- data/doc-api/classes/Erubis/Engine.html +55 -39
- data/doc-api/classes/Erubis/EscapeEnhancer.html +6 -6
- data/doc-api/classes/Erubis/Evaluator.html +19 -19
- data/doc-api/classes/Erubis/Generator.html +16 -10
- data/doc-api/classes/Erubis/HeaderFooterEnhancer.html +14 -14
- data/doc-api/classes/Erubis/{Helper.html → Helpers.html} +5 -6
- data/doc-api/classes/Erubis/Helpers/RailsHelper.html +296 -0
- data/doc-api/classes/Erubis/JavaGenerator.html +54 -54
- data/doc-api/classes/Erubis/JavascriptGenerator.html +60 -60
- data/doc-api/classes/Erubis/Main.html +42 -30
- data/doc-api/classes/Erubis/NoCodeEnhancer.html +5 -5
- data/doc-api/classes/Erubis/NoTextEnhancer.html +7 -7
- data/doc-api/classes/Erubis/OptimizedEruby.html +6 -6
- data/doc-api/classes/Erubis/OptimizedGenerator.html +72 -72
- data/doc-api/classes/Erubis/OptimizedXmlEruby.html +6 -6
- data/doc-api/classes/Erubis/PI/Converter.html +28 -81
- data/doc-api/classes/Erubis/PI/Ec.html +6 -6
- data/doc-api/classes/Erubis/PI/Ejava.html +6 -6
- data/doc-api/classes/Erubis/PI/Ejavascript.html +6 -6
- data/doc-api/classes/Erubis/PI/Eperl.html +6 -6
- data/doc-api/classes/Erubis/PI/Ephp.html +6 -6
- data/doc-api/classes/Erubis/PI/Eruby.html +7 -7
- data/doc-api/classes/Erubis/PI/Escheme.html +6 -6
- data/doc-api/classes/Erubis/PI/TinyEruby.html +66 -79
- data/doc-api/classes/Erubis/PercentLineEnhancer.html +8 -8
- data/doc-api/classes/Erubis/PerlGenerator.html +54 -54
- data/doc-api/classes/Erubis/PhpGenerator.html +54 -54
- data/doc-api/classes/Erubis/PrintEnabledEnhancer.html +21 -21
- data/doc-api/classes/Erubis/PrintOutEnhancer.html +30 -30
- data/doc-api/classes/Erubis/RubyEvaluator.html +12 -12
- data/doc-api/classes/Erubis/RubyGenerator.html +9 -9
- data/doc-api/classes/Erubis/SimplifyEnhancer.html +7 -6
- data/doc-api/classes/Erubis/StdoutEnhancer.html +12 -12
- data/doc-api/classes/Erubis/StringBufferEnhancer.html +13 -13
- data/doc-api/classes/Erubis/TinyEruby.html +56 -68
- data/doc-api/classes/Erubis/XmlHelper.html +20 -23
- data/doc-api/created.rid +1 -1
- data/doc-api/files/{__/README_txt.html → README_txt.html} +35 -20
- 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 -3
- 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/{helper/rails_rb.html → helpers/rails_helper_rb.html} +6 -31
- data/doc-api/files/erubis/local-setting_rb.html +2 -2
- data/doc-api/files/erubis/main_rb.html +4 -2
- data/doc-api/files/erubis/tiny_rb.html +2 -2
- data/doc-api/files/erubis_rb.html +2 -2
- data/doc-api/fr_class_index.html +3 -3
- data/doc-api/fr_file_index.html +2 -2
- data/doc-api/fr_method_index.html +142 -147
- data/doc-api/index.html +1 -1
- data/doc/users-guide.html +387 -218
- data/lib/erubis.rb +21 -25
- data/lib/erubis/context.rb +34 -4
- data/lib/erubis/converter.rb +159 -115
- data/lib/erubis/engine.rb +29 -12
- data/lib/erubis/engine/ec.rb +2 -2
- data/lib/erubis/engine/ejava.rb +2 -2
- data/lib/erubis/engine/ejavascript.rb +2 -2
- data/lib/erubis/engine/enhanced.rb +2 -2
- data/lib/erubis/engine/eperl.rb +2 -2
- data/lib/erubis/engine/ephp.rb +2 -2
- data/lib/erubis/engine/eruby.rb +5 -6
- data/lib/erubis/engine/escheme.rb +2 -2
- data/lib/erubis/engine/optimized.rb +2 -2
- data/lib/erubis/enhancer.rb +33 -7
- data/lib/erubis/error.rb +2 -2
- data/lib/erubis/evaluator.rb +2 -2
- data/lib/erubis/generator.rb +6 -3
- data/lib/erubis/helper.rb +6 -23
- data/lib/erubis/helpers/rails_helper.rb +202 -0
- data/lib/erubis/local-setting.rb +4 -4
- data/lib/erubis/main.rb +90 -35
- data/lib/erubis/tiny.rb +57 -52
- data/test/assert-text-equal.rb +2 -2
- data/test/test-engines.rb +5 -5
- data/test/test-erubis.rb +173 -63
- data/test/test-main.rb +135 -27
- data/test/test-notext.rb +2 -2
- data/test/test.rb +2 -2
- data/test/testutil.rb +2 -2
- metadata +16 -16
- data/LGPL +0 -504
- data/doc-api/classes/Erubis/Helper/CachedRailsTemplate.html +0 -198
- data/doc-api/classes/Erubis/Helper/RailsTemplate.html +0 -366
- data/lib/erubis/helper/rails.rb +0 -159
|
@@ -74,11 +74,11 @@
|
|
|
74
74
|
|
|
75
75
|
<div id="description">
|
|
76
76
|
<p>
|
|
77
|
-
enable print function
|
|
77
|
+
enable <a href="PrintEnabledEnhancer.html#M000124">print</a> function
|
|
78
78
|
</p>
|
|
79
79
|
<p>
|
|
80
|
-
Notice: use Eruby#evaluate() and don&#
|
|
81
|
-
enable print function.
|
|
80
|
+
Notice: use Eruby#evaluate() and don‘t use Eruby#result() to be
|
|
81
|
+
enable <a href="PrintEnabledEnhancer.html#M000124">print</a> function.
|
|
82
82
|
</p>
|
|
83
83
|
<p>
|
|
84
84
|
this is only for <a href="Eruby.html">Eruby</a>.
|
|
@@ -93,9 +93,9 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
93
93
|
<h3 class="section-bar">Methods</h3>
|
|
94
94
|
|
|
95
95
|
<div class="name-list">
|
|
96
|
-
<a href="#
|
|
97
|
-
<a href="#
|
|
98
|
-
<a href="#
|
|
96
|
+
<a href="#M000123">add_preamble</a>
|
|
97
|
+
<a href="#M000125">evaluate</a>
|
|
98
|
+
<a href="#M000124">print</a>
|
|
99
99
|
</div>
|
|
100
100
|
</div>
|
|
101
101
|
|
|
@@ -117,19 +117,19 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
117
117
|
<div id="methods">
|
|
118
118
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
119
119
|
|
|
120
|
-
<div id="method-
|
|
121
|
-
<a name="
|
|
120
|
+
<div id="method-M000123" class="method-detail">
|
|
121
|
+
<a name="M000123"></a>
|
|
122
122
|
|
|
123
123
|
<div class="method-heading">
|
|
124
|
-
<a href="#
|
|
124
|
+
<a href="#M000123" class="method-signature">
|
|
125
125
|
<span class="method-name">add_preamble</span><span class="method-args">(src)</span>
|
|
126
126
|
</a>
|
|
127
127
|
</div>
|
|
128
128
|
|
|
129
129
|
<div class="method-description">
|
|
130
130
|
<p><a class="source-toggle" href="#"
|
|
131
|
-
onclick="toggleCode('
|
|
132
|
-
<div class="method-source-code" id="
|
|
131
|
+
onclick="toggleCode('M000123-source');return false;">[Source]</a></p>
|
|
132
|
+
<div class="method-source-code" id="M000123-source">
|
|
133
133
|
<pre>
|
|
134
134
|
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 128</span>
|
|
135
135
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_preamble</span>(<span class="ruby-identifier">src</span>)
|
|
@@ -141,19 +141,19 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
141
141
|
</div>
|
|
142
142
|
</div>
|
|
143
143
|
|
|
144
|
-
<div id="method-
|
|
145
|
-
<a name="
|
|
144
|
+
<div id="method-M000125" class="method-detail">
|
|
145
|
+
<a name="M000125"></a>
|
|
146
146
|
|
|
147
147
|
<div class="method-heading">
|
|
148
|
-
<a href="#
|
|
148
|
+
<a href="#M000125" class="method-signature">
|
|
149
149
|
<span class="method-name">evaluate</span><span class="method-args">(context=nil)</span>
|
|
150
150
|
</a>
|
|
151
151
|
</div>
|
|
152
152
|
|
|
153
153
|
<div class="method-description">
|
|
154
154
|
<p><a class="source-toggle" href="#"
|
|
155
|
-
onclick="toggleCode('
|
|
156
|
-
<div class="method-source-code" id="
|
|
155
|
+
onclick="toggleCode('M000125-source');return false;">[Source]</a></p>
|
|
156
|
+
<div class="method-source-code" id="M000125-source">
|
|
157
157
|
<pre>
|
|
158
158
|
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 139</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>)
|
|
@@ -172,19 +172,19 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
172
172
|
</div>
|
|
173
173
|
</div>
|
|
174
174
|
|
|
175
|
-
<div id="method-
|
|
176
|
-
<a name="
|
|
175
|
+
<div id="method-M000124" class="method-detail">
|
|
176
|
+
<a name="M000124"></a>
|
|
177
177
|
|
|
178
178
|
<div class="method-heading">
|
|
179
|
-
<a href="#
|
|
179
|
+
<a href="#M000124" class="method-signature">
|
|
180
180
|
<span class="method-name">print</span><span class="method-args">(*args)</span>
|
|
181
181
|
</a>
|
|
182
182
|
</div>
|
|
183
183
|
|
|
184
184
|
<div class="method-description">
|
|
185
185
|
<p><a class="source-toggle" href="#"
|
|
186
|
-
onclick="toggleCode('
|
|
187
|
-
<div class="method-source-code" id="
|
|
186
|
+
onclick="toggleCode('M000124-source');return false;">[Source]</a></p>
|
|
187
|
+
<div class="method-source-code" id="M000124-source">
|
|
188
188
|
<pre>
|
|
189
189
|
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 133</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>)
|
|
@@ -89,11 +89,11 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
89
89
|
<h3 class="section-bar">Methods</h3>
|
|
90
90
|
|
|
91
91
|
<div class="name-list">
|
|
92
|
-
<a href="#
|
|
93
|
-
<a href="#
|
|
94
|
-
<a href="#
|
|
95
|
-
<a href="#
|
|
96
|
-
<a href="#
|
|
92
|
+
<a href="#M000087">add_expr_escaped</a>
|
|
93
|
+
<a href="#M000086">add_expr_literal</a>
|
|
94
|
+
<a href="#M000088">add_postamble</a>
|
|
95
|
+
<a href="#M000084">add_preamble</a>
|
|
96
|
+
<a href="#M000085">add_text</a>
|
|
97
97
|
</div>
|
|
98
98
|
</div>
|
|
99
99
|
|
|
@@ -115,19 +115,19 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
115
115
|
<div id="methods">
|
|
116
116
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
117
117
|
|
|
118
|
-
<div id="method-
|
|
119
|
-
<a name="
|
|
118
|
+
<div id="method-M000087" class="method-detail">
|
|
119
|
+
<a name="M000087"></a>
|
|
120
120
|
|
|
121
121
|
<div class="method-heading">
|
|
122
|
-
<a href="#
|
|
122
|
+
<a href="#M000087" class="method-signature">
|
|
123
123
|
<span class="method-name">add_expr_escaped</span><span class="method-args">(src, code)</span>
|
|
124
124
|
</a>
|
|
125
125
|
</div>
|
|
126
126
|
|
|
127
127
|
<div class="method-description">
|
|
128
128
|
<p><a class="source-toggle" href="#"
|
|
129
|
-
onclick="toggleCode('
|
|
130
|
-
<div class="method-source-code" id="
|
|
129
|
+
onclick="toggleCode('M000087-source');return false;">[Source]</a></p>
|
|
130
|
+
<div class="method-source-code" id="M000087-source">
|
|
131
131
|
<pre>
|
|
132
132
|
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 103</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>)
|
|
@@ -138,19 +138,19 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
138
138
|
</div>
|
|
139
139
|
</div>
|
|
140
140
|
|
|
141
|
-
<div id="method-
|
|
142
|
-
<a name="
|
|
141
|
+
<div id="method-M000086" class="method-detail">
|
|
142
|
+
<a name="M000086"></a>
|
|
143
143
|
|
|
144
144
|
<div class="method-heading">
|
|
145
|
-
<a href="#
|
|
145
|
+
<a href="#M000086" class="method-signature">
|
|
146
146
|
<span class="method-name">add_expr_literal</span><span class="method-args">(src, code)</span>
|
|
147
147
|
</a>
|
|
148
148
|
</div>
|
|
149
149
|
|
|
150
150
|
<div class="method-description">
|
|
151
151
|
<p><a class="source-toggle" href="#"
|
|
152
|
-
onclick="toggleCode('
|
|
153
|
-
<div class="method-source-code" id="
|
|
152
|
+
onclick="toggleCode('M000086-source');return false;">[Source]</a></p>
|
|
153
|
+
<div class="method-source-code" id="M000086-source">
|
|
154
154
|
<pre>
|
|
155
155
|
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 99</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>)
|
|
@@ -161,19 +161,19 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
161
161
|
</div>
|
|
162
162
|
</div>
|
|
163
163
|
|
|
164
|
-
<div id="method-
|
|
165
|
-
<a name="
|
|
164
|
+
<div id="method-M000088" class="method-detail">
|
|
165
|
+
<a name="M000088"></a>
|
|
166
166
|
|
|
167
167
|
<div class="method-heading">
|
|
168
|
-
<a href="#
|
|
168
|
+
<a href="#M000088" class="method-signature">
|
|
169
169
|
<span class="method-name">add_postamble</span><span class="method-args">(src)</span>
|
|
170
170
|
</a>
|
|
171
171
|
</div>
|
|
172
172
|
|
|
173
173
|
<div class="method-description">
|
|
174
174
|
<p><a class="source-toggle" href="#"
|
|
175
|
-
onclick="toggleCode('
|
|
176
|
-
<div class="method-source-code" id="
|
|
175
|
+
onclick="toggleCode('M000088-source');return false;">[Source]</a></p>
|
|
176
|
+
<div class="method-source-code" id="M000088-source">
|
|
177
177
|
<pre>
|
|
178
178
|
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 107</span>
|
|
179
179
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_postamble</span>(<span class="ruby-identifier">src</span>)
|
|
@@ -184,19 +184,19 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
184
184
|
</div>
|
|
185
185
|
</div>
|
|
186
186
|
|
|
187
|
-
<div id="method-
|
|
188
|
-
<a name="
|
|
187
|
+
<div id="method-M000084" class="method-detail">
|
|
188
|
+
<a name="M000084"></a>
|
|
189
189
|
|
|
190
190
|
<div class="method-heading">
|
|
191
|
-
<a href="#
|
|
191
|
+
<a href="#M000084" class="method-signature">
|
|
192
192
|
<span class="method-name">add_preamble</span><span class="method-args">(src)</span>
|
|
193
193
|
</a>
|
|
194
194
|
</div>
|
|
195
195
|
|
|
196
196
|
<div class="method-description">
|
|
197
197
|
<p><a class="source-toggle" href="#"
|
|
198
|
-
onclick="toggleCode('
|
|
199
|
-
<div class="method-source-code" id="
|
|
198
|
+
onclick="toggleCode('M000084-source');return false;">[Source]</a></p>
|
|
199
|
+
<div class="method-source-code" id="M000084-source">
|
|
200
200
|
<pre>
|
|
201
201
|
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 92</span>
|
|
202
202
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_preamble</span>(<span class="ruby-identifier">src</span>)
|
|
@@ -206,19 +206,19 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
206
206
|
</div>
|
|
207
207
|
</div>
|
|
208
208
|
|
|
209
|
-
<div id="method-
|
|
210
|
-
<a name="
|
|
209
|
+
<div id="method-M000085" class="method-detail">
|
|
210
|
+
<a name="M000085"></a>
|
|
211
211
|
|
|
212
212
|
<div class="method-heading">
|
|
213
|
-
<a href="#
|
|
213
|
+
<a href="#M000085" class="method-signature">
|
|
214
214
|
<span class="method-name">add_text</span><span class="method-args">(src, text)</span>
|
|
215
215
|
</a>
|
|
216
216
|
</div>
|
|
217
217
|
|
|
218
218
|
<div class="method-description">
|
|
219
219
|
<p><a class="source-toggle" href="#"
|
|
220
|
-
onclick="toggleCode('
|
|
221
|
-
<div class="method-source-code" id="
|
|
220
|
+
onclick="toggleCode('M000085-source');return false;">[Source]</a></p>
|
|
221
|
+
<div class="method-source-code" id="M000085-source">
|
|
222
222
|
<pre>
|
|
223
223
|
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 95</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>)
|
|
@@ -86,8 +86,8 @@ evaluator for Ruby
|
|
|
86
86
|
<h3 class="section-bar">Methods</h3>
|
|
87
87
|
|
|
88
88
|
<div class="name-list">
|
|
89
|
-
<a href="#
|
|
90
|
-
<a href="#
|
|
89
|
+
<a href="#M000150">evaluate</a>
|
|
90
|
+
<a href="#M000149">result</a>
|
|
91
91
|
</div>
|
|
92
92
|
</div>
|
|
93
93
|
|
|
@@ -116,11 +116,11 @@ evaluator for Ruby
|
|
|
116
116
|
<div id="methods">
|
|
117
117
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
118
118
|
|
|
119
|
-
<div id="method-
|
|
120
|
-
<a name="
|
|
119
|
+
<div id="method-M000150" class="method-detail">
|
|
120
|
+
<a name="M000150"></a>
|
|
121
121
|
|
|
122
122
|
<div class="method-heading">
|
|
123
|
-
<a href="#
|
|
123
|
+
<a href="#M000150" class="method-signature">
|
|
124
124
|
<span class="method-name">evaluate</span><span class="method-args">(context=Context.new)</span>
|
|
125
125
|
</a>
|
|
126
126
|
</div>
|
|
@@ -130,8 +130,8 @@ evaluator for Ruby
|
|
|
130
130
|
invoke context.instance_eval(@src)
|
|
131
131
|
</p>
|
|
132
132
|
<p><a class="source-toggle" href="#"
|
|
133
|
-
onclick="toggleCode('
|
|
134
|
-
<div class="method-source-code" id="
|
|
133
|
+
onclick="toggleCode('M000150-source');return false;">[Source]</a></p>
|
|
134
|
+
<div class="method-source-code" id="M000150-source">
|
|
135
135
|
<pre>
|
|
136
136
|
<span class="ruby-comment cmt"># File erubis/evaluator.rb, line 63</span>
|
|
137
137
|
<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>)
|
|
@@ -143,11 +143,11 @@ invoke context.instance_eval(@src)
|
|
|
143
143
|
</div>
|
|
144
144
|
</div>
|
|
145
145
|
|
|
146
|
-
<div id="method-
|
|
147
|
-
<a name="
|
|
146
|
+
<div id="method-M000149" class="method-detail">
|
|
147
|
+
<a name="M000149"></a>
|
|
148
148
|
|
|
149
149
|
<div class="method-heading">
|
|
150
|
-
<a href="#
|
|
150
|
+
<a href="#M000149" class="method-signature">
|
|
151
151
|
<span class="method-name">result</span><span class="method-args">(_binding_or_hash=TOPLEVEL_BINDING)</span>
|
|
152
152
|
</a>
|
|
153
153
|
</div>
|
|
@@ -157,8 +157,8 @@ invoke context.instance_eval(@src)
|
|
|
157
157
|
eval(@src) with binding object
|
|
158
158
|
</p>
|
|
159
159
|
<p><a class="source-toggle" href="#"
|
|
160
|
-
onclick="toggleCode('
|
|
161
|
-
<div class="method-source-code" id="
|
|
160
|
+
onclick="toggleCode('M000149-source');return false;">[Source]</a></p>
|
|
161
|
+
<div class="method-source-code" id="M000149-source">
|
|
162
162
|
<pre>
|
|
163
163
|
<span class="ruby-comment cmt"># File erubis/evaluator.rb, line 52</span>
|
|
164
164
|
<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>)
|
|
@@ -106,7 +106,7 @@ code generator for Ruby
|
|
|
106
106
|
|
|
107
107
|
<div id="includes-list">
|
|
108
108
|
<span class="include-name"><a href="Generator.html">Generator</a></span>
|
|
109
|
-
<span class="include-name"><a href="
|
|
109
|
+
<span class="include-name"><a href="StringBufferEnhancer.html">StringBufferEnhancer</a></span>
|
|
110
110
|
</div>
|
|
111
111
|
</div>
|
|
112
112
|
|
|
@@ -137,7 +137,7 @@ code generator for Ruby
|
|
|
137
137
|
onclick="toggleCode('M000036-source');return false;">[Source]</a></p>
|
|
138
138
|
<div class="method-source-code" id="M000036-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 63</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('M000035-source');return false;">[Source]</a></p>
|
|
163
163
|
<div class="method-source-code" id="M000035-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 59</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('M000034-source');return false;">[Source]</a></p>
|
|
186
186
|
<div class="method-source-code" id="M000034-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 55</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('M000033-source');return false;">[Source]</a></p>
|
|
209
209
|
<div class="method-source-code" id="M000033-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 49</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('M000032-source');return false;">[Source]</a></p>
|
|
234
234
|
<div class="method-source-code" id="M000032-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 45</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('M000030-source');return false;">[Source]</a></p>
|
|
257
257
|
<div class="method-source-code" id="M000030-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 31</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('M000031-source');return false;">[Source]</a></p>
|
|
280
280
|
<div class="method-source-code" id="M000031-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 35</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('M000029-source');return false;">[Source]</a></p>
|
|
303
303
|
<div class="method-source-code" id="M000029-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 22</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>
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
|
|
75
75
|
<div id="description">
|
|
76
76
|
<p>
|
|
77
|
-
get convert faster, but spaces
|
|
78
|
-
not trimmed.
|
|
77
|
+
get <a href="SimplifyEnhancer.html#M000018">convert</a> faster, but spaces
|
|
78
|
+
around ’<%…%>’ are not trimmed.
|
|
79
79
|
</p>
|
|
80
80
|
<p>
|
|
81
81
|
this is language-independent.
|
|
@@ -144,16 +144,17 @@ DEFAULT_REGEXP = /(^[ \t]*)?<%(=+|\#)?(.*?)-?%>([ \t]*\r?\n)?/m
|
|
|
144
144
|
onclick="toggleCode('M000018-source');return false;">[Source]</a></p>
|
|
145
145
|
<div class="method-source-code" id="M000018-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 345</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>)
|
|
151
151
|
<span class="ruby-comment cmt">#regexp = pattern_regexp(@pattern)</span>
|
|
152
152
|
<span class="ruby-identifier">pos</span> = <span class="ruby-value">0</span>
|
|
153
153
|
<span class="ruby-identifier">input</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-constant">SIMPLE_REGEXP</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>
|
|
154
|
-
<span class="ruby-identifier">
|
|
155
|
-
<span class="ruby-identifier">
|
|
156
|
-
<span class="ruby-identifier">
|
|
154
|
+
<span class="ruby-identifier">match</span> = <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">last_match</span>
|
|
155
|
+
<span class="ruby-identifier">index</span> = <span class="ruby-identifier">match</span>.<span class="ruby-identifier">begin</span>(<span class="ruby-value">0</span>)
|
|
156
|
+
<span class="ruby-identifier">text</span> = <span class="ruby-identifier">input</span>[<span class="ruby-identifier">pos</span>, <span class="ruby-identifier">index</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">pos</span>]
|
|
157
|
+
<span class="ruby-identifier">pos</span> = <span class="ruby-identifier">match</span>.<span class="ruby-identifier">end</span>(<span class="ruby-value">0</span>)
|
|
157
158
|
<span class="ruby-identifier">add_text</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">text</span>)
|
|
158
159
|
<span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">indicator</span> <span class="ruby-comment cmt"># <% %></span>
|
|
159
160
|
<span class="ruby-identifier">add_stmt</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>)
|
|
@@ -89,8 +89,8 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
89
89
|
<h3 class="section-bar">Methods</h3>
|
|
90
90
|
|
|
91
91
|
<div class="name-list">
|
|
92
|
-
<a href="#
|
|
93
|
-
<a href="#
|
|
92
|
+
<a href="#M000059">add_postamble</a>
|
|
93
|
+
<a href="#M000058">add_preamble</a>
|
|
94
94
|
</div>
|
|
95
95
|
</div>
|
|
96
96
|
|
|
@@ -112,19 +112,19 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
112
112
|
<div id="methods">
|
|
113
113
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
114
114
|
|
|
115
|
-
<div id="method-
|
|
116
|
-
<a name="
|
|
115
|
+
<div id="method-M000059" class="method-detail">
|
|
116
|
+
<a name="M000059"></a>
|
|
117
117
|
|
|
118
118
|
<div class="method-heading">
|
|
119
|
-
<a href="#
|
|
119
|
+
<a href="#M000059" class="method-signature">
|
|
120
120
|
<span class="method-name">add_postamble</span><span class="method-args">(src)</span>
|
|
121
121
|
</a>
|
|
122
122
|
</div>
|
|
123
123
|
|
|
124
124
|
<div class="method-description">
|
|
125
125
|
<p><a class="source-toggle" href="#"
|
|
126
|
-
onclick="toggleCode('
|
|
127
|
-
<div class="method-source-code" id="
|
|
126
|
+
onclick="toggleCode('M000059-source');return false;">[Source]</a></p>
|
|
127
|
+
<div class="method-source-code" id="M000059-source">
|
|
128
128
|
<pre>
|
|
129
129
|
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 74</span>
|
|
130
130
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_postamble</span>(<span class="ruby-identifier">src</span>)
|
|
@@ -135,19 +135,19 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
135
135
|
</div>
|
|
136
136
|
</div>
|
|
137
137
|
|
|
138
|
-
<div id="method-
|
|
139
|
-
<a name="
|
|
138
|
+
<div id="method-M000058" class="method-detail">
|
|
139
|
+
<a name="M000058"></a>
|
|
140
140
|
|
|
141
141
|
<div class="method-heading">
|
|
142
|
-
<a href="#
|
|
142
|
+
<a href="#M000058" class="method-signature">
|
|
143
143
|
<span class="method-name">add_preamble</span><span class="method-args">(src)</span>
|
|
144
144
|
</a>
|
|
145
145
|
</div>
|
|
146
146
|
|
|
147
147
|
<div class="method-description">
|
|
148
148
|
<p><a class="source-toggle" href="#"
|
|
149
|
-
onclick="toggleCode('
|
|
150
|
-
<div class="method-source-code" id="
|
|
149
|
+
onclick="toggleCode('M000058-source');return false;">[Source]</a></p>
|
|
150
|
+
<div class="method-source-code" id="M000058-source">
|
|
151
151
|
<pre>
|
|
152
152
|
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 70</span>
|
|
153
153
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_preamble</span>(<span class="ruby-identifier">src</span>)
|