erubis 2.5.0 → 2.6.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/CHANGES.txt +62 -2
- data/README.txt +1 -1
- data/benchmark/bench.rb +18 -10
- data/bin/erubis +1 -1
- data/contrib/erubis +2 -3318
- data/contrib/inline-require +1 -1
- data/doc-api/classes/ActionView.html +105 -0
- data/doc-api/classes/ActionView/TemplateHandlers/Erubis.html +202 -0
- data/doc-api/classes/Erubis.html +7 -1
- data/doc-api/classes/Erubis/ArrayBufferEnhancer.html +12 -12
- data/doc-api/classes/Erubis/ArrayEnhancer.html +12 -12
- data/doc-api/classes/Erubis/Basic/Converter.html +34 -30
- data/doc-api/classes/Erubis/BiPatternEnhancer.html +12 -12
- data/doc-api/classes/Erubis/CGenerator.html +60 -60
- data/doc-api/classes/Erubis/Context.html +42 -42
- data/doc-api/classes/Erubis/Converter.html +27 -27
- data/doc-api/classes/Erubis/DeleteIndentEnhancer.html +6 -6
- data/doc-api/classes/Erubis/Engine.html +40 -37
- data/doc-api/classes/Erubis/ErboutEnhancer.html +12 -12
- 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 +60 -60
- data/doc-api/classes/Erubis/HeaderFooterEnhancer.html +12 -12
- data/doc-api/classes/Erubis/Helpers/RailsFormHelper.html +201 -176
- data/doc-api/classes/Erubis/Helpers/RailsHelper.html +58 -58
- data/doc-api/classes/Erubis/Helpers/RailsHelper/{PreprocessingEruby.html → TemplateConverter.html} +24 -37
- data/doc-api/classes/Erubis/InterpolationEnhancer.html +36 -35
- 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 +19 -19
- data/doc-api/classes/Erubis/NoCodeEnhancer.html +30 -30
- data/doc-api/classes/Erubis/NoTextEnhancer.html +6 -6
- 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 +21 -21
- 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 +6 -6
- data/doc-api/classes/Erubis/PI/Escheme.html +6 -6
- data/doc-api/classes/Erubis/PI/TinyEruby.html +24 -24
- data/doc-api/classes/Erubis/PercentLineEnhancer.html +6 -6
- data/doc-api/classes/Erubis/PerlGenerator.html +54 -54
- data/doc-api/classes/Erubis/PhpGenerator.html +54 -54
- data/doc-api/classes/Erubis/PreprocessingEruby.html +183 -0
- data/doc-api/classes/Erubis/PreprocessingHelper.html +212 -0
- data/doc-api/classes/Erubis/PrintEnabledEnhancer.html +20 -20
- data/doc-api/classes/Erubis/PrintOutEnhancer.html +30 -30
- data/doc-api/classes/Erubis/RubyEvaluator.html +18 -18
- data/doc-api/classes/Erubis/RubyGenerator.html +48 -48
- data/doc-api/classes/Erubis/SchemeGenerator.html +60 -60
- data/doc-api/classes/Erubis/SimplifyEnhancer.html +7 -7
- data/doc-api/classes/Erubis/StdoutEnhancer.html +12 -12
- data/doc-api/classes/Erubis/StringBufferEnhancer.html +12 -12
- data/doc-api/classes/Erubis/TinyEruby.html +24 -24
- data/doc-api/classes/Erubis/XmlHelper.html +30 -30
- data/doc-api/created.rid +1 -1
- data/doc-api/files/README_txt.html +2 -2
- data/doc-api/files/erubis/context_rb.html +1 -1
- data/doc-api/files/erubis/converter_rb.html +2 -2
- data/doc-api/files/erubis/engine/ec_rb.html +1 -1
- data/doc-api/files/erubis/engine/ejava_rb.html +1 -1
- data/doc-api/files/erubis/engine/ejavascript_rb.html +1 -1
- data/doc-api/files/erubis/engine/enhanced_rb.html +1 -1
- data/doc-api/files/erubis/engine/eperl_rb.html +1 -1
- data/doc-api/files/erubis/engine/ephp_rb.html +1 -1
- data/doc-api/files/erubis/engine/eruby_rb.html +1 -1
- data/doc-api/files/erubis/engine/escheme_rb.html +1 -1
- data/doc-api/files/erubis/engine/optimized_rb.html +1 -1
- 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 +1 -1
- data/doc-api/files/erubis/evaluator_rb.html +1 -1
- data/doc-api/files/erubis/generator_rb.html +1 -1
- data/doc-api/files/erubis/helper_rb.html +1 -1
- data/doc-api/files/erubis/helpers/rails_form_helper_rb.html +2 -2
- data/doc-api/files/erubis/helpers/rails_helper_rb.html +3 -3
- data/doc-api/files/erubis/local-setting_rb.html +1 -1
- data/doc-api/files/erubis/main_rb.html +1 -1
- data/doc-api/files/erubis/preprocessing_rb.html +114 -0
- data/doc-api/files/erubis/tiny_rb.html +1 -1
- data/doc-api/files/erubis_rb.html +1 -1
- data/doc-api/fr_class_index.html +5 -1
- data/doc-api/fr_file_index.html +1 -0
- data/doc-api/fr_method_index.html +223 -213
- data/doc/users-guide.html +75 -6
- data/lib/erubis.rb +2 -2
- data/lib/erubis/context.rb +1 -1
- data/lib/erubis/converter.rb +11 -7
- data/lib/erubis/engine.rb +9 -6
- data/lib/erubis/engine/ec.rb +1 -1
- data/lib/erubis/engine/ejava.rb +1 -1
- data/lib/erubis/engine/ejavascript.rb +1 -1
- data/lib/erubis/engine/enhanced.rb +1 -1
- data/lib/erubis/engine/eperl.rb +1 -1
- data/lib/erubis/engine/ephp.rb +1 -1
- data/lib/erubis/engine/eruby.rb +1 -1
- data/lib/erubis/engine/escheme.rb +1 -1
- data/lib/erubis/engine/optimized.rb +1 -1
- data/lib/erubis/enhancer.rb +4 -3
- data/lib/erubis/error.rb +1 -1
- data/lib/erubis/evaluator.rb +1 -1
- data/lib/erubis/generator.rb +1 -1
- data/lib/erubis/helper.rb +1 -1
- data/lib/erubis/helpers/rails_form_helper.rb +18 -10
- data/lib/erubis/helpers/rails_helper.rb +100 -98
- data/lib/erubis/local-setting.rb +1 -1
- data/lib/erubis/main.rb +1 -1
- data/lib/erubis/preprocessing.rb +59 -0
- data/lib/erubis/tiny.rb +1 -1
- data/test/assert-text-equal.rb +1 -1
- data/test/data/users-guide/stderr.log +3 -0
- data/test/data/users-guide/tail_260.result +4 -0
- data/test/data/users-guide/tailnewline.rhtml +3 -0
- data/test/test-engines.rb +1 -1
- data/test/test-enhancers.rb +1 -1
- data/test/test-erubis.rb +44 -2
- data/test/test-main.rb +2 -2
- data/test/test-users-guide.rb +1 -1
- data/test/test.rb +1 -1
- data/test/testutil.rb +1 -1
- metadata +15 -5
- data/contrib/action_view_base_rb.patch +0 -23
|
@@ -111,14 +111,14 @@ if ENV[‘RAILS_ENV’] == ‘development’.
|
|
|
111
111
|
<h3 class="section-bar">Methods</h3>
|
|
112
112
|
|
|
113
113
|
<div class="name-list">
|
|
114
|
-
<a href="#
|
|
115
|
-
<a href="#
|
|
116
|
-
<a href="#
|
|
117
|
-
<a href="#
|
|
118
|
-
<a href="#
|
|
119
|
-
<a href="#
|
|
120
|
-
<a href="#
|
|
121
|
-
<a href="#
|
|
114
|
+
<a href="#M000085">engine_class</a>
|
|
115
|
+
<a href="#M000086">engine_class=</a>
|
|
116
|
+
<a href="#M000087">init_properties</a>
|
|
117
|
+
<a href="#M000088">init_properties=</a>
|
|
118
|
+
<a href="#M000091">preprocessing</a>
|
|
119
|
+
<a href="#M000092">preprocessing=</a>
|
|
120
|
+
<a href="#M000089">show_src</a>
|
|
121
|
+
<a href="#M000090">show_src=</a>
|
|
122
122
|
</div>
|
|
123
123
|
</div>
|
|
124
124
|
|
|
@@ -132,7 +132,7 @@ if ENV[‘RAILS_ENV’] == ‘development’.
|
|
|
132
132
|
<div id="class-list">
|
|
133
133
|
<h3 class="section-bar">Classes and Modules</h3>
|
|
134
134
|
|
|
135
|
-
|
|
135
|
+
Module <a href="RailsHelper/TemplateConverter.html" class="link">Erubis::Helpers::RailsHelper::TemplateConverter</a><br />
|
|
136
136
|
|
|
137
137
|
</div>
|
|
138
138
|
|
|
@@ -146,25 +146,25 @@ if ENV[‘RAILS_ENV’] == ‘development’.
|
|
|
146
146
|
<div id="methods">
|
|
147
147
|
<h3 class="section-bar">Public Class methods</h3>
|
|
148
148
|
|
|
149
|
-
<div id="method-
|
|
150
|
-
<a name="
|
|
149
|
+
<div id="method-M000085" class="method-detail">
|
|
150
|
+
<a name="M000085"></a>
|
|
151
151
|
|
|
152
152
|
<div class="method-heading">
|
|
153
|
-
<a href="#
|
|
153
|
+
<a href="#M000085" class="method-signature">
|
|
154
154
|
<span class="method-name">engine_class</span><span class="method-args">()</span>
|
|
155
155
|
</a>
|
|
156
156
|
</div>
|
|
157
157
|
|
|
158
158
|
<div class="method-description">
|
|
159
159
|
<p>
|
|
160
|
-
@@<a href="RailsHelper.html#
|
|
160
|
+
@@<a href="RailsHelper.html#M000085">engine_class</a> = ::<a
|
|
161
161
|
href="../FastEruby.html">Erubis::FastEruby</a>
|
|
162
162
|
</p>
|
|
163
163
|
<p><a class="source-toggle" href="#"
|
|
164
|
-
onclick="toggleCode('
|
|
165
|
-
<div class="method-source-code" id="
|
|
164
|
+
onclick="toggleCode('M000085-source');return false;">[Source]</a></p>
|
|
165
|
+
<div class="method-source-code" id="M000085-source">
|
|
166
166
|
<pre>
|
|
167
|
-
<span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line
|
|
167
|
+
<span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line 48</span>
|
|
168
168
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">engine_class</span>
|
|
169
169
|
<span class="ruby-ivar">@@engine_class</span>
|
|
170
170
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -173,21 +173,21 @@ href="../FastEruby.html">Erubis::FastEruby</a>
|
|
|
173
173
|
</div>
|
|
174
174
|
</div>
|
|
175
175
|
|
|
176
|
-
<div id="method-
|
|
177
|
-
<a name="
|
|
176
|
+
<div id="method-M000086" class="method-detail">
|
|
177
|
+
<a name="M000086"></a>
|
|
178
178
|
|
|
179
179
|
<div class="method-heading">
|
|
180
|
-
<a href="#
|
|
180
|
+
<a href="#M000086" class="method-signature">
|
|
181
181
|
<span class="method-name">engine_class=</span><span class="method-args">(klass)</span>
|
|
182
182
|
</a>
|
|
183
183
|
</div>
|
|
184
184
|
|
|
185
185
|
<div class="method-description">
|
|
186
186
|
<p><a class="source-toggle" href="#"
|
|
187
|
-
onclick="toggleCode('
|
|
188
|
-
<div class="method-source-code" id="
|
|
187
|
+
onclick="toggleCode('M000086-source');return false;">[Source]</a></p>
|
|
188
|
+
<div class="method-source-code" id="M000086-source">
|
|
189
189
|
<pre>
|
|
190
|
-
<span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line
|
|
190
|
+
<span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line 51</span>
|
|
191
191
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">engine_class=</span>(<span class="ruby-identifier">klass</span>)
|
|
192
192
|
<span class="ruby-ivar">@@engine_class</span> = <span class="ruby-identifier">klass</span>
|
|
193
193
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -196,21 +196,21 @@ href="../FastEruby.html">Erubis::FastEruby</a>
|
|
|
196
196
|
</div>
|
|
197
197
|
</div>
|
|
198
198
|
|
|
199
|
-
<div id="method-
|
|
200
|
-
<a name="
|
|
199
|
+
<div id="method-M000087" class="method-detail">
|
|
200
|
+
<a name="M000087"></a>
|
|
201
201
|
|
|
202
202
|
<div class="method-heading">
|
|
203
|
-
<a href="#
|
|
203
|
+
<a href="#M000087" class="method-signature">
|
|
204
204
|
<span class="method-name">init_properties</span><span class="method-args">()</span>
|
|
205
205
|
</a>
|
|
206
206
|
</div>
|
|
207
207
|
|
|
208
208
|
<div class="method-description">
|
|
209
209
|
<p><a class="source-toggle" href="#"
|
|
210
|
-
onclick="toggleCode('
|
|
211
|
-
<div class="method-source-code" id="
|
|
210
|
+
onclick="toggleCode('M000087-source');return false;">[Source]</a></p>
|
|
211
|
+
<div class="method-source-code" id="M000087-source">
|
|
212
212
|
<pre>
|
|
213
|
-
<span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line
|
|
213
|
+
<span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line 57</span>
|
|
214
214
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">init_properties</span>
|
|
215
215
|
<span class="ruby-ivar">@@init_properties</span>
|
|
216
216
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -219,21 +219,21 @@ href="../FastEruby.html">Erubis::FastEruby</a>
|
|
|
219
219
|
</div>
|
|
220
220
|
</div>
|
|
221
221
|
|
|
222
|
-
<div id="method-
|
|
223
|
-
<a name="
|
|
222
|
+
<div id="method-M000088" class="method-detail">
|
|
223
|
+
<a name="M000088"></a>
|
|
224
224
|
|
|
225
225
|
<div class="method-heading">
|
|
226
|
-
<a href="#
|
|
226
|
+
<a href="#M000088" class="method-signature">
|
|
227
227
|
<span class="method-name">init_properties=</span><span class="method-args">(hash)</span>
|
|
228
228
|
</a>
|
|
229
229
|
</div>
|
|
230
230
|
|
|
231
231
|
<div class="method-description">
|
|
232
232
|
<p><a class="source-toggle" href="#"
|
|
233
|
-
onclick="toggleCode('
|
|
234
|
-
<div class="method-source-code" id="
|
|
233
|
+
onclick="toggleCode('M000088-source');return false;">[Source]</a></p>
|
|
234
|
+
<div class="method-source-code" id="M000088-source">
|
|
235
235
|
<pre>
|
|
236
|
-
<span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line
|
|
236
|
+
<span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line 60</span>
|
|
237
237
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">init_properties=</span>(<span class="ruby-identifier">hash</span>)
|
|
238
238
|
<span class="ruby-ivar">@@init_properties</span> = <span class="ruby-identifier">hash</span>
|
|
239
239
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -242,21 +242,21 @@ href="../FastEruby.html">Erubis::FastEruby</a>
|
|
|
242
242
|
</div>
|
|
243
243
|
</div>
|
|
244
244
|
|
|
245
|
-
<div id="method-
|
|
246
|
-
<a name="
|
|
245
|
+
<div id="method-M000091" class="method-detail">
|
|
246
|
+
<a name="M000091"></a>
|
|
247
247
|
|
|
248
248
|
<div class="method-heading">
|
|
249
|
-
<a href="#
|
|
249
|
+
<a href="#M000091" class="method-signature">
|
|
250
250
|
<span class="method-name">preprocessing</span><span class="method-args">()</span>
|
|
251
251
|
</a>
|
|
252
252
|
</div>
|
|
253
253
|
|
|
254
254
|
<div class="method-description">
|
|
255
255
|
<p><a class="source-toggle" href="#"
|
|
256
|
-
onclick="toggleCode('
|
|
257
|
-
<div class="method-source-code" id="
|
|
256
|
+
onclick="toggleCode('M000091-source');return false;">[Source]</a></p>
|
|
257
|
+
<div class="method-source-code" id="M000091-source">
|
|
258
258
|
<pre>
|
|
259
|
-
<span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line
|
|
259
|
+
<span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line 75</span>
|
|
260
260
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">preprocessing</span>
|
|
261
261
|
<span class="ruby-ivar">@@preprocessing</span>
|
|
262
262
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -265,21 +265,21 @@ href="../FastEruby.html">Erubis::FastEruby</a>
|
|
|
265
265
|
</div>
|
|
266
266
|
</div>
|
|
267
267
|
|
|
268
|
-
<div id="method-
|
|
269
|
-
<a name="
|
|
268
|
+
<div id="method-M000092" class="method-detail">
|
|
269
|
+
<a name="M000092"></a>
|
|
270
270
|
|
|
271
271
|
<div class="method-heading">
|
|
272
|
-
<a href="#
|
|
272
|
+
<a href="#M000092" class="method-signature">
|
|
273
273
|
<span class="method-name">preprocessing=</span><span class="method-args">(flag)</span>
|
|
274
274
|
</a>
|
|
275
275
|
</div>
|
|
276
276
|
|
|
277
277
|
<div class="method-description">
|
|
278
278
|
<p><a class="source-toggle" href="#"
|
|
279
|
-
onclick="toggleCode('
|
|
280
|
-
<div class="method-source-code" id="
|
|
279
|
+
onclick="toggleCode('M000092-source');return false;">[Source]</a></p>
|
|
280
|
+
<div class="method-source-code" id="M000092-source">
|
|
281
281
|
<pre>
|
|
282
|
-
<span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line
|
|
282
|
+
<span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line 78</span>
|
|
283
283
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">preprocessing=</span>(<span class="ruby-identifier">flag</span>)
|
|
284
284
|
<span class="ruby-ivar">@@preprocessing</span> = <span class="ruby-identifier">flag</span>
|
|
285
285
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -288,21 +288,21 @@ href="../FastEruby.html">Erubis::FastEruby</a>
|
|
|
288
288
|
</div>
|
|
289
289
|
</div>
|
|
290
290
|
|
|
291
|
-
<div id="method-
|
|
292
|
-
<a name="
|
|
291
|
+
<div id="method-M000089" class="method-detail">
|
|
292
|
+
<a name="M000089"></a>
|
|
293
293
|
|
|
294
294
|
<div class="method-heading">
|
|
295
|
-
<a href="#
|
|
295
|
+
<a href="#M000089" class="method-signature">
|
|
296
296
|
<span class="method-name">show_src</span><span class="method-args">()</span>
|
|
297
297
|
</a>
|
|
298
298
|
</div>
|
|
299
299
|
|
|
300
300
|
<div class="method-description">
|
|
301
301
|
<p><a class="source-toggle" href="#"
|
|
302
|
-
onclick="toggleCode('
|
|
303
|
-
<div class="method-source-code" id="
|
|
302
|
+
onclick="toggleCode('M000089-source');return false;">[Source]</a></p>
|
|
303
|
+
<div class="method-source-code" id="M000089-source">
|
|
304
304
|
<pre>
|
|
305
|
-
<span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line
|
|
305
|
+
<span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line 66</span>
|
|
306
306
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">show_src</span>
|
|
307
307
|
<span class="ruby-ivar">@@show_src</span>
|
|
308
308
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -311,21 +311,21 @@ href="../FastEruby.html">Erubis::FastEruby</a>
|
|
|
311
311
|
</div>
|
|
312
312
|
</div>
|
|
313
313
|
|
|
314
|
-
<div id="method-
|
|
315
|
-
<a name="
|
|
314
|
+
<div id="method-M000090" class="method-detail">
|
|
315
|
+
<a name="M000090"></a>
|
|
316
316
|
|
|
317
317
|
<div class="method-heading">
|
|
318
|
-
<a href="#
|
|
318
|
+
<a href="#M000090" class="method-signature">
|
|
319
319
|
<span class="method-name">show_src=</span><span class="method-args">(flag)</span>
|
|
320
320
|
</a>
|
|
321
321
|
</div>
|
|
322
322
|
|
|
323
323
|
<div class="method-description">
|
|
324
324
|
<p><a class="source-toggle" href="#"
|
|
325
|
-
onclick="toggleCode('
|
|
326
|
-
<div class="method-source-code" id="
|
|
325
|
+
onclick="toggleCode('M000090-source');return false;">[Source]</a></p>
|
|
326
|
+
<div class="method-source-code" id="M000090-source">
|
|
327
327
|
<pre>
|
|
328
|
-
<span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line
|
|
328
|
+
<span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line 69</span>
|
|
329
329
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">show_src=</span>(<span class="ruby-identifier">flag</span>)
|
|
330
330
|
<span class="ruby-ivar">@@show_src</span> = <span class="ruby-identifier">flag</span>
|
|
331
331
|
<span class="ruby-keyword kw">end</span>
|
data/doc-api/classes/Erubis/Helpers/RailsHelper/{PreprocessingEruby.html → TemplateConverter.html}
RENAMED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>Module: Erubis::Helpers::RailsHelper::TemplateConverter</title>
|
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
10
|
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
11
11
|
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
<div id="classHeader">
|
|
50
50
|
<table class="header-table">
|
|
51
51
|
<tr class="top-aligned-row">
|
|
52
|
-
<td><strong>
|
|
53
|
-
<td class="class-name-in-header">Erubis::Helpers::RailsHelper::
|
|
52
|
+
<td><strong>Module</strong></td>
|
|
53
|
+
<td class="class-name-in-header">Erubis::Helpers::RailsHelper::TemplateConverter</td>
|
|
54
54
|
</tr>
|
|
55
55
|
<tr class="top-aligned-row">
|
|
56
56
|
<td><strong>In:</strong></td>
|
|
@@ -62,14 +62,6 @@
|
|
|
62
62
|
</td>
|
|
63
63
|
</tr>
|
|
64
64
|
|
|
65
|
-
<tr class="top-aligned-row">
|
|
66
|
-
<td><strong>Parent:</strong></td>
|
|
67
|
-
<td>
|
|
68
|
-
<a href="../../Eruby.html">
|
|
69
|
-
Erubis::Eruby
|
|
70
|
-
</a>
|
|
71
|
-
</td>
|
|
72
|
-
</tr>
|
|
73
65
|
</table>
|
|
74
66
|
</div>
|
|
75
67
|
<!-- banner header -->
|
|
@@ -88,8 +80,8 @@
|
|
|
88
80
|
<h3 class="section-bar">Methods</h3>
|
|
89
81
|
|
|
90
82
|
<div class="name-list">
|
|
91
|
-
<a href="#
|
|
92
|
-
<a href="#
|
|
83
|
+
<a href="#M000093">_create_preprocessor</a>
|
|
84
|
+
<a href="#M000094">_preprocessing_context_object</a>
|
|
93
85
|
</div>
|
|
94
86
|
</div>
|
|
95
87
|
|
|
@@ -109,53 +101,48 @@
|
|
|
109
101
|
|
|
110
102
|
<!-- if method_list -->
|
|
111
103
|
<div id="methods">
|
|
112
|
-
<h3 class="section-bar">Public
|
|
104
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
|
113
105
|
|
|
114
|
-
<div id="method-
|
|
115
|
-
<a name="
|
|
106
|
+
<div id="method-M000093" class="method-detail">
|
|
107
|
+
<a name="M000093"></a>
|
|
116
108
|
|
|
117
109
|
<div class="method-heading">
|
|
118
|
-
<a href="#
|
|
119
|
-
<span class="method-name">
|
|
110
|
+
<a href="#M000093" class="method-signature">
|
|
111
|
+
<span class="method-name">_create_preprocessor</span><span class="method-args">(template)</span>
|
|
120
112
|
</a>
|
|
121
113
|
</div>
|
|
122
114
|
|
|
123
115
|
<div class="method-description">
|
|
124
116
|
<p><a class="source-toggle" href="#"
|
|
125
|
-
onclick="toggleCode('
|
|
126
|
-
<div class="method-source-code" id="
|
|
117
|
+
onclick="toggleCode('M000093-source');return false;">[Source]</a></p>
|
|
118
|
+
<div class="method-source-code" id="M000093-source">
|
|
127
119
|
<pre>
|
|
128
|
-
<span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line
|
|
129
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
|
130
|
-
<span class="ruby-
|
|
131
|
-
<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:pattern</span>] = <span class="ruby-value str">'\[% %\]'</span> <span class="ruby-comment cmt"># use '[%= %]' instead of '<%= %>'</span>
|
|
132
|
-
<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:escape</span>] = <span class="ruby-keyword kw">true</span> <span class="ruby-comment cmt"># transport '[%= %]' and '[%== %]'</span>
|
|
133
|
-
<span class="ruby-keyword kw">super</span>
|
|
120
|
+
<span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line 108</span>
|
|
121
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_create_preprocessor</span>(<span class="ruby-identifier">template</span>)
|
|
122
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-constant">PreprocessingEruby</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">template</span>, <span class="ruby-identifier">:escape=</span><span class="ruby-operator">></span><span class="ruby-keyword kw">true</span>)
|
|
134
123
|
<span class="ruby-keyword kw">end</span>
|
|
135
124
|
</pre>
|
|
136
125
|
</div>
|
|
137
126
|
</div>
|
|
138
127
|
</div>
|
|
139
128
|
|
|
140
|
-
<
|
|
141
|
-
|
|
142
|
-
<div id="method-M000087" class="method-detail">
|
|
143
|
-
<a name="M000087"></a>
|
|
129
|
+
<div id="method-M000094" class="method-detail">
|
|
130
|
+
<a name="M000094"></a>
|
|
144
131
|
|
|
145
132
|
<div class="method-heading">
|
|
146
|
-
<a href="#
|
|
147
|
-
<span class="method-name">
|
|
133
|
+
<a href="#M000094" class="method-signature">
|
|
134
|
+
<span class="method-name">_preprocessing_context_object</span><span class="method-args">()</span>
|
|
148
135
|
</a>
|
|
149
136
|
</div>
|
|
150
137
|
|
|
151
138
|
<div class="method-description">
|
|
152
139
|
<p><a class="source-toggle" href="#"
|
|
153
|
-
onclick="toggleCode('
|
|
154
|
-
<div class="method-source-code" id="
|
|
140
|
+
onclick="toggleCode('M000094-source');return false;">[Source]</a></p>
|
|
141
|
+
<div class="method-source-code" id="M000094-source">
|
|
155
142
|
<pre>
|
|
156
|
-
<span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line
|
|
157
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
|
158
|
-
<span class="ruby-
|
|
143
|
+
<span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line 111</span>
|
|
144
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_preprocessing_context_object</span>
|
|
145
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>
|
|
159
146
|
<span class="ruby-keyword kw">end</span>
|
|
160
147
|
</pre>
|
|
161
148
|
</div>
|
|
@@ -90,11 +90,11 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
90
90
|
<h3 class="section-bar">Methods</h3>
|
|
91
91
|
|
|
92
92
|
<div class="name-list">
|
|
93
|
-
<a href="#
|
|
94
|
-
<a href="#
|
|
95
|
-
<a href="#
|
|
96
|
-
<a href="#
|
|
97
|
-
<a href="#
|
|
93
|
+
<a href="#M000023">_add_text_to_str</a>
|
|
94
|
+
<a href="#M000024">add_expr_escaped</a>
|
|
95
|
+
<a href="#M000025">add_expr_literal</a>
|
|
96
|
+
<a href="#M000022">add_text</a>
|
|
97
|
+
<a href="#M000021">convert_input</a>
|
|
98
98
|
</div>
|
|
99
99
|
</div>
|
|
100
100
|
|
|
@@ -116,21 +116,21 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
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-M000023" class="method-detail">
|
|
120
|
+
<a name="M000023"></a>
|
|
121
121
|
|
|
122
122
|
<div class="method-heading">
|
|
123
|
-
<a href="#
|
|
123
|
+
<a href="#M000023" class="method-signature">
|
|
124
124
|
<span class="method-name">_add_text_to_str</span><span class="method-args">(str, text)</span>
|
|
125
125
|
</a>
|
|
126
126
|
</div>
|
|
127
127
|
|
|
128
128
|
<div class="method-description">
|
|
129
129
|
<p><a class="source-toggle" href="#"
|
|
130
|
-
onclick="toggleCode('
|
|
131
|
-
<div class="method-source-code" id="
|
|
130
|
+
onclick="toggleCode('M000023-source');return false;">[Source]</a></p>
|
|
131
|
+
<div class="method-source-code" id="M000023-source">
|
|
132
132
|
<pre>
|
|
133
|
-
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line
|
|
133
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 655</span>
|
|
134
134
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_add_text_to_str</span>(<span class="ruby-identifier">str</span>, <span class="ruby-identifier">text</span>)
|
|
135
135
|
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">text</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">empty?</span>
|
|
136
136
|
<span class="ruby-identifier">text</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/['\#\\]/</span>, <span class="ruby-value str">'\\\\\&'</span>)
|
|
@@ -141,21 +141,21 @@ 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-M000024" class="method-detail">
|
|
145
|
+
<a name="M000024"></a>
|
|
146
146
|
|
|
147
147
|
<div class="method-heading">
|
|
148
|
-
<a href="#
|
|
148
|
+
<a href="#M000024" class="method-signature">
|
|
149
149
|
<span class="method-name">add_expr_escaped</span><span class="method-args">(str, code)</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('M000024-source');return false;">[Source]</a></p>
|
|
156
|
+
<div class="method-source-code" id="M000024-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 661</span>
|
|
159
159
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_expr_escaped</span>(<span class="ruby-identifier">str</span>, <span class="ruby-identifier">code</span>)
|
|
160
160
|
<span class="ruby-identifier">str</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"\#{#{escaped_expr(code)}}"</span>
|
|
161
161
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -164,21 +164,21 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
164
164
|
</div>
|
|
165
165
|
</div>
|
|
166
166
|
|
|
167
|
-
<div id="method-
|
|
168
|
-
<a name="
|
|
167
|
+
<div id="method-M000025" class="method-detail">
|
|
168
|
+
<a name="M000025"></a>
|
|
169
169
|
|
|
170
170
|
<div class="method-heading">
|
|
171
|
-
<a href="#
|
|
171
|
+
<a href="#M000025" class="method-signature">
|
|
172
172
|
<span class="method-name">add_expr_literal</span><span class="method-args">(str, code)</span>
|
|
173
173
|
</a>
|
|
174
174
|
</div>
|
|
175
175
|
|
|
176
176
|
<div class="method-description">
|
|
177
177
|
<p><a class="source-toggle" href="#"
|
|
178
|
-
onclick="toggleCode('
|
|
179
|
-
<div class="method-source-code" id="
|
|
178
|
+
onclick="toggleCode('M000025-source');return false;">[Source]</a></p>
|
|
179
|
+
<div class="method-source-code" id="M000025-source">
|
|
180
180
|
<pre>
|
|
181
|
-
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line
|
|
181
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 665</span>
|
|
182
182
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_expr_literal</span>(<span class="ruby-identifier">str</span>, <span class="ruby-identifier">code</span>)
|
|
183
183
|
<span class="ruby-identifier">str</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"\#{#{code}}"</span>
|
|
184
184
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -187,21 +187,21 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
187
187
|
</div>
|
|
188
188
|
</div>
|
|
189
189
|
|
|
190
|
-
<div id="method-
|
|
191
|
-
<a name="
|
|
190
|
+
<div id="method-M000022" class="method-detail">
|
|
191
|
+
<a name="M000022"></a>
|
|
192
192
|
|
|
193
193
|
<div class="method-heading">
|
|
194
|
-
<a href="#
|
|
194
|
+
<a href="#M000022" class="method-signature">
|
|
195
195
|
<span class="method-name">add_text</span><span class="method-args">(src, text)</span>
|
|
196
196
|
</a>
|
|
197
197
|
</div>
|
|
198
198
|
|
|
199
199
|
<div class="method-description">
|
|
200
200
|
<p><a class="source-toggle" href="#"
|
|
201
|
-
onclick="toggleCode('
|
|
202
|
-
<div class="method-source-code" id="
|
|
201
|
+
onclick="toggleCode('M000022-source');return false;">[Source]</a></p>
|
|
202
|
+
<div class="method-source-code" id="M000022-source">
|
|
203
203
|
<pre>
|
|
204
|
-
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line
|
|
204
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 644</span>
|
|
205
205
|
<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>)
|
|
206
206
|
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">text</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">empty?</span>
|
|
207
207
|
<span class="ruby-comment cmt">#src << " _buf << %Q`" << text << "`;"</span>
|
|
@@ -217,19 +217,19 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
217
217
|
</div>
|
|
218
218
|
</div>
|
|
219
219
|
|
|
220
|
-
<div id="method-
|
|
221
|
-
<a name="
|
|
220
|
+
<div id="method-M000021" class="method-detail">
|
|
221
|
+
<a name="M000021"></a>
|
|
222
222
|
|
|
223
223
|
<div class="method-heading">
|
|
224
|
-
<a href="#
|
|
224
|
+
<a href="#M000021" class="method-signature">
|
|
225
225
|
<span class="method-name">convert_input</span><span class="method-args">(src, input)</span>
|
|
226
226
|
</a>
|
|
227
227
|
</div>
|
|
228
228
|
|
|
229
229
|
<div class="method-description">
|
|
230
230
|
<p><a class="source-toggle" href="#"
|
|
231
|
-
onclick="toggleCode('
|
|
232
|
-
<div class="method-source-code" id="
|
|
231
|
+
onclick="toggleCode('M000021-source');return false;">[Source]</a></p>
|
|
232
|
+
<div class="method-source-code" id="M000021-source">
|
|
233
233
|
<pre>
|
|
234
234
|
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 590</span>
|
|
235
235
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">convert_input</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">input</span>)
|
|
@@ -238,7 +238,7 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
238
238
|
<span class="ruby-identifier">pos</span> = <span class="ruby-value">0</span>
|
|
239
239
|
<span class="ruby-identifier">is_bol</span> = <span class="ruby-keyword kw">true</span> <span class="ruby-comment cmt"># is beginning of line</span>
|
|
240
240
|
<span class="ruby-identifier">str</span> = <span class="ruby-value str">''</span>
|
|
241
|
-
<span class="ruby-identifier">input</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-identifier">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-identifier">rspace</span><span class="ruby-operator">|</span>
|
|
241
|
+
<span class="ruby-identifier">input</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-identifier">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-identifier">tailch</span>, <span class="ruby-identifier">rspace</span><span class="ruby-operator">|</span>
|
|
242
242
|
<span class="ruby-identifier">match</span> = <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">last_match</span>()
|
|
243
243
|
<span class="ruby-identifier">len</span> = <span class="ruby-identifier">match</span>.<span class="ruby-identifier">begin</span>(<span class="ruby-value">0</span>) <span class="ruby-operator">-</span> <span class="ruby-identifier">pos</span>
|
|
244
244
|
<span class="ruby-identifier">text</span> = <span class="ruby-identifier">input</span>[<span class="ruby-identifier">pos</span>, <span class="ruby-identifier">len</span>]
|
|
@@ -250,6 +250,7 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
250
250
|
<span class="ruby-comment cmt">## * when '<%= %>', do nothing</span>
|
|
251
251
|
<span class="ruby-comment cmt">## * when '<% %>' or '<%# %>', delete spaces iff only spaces are around '<% %>'</span>
|
|
252
252
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">ch</span> <span class="ruby-operator">==</span> <span class="ruby-value">?=</span> <span class="ruby-comment cmt"># <%= %></span>
|
|
253
|
+
<span class="ruby-identifier">rspace</span> = <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">tailch</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">tailch</span>.<span class="ruby-identifier">empty?</span>
|
|
253
254
|
<span class="ruby-identifier">str</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">lspace</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">lspace</span>
|
|
254
255
|
<span class="ruby-identifier">add_expr</span>(<span class="ruby-identifier">str</span>, <span class="ruby-identifier">code</span>, <span class="ruby-identifier">indicator</span>)
|
|
255
256
|
<span class="ruby-identifier">str</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">rspace</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">rspace</span>
|