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
|
@@ -112,13 +112,13 @@ ex.
|
|
|
112
112
|
<h3 class="section-bar">Methods</h3>
|
|
113
113
|
|
|
114
114
|
<div class="name-list">
|
|
115
|
-
<a href="#
|
|
116
|
-
<a href="#
|
|
117
|
-
<a href="#
|
|
118
|
-
<a href="#
|
|
119
|
-
<a href="#
|
|
120
|
-
<a href="#
|
|
121
|
-
<a href="#
|
|
115
|
+
<a href="#M000217">[]</a>
|
|
116
|
+
<a href="#M000218">[]=</a>
|
|
117
|
+
<a href="#M000220">each</a>
|
|
118
|
+
<a href="#M000219">keys</a>
|
|
119
|
+
<a href="#M000216">new</a>
|
|
120
|
+
<a href="#M000221">to_hash</a>
|
|
121
|
+
<a href="#M000222">update</a>
|
|
122
122
|
</div>
|
|
123
123
|
</div>
|
|
124
124
|
|
|
@@ -147,19 +147,19 @@ ex.
|
|
|
147
147
|
<div id="methods">
|
|
148
148
|
<h3 class="section-bar">Public Class methods</h3>
|
|
149
149
|
|
|
150
|
-
<div id="method-
|
|
151
|
-
<a name="
|
|
150
|
+
<div id="method-M000216" class="method-detail">
|
|
151
|
+
<a name="M000216"></a>
|
|
152
152
|
|
|
153
153
|
<div class="method-heading">
|
|
154
|
-
<a href="#
|
|
154
|
+
<a href="#M000216" class="method-signature">
|
|
155
155
|
<span class="method-name">new</span><span class="method-args">(hash=nil)</span>
|
|
156
156
|
</a>
|
|
157
157
|
</div>
|
|
158
158
|
|
|
159
159
|
<div class="method-description">
|
|
160
160
|
<p><a class="source-toggle" href="#"
|
|
161
|
-
onclick="toggleCode('
|
|
162
|
-
<div class="method-source-code" id="
|
|
161
|
+
onclick="toggleCode('M000216-source');return false;">[Source]</a></p>
|
|
162
|
+
<div class="method-source-code" id="M000216-source">
|
|
163
163
|
<pre>
|
|
164
164
|
<span class="ruby-comment cmt"># File erubis/context.rb, line 34</span>
|
|
165
165
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">hash</span>=<span class="ruby-keyword kw">nil</span>)
|
|
@@ -174,19 +174,19 @@ ex.
|
|
|
174
174
|
|
|
175
175
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
176
176
|
|
|
177
|
-
<div id="method-
|
|
178
|
-
<a name="
|
|
177
|
+
<div id="method-M000217" class="method-detail">
|
|
178
|
+
<a name="M000217"></a>
|
|
179
179
|
|
|
180
180
|
<div class="method-heading">
|
|
181
|
-
<a href="#
|
|
181
|
+
<a href="#M000217" class="method-signature">
|
|
182
182
|
<span class="method-name">[]</span><span class="method-args">(key)</span>
|
|
183
183
|
</a>
|
|
184
184
|
</div>
|
|
185
185
|
|
|
186
186
|
<div class="method-description">
|
|
187
187
|
<p><a class="source-toggle" href="#"
|
|
188
|
-
onclick="toggleCode('
|
|
189
|
-
<div class="method-source-code" id="
|
|
188
|
+
onclick="toggleCode('M000217-source');return false;">[Source]</a></p>
|
|
189
|
+
<div class="method-source-code" id="M000217-source">
|
|
190
190
|
<pre>
|
|
191
191
|
<span class="ruby-comment cmt"># File erubis/context.rb, line 40</span>
|
|
192
192
|
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">key</span>)
|
|
@@ -197,19 +197,19 @@ ex.
|
|
|
197
197
|
</div>
|
|
198
198
|
</div>
|
|
199
199
|
|
|
200
|
-
<div id="method-
|
|
201
|
-
<a name="
|
|
200
|
+
<div id="method-M000218" class="method-detail">
|
|
201
|
+
<a name="M000218"></a>
|
|
202
202
|
|
|
203
203
|
<div class="method-heading">
|
|
204
|
-
<a href="#
|
|
204
|
+
<a href="#M000218" class="method-signature">
|
|
205
205
|
<span class="method-name">[]=</span><span class="method-args">(key, value)</span>
|
|
206
206
|
</a>
|
|
207
207
|
</div>
|
|
208
208
|
|
|
209
209
|
<div class="method-description">
|
|
210
210
|
<p><a class="source-toggle" href="#"
|
|
211
|
-
onclick="toggleCode('
|
|
212
|
-
<div class="method-source-code" id="
|
|
211
|
+
onclick="toggleCode('M000218-source');return false;">[Source]</a></p>
|
|
212
|
+
<div class="method-source-code" id="M000218-source">
|
|
213
213
|
<pre>
|
|
214
214
|
<span class="ruby-comment cmt"># File erubis/context.rb, line 44</span>
|
|
215
215
|
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]=</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>)
|
|
@@ -220,19 +220,19 @@ ex.
|
|
|
220
220
|
</div>
|
|
221
221
|
</div>
|
|
222
222
|
|
|
223
|
-
<div id="method-
|
|
224
|
-
<a name="
|
|
223
|
+
<div id="method-M000220" class="method-detail">
|
|
224
|
+
<a name="M000220"></a>
|
|
225
225
|
|
|
226
226
|
<div class="method-heading">
|
|
227
|
-
<a href="#
|
|
227
|
+
<a href="#M000220" class="method-signature">
|
|
228
228
|
<span class="method-name">each</span><span class="method-args">() {|key, value| ...}</span>
|
|
229
229
|
</a>
|
|
230
230
|
</div>
|
|
231
231
|
|
|
232
232
|
<div class="method-description">
|
|
233
233
|
<p><a class="source-toggle" href="#"
|
|
234
|
-
onclick="toggleCode('
|
|
235
|
-
<div class="method-source-code" id="
|
|
234
|
+
onclick="toggleCode('M000220-source');return false;">[Source]</a></p>
|
|
235
|
+
<div class="method-source-code" id="M000220-source">
|
|
236
236
|
<pre>
|
|
237
237
|
<span class="ruby-comment cmt"># File erubis/context.rb, line 52</span>
|
|
238
238
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">each</span>
|
|
@@ -247,19 +247,19 @@ ex.
|
|
|
247
247
|
</div>
|
|
248
248
|
</div>
|
|
249
249
|
|
|
250
|
-
<div id="method-
|
|
251
|
-
<a name="
|
|
250
|
+
<div id="method-M000219" class="method-detail">
|
|
251
|
+
<a name="M000219"></a>
|
|
252
252
|
|
|
253
253
|
<div class="method-heading">
|
|
254
|
-
<a href="#
|
|
254
|
+
<a href="#M000219" class="method-signature">
|
|
255
255
|
<span class="method-name">keys</span><span class="method-args">()</span>
|
|
256
256
|
</a>
|
|
257
257
|
</div>
|
|
258
258
|
|
|
259
259
|
<div class="method-description">
|
|
260
260
|
<p><a class="source-toggle" href="#"
|
|
261
|
-
onclick="toggleCode('
|
|
262
|
-
<div class="method-source-code" id="
|
|
261
|
+
onclick="toggleCode('M000219-source');return false;">[Source]</a></p>
|
|
262
|
+
<div class="method-source-code" id="M000219-source">
|
|
263
263
|
<pre>
|
|
264
264
|
<span class="ruby-comment cmt"># File erubis/context.rb, line 48</span>
|
|
265
265
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">keys</span>
|
|
@@ -270,19 +270,19 @@ ex.
|
|
|
270
270
|
</div>
|
|
271
271
|
</div>
|
|
272
272
|
|
|
273
|
-
<div id="method-
|
|
274
|
-
<a name="
|
|
273
|
+
<div id="method-M000221" class="method-detail">
|
|
274
|
+
<a name="M000221"></a>
|
|
275
275
|
|
|
276
276
|
<div class="method-heading">
|
|
277
|
-
<a href="#
|
|
277
|
+
<a href="#M000221" class="method-signature">
|
|
278
278
|
<span class="method-name">to_hash</span><span class="method-args">()</span>
|
|
279
279
|
</a>
|
|
280
280
|
</div>
|
|
281
281
|
|
|
282
282
|
<div class="method-description">
|
|
283
283
|
<p><a class="source-toggle" href="#"
|
|
284
|
-
onclick="toggleCode('
|
|
285
|
-
<div class="method-source-code" id="
|
|
284
|
+
onclick="toggleCode('M000221-source');return false;">[Source]</a></p>
|
|
285
|
+
<div class="method-source-code" id="M000221-source">
|
|
286
286
|
<pre>
|
|
287
287
|
<span class="ruby-comment cmt"># File erubis/context.rb, line 60</span>
|
|
288
288
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_hash</span>
|
|
@@ -295,19 +295,19 @@ ex.
|
|
|
295
295
|
</div>
|
|
296
296
|
</div>
|
|
297
297
|
|
|
298
|
-
<div id="method-
|
|
299
|
-
<a name="
|
|
298
|
+
<div id="method-M000222" class="method-detail">
|
|
299
|
+
<a name="M000222"></a>
|
|
300
300
|
|
|
301
301
|
<div class="method-heading">
|
|
302
|
-
<a href="#
|
|
302
|
+
<a href="#M000222" class="method-signature">
|
|
303
303
|
<span class="method-name">update</span><span class="method-args">(context_or_hash)</span>
|
|
304
304
|
</a>
|
|
305
305
|
</div>
|
|
306
306
|
|
|
307
307
|
<div class="method-description">
|
|
308
308
|
<p><a class="source-toggle" href="#"
|
|
309
|
-
onclick="toggleCode('
|
|
310
|
-
<div class="method-source-code" id="
|
|
309
|
+
onclick="toggleCode('M000222-source');return false;">[Source]</a></p>
|
|
310
|
+
<div class="method-source-code" id="M000222-source">
|
|
311
311
|
<pre>
|
|
312
312
|
<span class="ruby-comment cmt"># File erubis/context.rb, line 66</span>
|
|
313
313
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">update</span>(<span class="ruby-identifier">context_or_hash</span>)
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
|
|
75
75
|
<div id="description">
|
|
76
76
|
<p>
|
|
77
|
-
<a href="Converter.html#
|
|
77
|
+
<a href="Converter.html#M000082">convert</a>
|
|
78
78
|
</p>
|
|
79
79
|
|
|
80
80
|
</div>
|
|
@@ -86,10 +86,10 @@
|
|
|
86
86
|
<h3 class="section-bar">Methods</h3>
|
|
87
87
|
|
|
88
88
|
<div class="name-list">
|
|
89
|
-
<a href="#
|
|
90
|
-
<a href="#
|
|
91
|
-
<a href="#
|
|
92
|
-
<a href="#
|
|
89
|
+
<a href="#M000082">convert</a>
|
|
90
|
+
<a href="#M000084">convert_input</a>
|
|
91
|
+
<a href="#M000083">detect_spaces_at_bol</a>
|
|
92
|
+
<a href="#M000081">init_converter</a>
|
|
93
93
|
</div>
|
|
94
94
|
</div>
|
|
95
95
|
|
|
@@ -134,23 +134,23 @@
|
|
|
134
134
|
<div id="methods">
|
|
135
135
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
136
136
|
|
|
137
|
-
<div id="method-
|
|
138
|
-
<a name="
|
|
137
|
+
<div id="method-M000082" class="method-detail">
|
|
138
|
+
<a name="M000082"></a>
|
|
139
139
|
|
|
140
140
|
<div class="method-heading">
|
|
141
|
-
<a href="#
|
|
141
|
+
<a href="#M000082" class="method-signature">
|
|
142
142
|
<span class="method-name">convert</span><span class="method-args">(input)</span>
|
|
143
143
|
</a>
|
|
144
144
|
</div>
|
|
145
145
|
|
|
146
146
|
<div class="method-description">
|
|
147
147
|
<p>
|
|
148
|
-
<a href="Converter.html#
|
|
148
|
+
<a href="Converter.html#M000082">convert</a> input string into target
|
|
149
149
|
language
|
|
150
150
|
</p>
|
|
151
151
|
<p><a class="source-toggle" href="#"
|
|
152
|
-
onclick="toggleCode('
|
|
153
|
-
<div class="method-source-code" id="
|
|
152
|
+
onclick="toggleCode('M000082-source');return false;">[Source]</a></p>
|
|
153
|
+
<div class="method-source-code" id="M000082-source">
|
|
154
154
|
<pre>
|
|
155
155
|
<span class="ruby-comment cmt"># File erubis/converter.rb, line 34</span>
|
|
156
156
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">convert</span>(<span class="ruby-identifier">input</span>)
|
|
@@ -166,19 +166,19 @@ language
|
|
|
166
166
|
</div>
|
|
167
167
|
</div>
|
|
168
168
|
|
|
169
|
-
<div id="method-
|
|
170
|
-
<a name="
|
|
169
|
+
<div id="method-M000081" class="method-detail">
|
|
170
|
+
<a name="M000081"></a>
|
|
171
171
|
|
|
172
172
|
<div class="method-heading">
|
|
173
|
-
<a href="#
|
|
173
|
+
<a href="#M000081" class="method-signature">
|
|
174
174
|
<span class="method-name">init_converter</span><span class="method-args">(properties={})</span>
|
|
175
175
|
</a>
|
|
176
176
|
</div>
|
|
177
177
|
|
|
178
178
|
<div class="method-description">
|
|
179
179
|
<p><a class="source-toggle" href="#"
|
|
180
|
-
onclick="toggleCode('
|
|
181
|
-
<div class="method-source-code" id="
|
|
180
|
+
onclick="toggleCode('M000081-source');return false;">[Source]</a></p>
|
|
181
|
+
<div class="method-source-code" id="M000081-source">
|
|
182
182
|
<pre>
|
|
183
183
|
<span class="ruby-comment cmt"># File erubis/converter.rb, line 27</span>
|
|
184
184
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">init_converter</span>(<span class="ruby-identifier">properties</span>={})
|
|
@@ -193,22 +193,22 @@ language
|
|
|
193
193
|
|
|
194
194
|
<h3 class="section-bar">Protected Instance methods</h3>
|
|
195
195
|
|
|
196
|
-
<div id="method-
|
|
197
|
-
<a name="
|
|
196
|
+
<div id="method-M000084" class="method-detail">
|
|
197
|
+
<a name="M000084"></a>
|
|
198
198
|
|
|
199
199
|
<div class="method-heading">
|
|
200
|
-
<a href="#
|
|
200
|
+
<a href="#M000084" class="method-signature">
|
|
201
201
|
<span class="method-name">convert_input</span><span class="method-args">(codebuf, input)</span>
|
|
202
202
|
</a>
|
|
203
203
|
</div>
|
|
204
204
|
|
|
205
205
|
<div class="method-description">
|
|
206
206
|
<p>
|
|
207
|
-
(abstract) <a href="Converter.html#
|
|
207
|
+
(abstract) <a href="Converter.html#M000082">convert</a> input to code
|
|
208
208
|
</p>
|
|
209
209
|
<p><a class="source-toggle" href="#"
|
|
210
|
-
onclick="toggleCode('
|
|
211
|
-
<div class="method-source-code" id="
|
|
210
|
+
onclick="toggleCode('M000084-source');return false;">[Source]</a></p>
|
|
211
|
+
<div class="method-source-code" id="M000084-source">
|
|
212
212
|
<pre>
|
|
213
213
|
<span class="ruby-comment cmt"># File erubis/converter.rb, line 78</span>
|
|
214
214
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">convert_input</span>(<span class="ruby-identifier">codebuf</span>, <span class="ruby-identifier">input</span>)
|
|
@@ -219,11 +219,11 @@ language
|
|
|
219
219
|
</div>
|
|
220
220
|
</div>
|
|
221
221
|
|
|
222
|
-
<div id="method-
|
|
223
|
-
<a name="
|
|
222
|
+
<div id="method-M000083" class="method-detail">
|
|
223
|
+
<a name="M000083"></a>
|
|
224
224
|
|
|
225
225
|
<div class="method-heading">
|
|
226
|
-
<a href="#
|
|
226
|
+
<a href="#M000083" class="method-signature">
|
|
227
227
|
<span class="method-name">detect_spaces_at_bol</span><span class="method-args">(text, is_bol)</span>
|
|
228
228
|
</a>
|
|
229
229
|
</div>
|
|
@@ -233,8 +233,8 @@ language
|
|
|
233
233
|
detect spaces at beginning of line
|
|
234
234
|
</p>
|
|
235
235
|
<p><a class="source-toggle" href="#"
|
|
236
|
-
onclick="toggleCode('
|
|
237
|
-
<div class="method-source-code" id="
|
|
236
|
+
onclick="toggleCode('M000083-source');return false;">[Source]</a></p>
|
|
237
|
+
<div class="method-source-code" id="M000083-source">
|
|
238
238
|
<pre>
|
|
239
239
|
<span class="ruby-comment cmt"># File erubis/converter.rb, line 48</span>
|
|
240
240
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">detect_spaces_at_bol</span>(<span class="ruby-identifier">text</span>, <span class="ruby-identifier">is_bol</span>)
|
|
@@ -89,7 +89,7 @@ this is language-independent.
|
|
|
89
89
|
<h3 class="section-bar">Methods</h3>
|
|
90
90
|
|
|
91
91
|
<div class="name-list">
|
|
92
|
-
<a href="#
|
|
92
|
+
<a href="#M000195">convert_input</a>
|
|
93
93
|
</div>
|
|
94
94
|
</div>
|
|
95
95
|
|
|
@@ -111,19 +111,19 @@ this is language-independent.
|
|
|
111
111
|
<div id="methods">
|
|
112
112
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
113
113
|
|
|
114
|
-
<div id="method-
|
|
115
|
-
<a name="
|
|
114
|
+
<div id="method-M000195" class="method-detail">
|
|
115
|
+
<a name="M000195"></a>
|
|
116
116
|
|
|
117
117
|
<div class="method-heading">
|
|
118
|
-
<a href="#
|
|
118
|
+
<a href="#M000195" class="method-signature">
|
|
119
119
|
<span class="method-name">convert_input</span><span class="method-args">(src, input)</span>
|
|
120
120
|
</a>
|
|
121
121
|
</div>
|
|
122
122
|
|
|
123
123
|
<div class="method-description">
|
|
124
124
|
<p><a class="source-toggle" href="#"
|
|
125
|
-
onclick="toggleCode('
|
|
126
|
-
<div class="method-source-code" id="
|
|
125
|
+
onclick="toggleCode('M000195-source');return false;">[Source]</a></p>
|
|
126
|
+
<div class="method-source-code" id="M000195-source">
|
|
127
127
|
<pre>
|
|
128
128
|
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 571</span>
|
|
129
129
|
<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>)
|
|
@@ -93,11 +93,11 @@ converter module.
|
|
|
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="#
|
|
99
|
-
<a href="#
|
|
100
|
-
<a href="#
|
|
96
|
+
<a href="#M000208">convert!</a>
|
|
97
|
+
<a href="#M000209">load_file</a>
|
|
98
|
+
<a href="#M000207">new</a>
|
|
99
|
+
<a href="#M000210">process</a>
|
|
100
|
+
<a href="#M000211">process_proc</a>
|
|
101
101
|
</div>
|
|
102
102
|
</div>
|
|
103
103
|
|
|
@@ -119,11 +119,11 @@ converter module.
|
|
|
119
119
|
<div id="methods">
|
|
120
120
|
<h3 class="section-bar">Public Class methods</h3>
|
|
121
121
|
|
|
122
|
-
<div id="method-
|
|
123
|
-
<a name="
|
|
122
|
+
<div id="method-M000209" class="method-detail">
|
|
123
|
+
<a name="M000209"></a>
|
|
124
124
|
|
|
125
125
|
<div class="method-heading">
|
|
126
|
-
<a href="#
|
|
126
|
+
<a href="#M000209" class="method-signature">
|
|
127
127
|
<span class="method-name">load_file</span><span class="method-args">(filename, properties={})</span>
|
|
128
128
|
</a>
|
|
129
129
|
</div>
|
|
@@ -131,25 +131,28 @@ converter module.
|
|
|
131
131
|
<div class="method-description">
|
|
132
132
|
<p>
|
|
133
133
|
load file, write cache file, and return engine object. this method create
|
|
134
|
-
cache file
|
|
134
|
+
code cache file automatically. cachefile name can be specified with
|
|
135
|
+
properties[:cachename], or filname + ‘cache’ is used as
|
|
136
|
+
default.
|
|
135
137
|
</p>
|
|
136
138
|
<p><a class="source-toggle" href="#"
|
|
137
|
-
onclick="toggleCode('
|
|
138
|
-
<div class="method-source-code" id="
|
|
139
|
+
onclick="toggleCode('M000209-source');return false;">[Source]</a></p>
|
|
140
|
+
<div class="method-source-code" id="M000209-source">
|
|
139
141
|
<pre>
|
|
140
|
-
<span class="ruby-comment cmt"># File erubis/engine.rb, line
|
|
142
|
+
<span class="ruby-comment cmt"># File erubis/engine.rb, line 49</span>
|
|
141
143
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">load_file</span>(<span class="ruby-identifier">filename</span>, <span class="ruby-identifier">properties</span>={})
|
|
142
|
-
<span class="ruby-identifier">cachename</span> = <span class="ruby-identifier">filename</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'.cache'</span>
|
|
144
|
+
<span class="ruby-identifier">cachename</span> = <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:cachename</span>] <span class="ruby-operator">||</span> (<span class="ruby-identifier">filename</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'.cache'</span>)
|
|
143
145
|
<span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:filename</span>] = <span class="ruby-identifier">filename</span>
|
|
144
146
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">test</span>(<span class="ruby-value">?f</span>, <span class="ruby-identifier">cachename</span>) <span class="ruby-operator">&&</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">mtime</span>(<span class="ruby-identifier">filename</span>) <span class="ruby-operator"><=</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">mtime</span>(<span class="ruby-identifier">cachename</span>)
|
|
145
147
|
<span class="ruby-identifier">engine</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">properties</span>)
|
|
146
148
|
<span class="ruby-identifier">engine</span>.<span class="ruby-identifier">src</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">cachename</span>)
|
|
147
149
|
<span class="ruby-keyword kw">else</span>
|
|
148
|
-
<span class="ruby-identifier">input</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">filename</span>, <span class="ruby-value str">'rb'</span>) {
|
|
150
|
+
<span class="ruby-identifier">input</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">filename</span>, <span class="ruby-value str">'rb'</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">read</span> }
|
|
149
151
|
<span class="ruby-identifier">engine</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">input</span>, <span class="ruby-identifier">properties</span>)
|
|
150
|
-
<span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">cachename</span>, <span class="ruby-value str">'
|
|
152
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">cachename</span>, <span class="ruby-value str">'wb'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
|
|
151
153
|
<span class="ruby-identifier">f</span>.<span class="ruby-identifier">flock</span>(<span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">LOCK_EX</span>)
|
|
152
154
|
<span class="ruby-identifier">f</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">engine</span>.<span class="ruby-identifier">src</span>)
|
|
155
|
+
<span class="ruby-identifier">f</span>.<span class="ruby-identifier">flush</span>()
|
|
153
156
|
<span class="ruby-keyword kw">end</span>
|
|
154
157
|
<span class="ruby-keyword kw">end</span>
|
|
155
158
|
<span class="ruby-identifier">engine</span>.<span class="ruby-identifier">src</span>.<span class="ruby-identifier">untaint</span> <span class="ruby-comment cmt"># ok?</span>
|
|
@@ -160,11 +163,11 @@ cache file (filename + ’.cache’) automatically.
|
|
|
160
163
|
</div>
|
|
161
164
|
</div>
|
|
162
165
|
|
|
163
|
-
<div id="method-
|
|
164
|
-
<a name="
|
|
166
|
+
<div id="method-M000207" class="method-detail">
|
|
167
|
+
<a name="M000207"></a>
|
|
165
168
|
|
|
166
169
|
<div class="method-heading">
|
|
167
|
-
<a href="#
|
|
170
|
+
<a href="#M000207" class="method-signature">
|
|
168
171
|
<span class="method-name">new</span><span class="method-args">(input=nil, properties={})</span>
|
|
169
172
|
</a>
|
|
170
173
|
</div>
|
|
@@ -176,8 +179,8 @@ href="Converter.html">Converter</a> include <a
|
|
|
176
179
|
href="Generator.html">Generator</a>
|
|
177
180
|
</p>
|
|
178
181
|
<p><a class="source-toggle" href="#"
|
|
179
|
-
onclick="toggleCode('
|
|
180
|
-
<div class="method-source-code" id="
|
|
182
|
+
onclick="toggleCode('M000207-source');return false;">[Source]</a></p>
|
|
183
|
+
<div class="method-source-code" id="M000207-source">
|
|
181
184
|
<pre>
|
|
182
185
|
<span class="ruby-comment cmt"># File erubis/engine.rb, line 26</span>
|
|
183
186
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">input</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">properties</span>={})
|
|
@@ -194,11 +197,11 @@ href="Generator.html">Generator</a>
|
|
|
194
197
|
|
|
195
198
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
196
199
|
|
|
197
|
-
<div id="method-
|
|
198
|
-
<a name="
|
|
200
|
+
<div id="method-M000208" class="method-detail">
|
|
201
|
+
<a name="M000208"></a>
|
|
199
202
|
|
|
200
203
|
<div class="method-heading">
|
|
201
|
-
<a href="#
|
|
204
|
+
<a href="#M000208" class="method-signature">
|
|
202
205
|
<span class="method-name">convert!</span><span class="method-args">(input)</span>
|
|
203
206
|
</a>
|
|
204
207
|
</div>
|
|
@@ -208,8 +211,8 @@ href="Generator.html">Generator</a>
|
|
|
208
211
|
convert input string and set it to @src
|
|
209
212
|
</p>
|
|
210
213
|
<p><a class="source-toggle" href="#"
|
|
211
|
-
onclick="toggleCode('
|
|
212
|
-
<div class="method-source-code" id="
|
|
214
|
+
onclick="toggleCode('M000208-source');return false;">[Source]</a></p>
|
|
215
|
+
<div class="method-source-code" id="M000208-source">
|
|
213
216
|
<pre>
|
|
214
217
|
<span class="ruby-comment cmt"># File erubis/engine.rb, line 38</span>
|
|
215
218
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">convert!</span>(<span class="ruby-identifier">input</span>)
|
|
@@ -220,11 +223,11 @@ convert input string and set it to @src
|
|
|
220
223
|
</div>
|
|
221
224
|
</div>
|
|
222
225
|
|
|
223
|
-
<div id="method-
|
|
224
|
-
<a name="
|
|
226
|
+
<div id="method-M000210" class="method-detail">
|
|
227
|
+
<a name="M000210"></a>
|
|
225
228
|
|
|
226
229
|
<div class="method-heading">
|
|
227
|
-
<a href="#
|
|
230
|
+
<a href="#M000210" class="method-signature">
|
|
228
231
|
<span class="method-name">process</span><span class="method-args">(input, context=nil, filename=nil)</span>
|
|
229
232
|
</a>
|
|
230
233
|
</div>
|
|
@@ -235,10 +238,10 @@ helper method to convert and evaluate input text with context object.
|
|
|
235
238
|
context may be Binding, Hash, or Object.
|
|
236
239
|
</p>
|
|
237
240
|
<p><a class="source-toggle" href="#"
|
|
238
|
-
onclick="toggleCode('
|
|
239
|
-
<div class="method-source-code" id="
|
|
241
|
+
onclick="toggleCode('M000210-source');return false;">[Source]</a></p>
|
|
242
|
+
<div class="method-source-code" id="M000210-source">
|
|
240
243
|
<pre>
|
|
241
|
-
<span class="ruby-comment cmt"># File erubis/engine.rb, line
|
|
244
|
+
<span class="ruby-comment cmt"># File erubis/engine.rb, line 73</span>
|
|
242
245
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process</span>(<span class="ruby-identifier">input</span>, <span class="ruby-identifier">context</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">filename</span>=<span class="ruby-keyword kw">nil</span>)
|
|
243
246
|
<span class="ruby-identifier">code</span> = <span class="ruby-identifier">convert</span>(<span class="ruby-identifier">input</span>)
|
|
244
247
|
<span class="ruby-identifier">filename</span> <span class="ruby-operator">||=</span> <span class="ruby-value str">'(erubis)'</span>
|
|
@@ -254,11 +257,11 @@ context may be Binding, Hash, or Object.
|
|
|
254
257
|
</div>
|
|
255
258
|
</div>
|
|
256
259
|
|
|
257
|
-
<div id="method-
|
|
258
|
-
<a name="
|
|
260
|
+
<div id="method-M000211" class="method-detail">
|
|
261
|
+
<a name="M000211"></a>
|
|
259
262
|
|
|
260
263
|
<div class="method-heading">
|
|
261
|
-
<a href="#
|
|
264
|
+
<a href="#M000211" class="method-signature">
|
|
262
265
|
<span class="method-name">process_proc</span><span class="method-args">(proc_obj, context=nil, filename=nil)</span>
|
|
263
266
|
</a>
|
|
264
267
|
</div>
|
|
@@ -269,10 +272,10 @@ helper method evaluate Proc object with contect object. context may be
|
|
|
269
272
|
Binding, Hash, or Object.
|
|
270
273
|
</p>
|
|
271
274
|
<p><a class="source-toggle" href="#"
|
|
272
|
-
onclick="toggleCode('
|
|
273
|
-
<div class="method-source-code" id="
|
|
275
|
+
onclick="toggleCode('M000211-source');return false;">[Source]</a></p>
|
|
276
|
+
<div class="method-source-code" id="M000211-source">
|
|
274
277
|
<pre>
|
|
275
|
-
<span class="ruby-comment cmt"># File erubis/engine.rb, line
|
|
278
|
+
<span class="ruby-comment cmt"># File erubis/engine.rb, line 89</span>
|
|
276
279
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process_proc</span>(<span class="ruby-identifier">proc_obj</span>, <span class="ruby-identifier">context</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">filename</span>=<span class="ruby-keyword kw">nil</span>)
|
|
277
280
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">context</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Binding</span>)
|
|
278
281
|
<span class="ruby-identifier">filename</span> <span class="ruby-operator">||=</span> <span class="ruby-value str">'(erubis)'</span>
|