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,7 +74,7 @@
|
|
|
74
74
|
|
|
75
75
|
<div id="description">
|
|
76
76
|
<p>
|
|
77
|
-
convert
|
|
77
|
+
<a href="Converter.html#M000070">convert</a>
|
|
78
78
|
</p>
|
|
79
79
|
|
|
80
80
|
</div>
|
|
@@ -86,9 +86,10 @@ convert
|
|
|
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="#
|
|
89
|
+
<a href="#M000070">convert</a>
|
|
90
|
+
<a href="#M000072">convert_input</a>
|
|
91
|
+
<a href="#M000071">detect_spaces_at_bol</a>
|
|
92
|
+
<a href="#M000069">init_converter</a>
|
|
92
93
|
</div>
|
|
93
94
|
</div>
|
|
94
95
|
|
|
@@ -133,22 +134,23 @@ convert
|
|
|
133
134
|
<div id="methods">
|
|
134
135
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
135
136
|
|
|
136
|
-
<div id="method-
|
|
137
|
-
<a name="
|
|
137
|
+
<div id="method-M000070" class="method-detail">
|
|
138
|
+
<a name="M000070"></a>
|
|
138
139
|
|
|
139
140
|
<div class="method-heading">
|
|
140
|
-
<a href="#
|
|
141
|
+
<a href="#M000070" class="method-signature">
|
|
141
142
|
<span class="method-name">convert</span><span class="method-args">(input)</span>
|
|
142
143
|
</a>
|
|
143
144
|
</div>
|
|
144
145
|
|
|
145
146
|
<div class="method-description">
|
|
146
147
|
<p>
|
|
147
|
-
convert input string into target
|
|
148
|
+
<a href="Converter.html#M000070">convert</a> input string into target
|
|
149
|
+
language
|
|
148
150
|
</p>
|
|
149
151
|
<p><a class="source-toggle" href="#"
|
|
150
|
-
onclick="toggleCode('
|
|
151
|
-
<div class="method-source-code" id="
|
|
152
|
+
onclick="toggleCode('M000070-source');return false;">[Source]</a></p>
|
|
153
|
+
<div class="method-source-code" id="M000070-source">
|
|
152
154
|
<pre>
|
|
153
155
|
<span class="ruby-comment cmt"># File erubis/converter.rb, line 34</span>
|
|
154
156
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">convert</span>(<span class="ruby-identifier">input</span>)
|
|
@@ -163,19 +165,19 @@ convert input string into target language
|
|
|
163
165
|
</div>
|
|
164
166
|
</div>
|
|
165
167
|
|
|
166
|
-
<div id="method-
|
|
167
|
-
<a name="
|
|
168
|
+
<div id="method-M000069" class="method-detail">
|
|
169
|
+
<a name="M000069"></a>
|
|
168
170
|
|
|
169
171
|
<div class="method-heading">
|
|
170
|
-
<a href="#
|
|
172
|
+
<a href="#M000069" class="method-signature">
|
|
171
173
|
<span class="method-name">init_converter</span><span class="method-args">(properties={})</span>
|
|
172
174
|
</a>
|
|
173
175
|
</div>
|
|
174
176
|
|
|
175
177
|
<div class="method-description">
|
|
176
178
|
<p><a class="source-toggle" href="#"
|
|
177
|
-
onclick="toggleCode('
|
|
178
|
-
<div class="method-source-code" id="
|
|
179
|
+
onclick="toggleCode('M000069-source');return false;">[Source]</a></p>
|
|
180
|
+
<div class="method-source-code" id="M000069-source">
|
|
179
181
|
<pre>
|
|
180
182
|
<span class="ruby-comment cmt"># File erubis/converter.rb, line 27</span>
|
|
181
183
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">init_converter</span>(<span class="ruby-identifier">properties</span>={})
|
|
@@ -190,24 +192,24 @@ convert input string into target language
|
|
|
190
192
|
|
|
191
193
|
<h3 class="section-bar">Protected Instance methods</h3>
|
|
192
194
|
|
|
193
|
-
<div id="method-
|
|
194
|
-
<a name="
|
|
195
|
+
<div id="method-M000072" class="method-detail">
|
|
196
|
+
<a name="M000072"></a>
|
|
195
197
|
|
|
196
198
|
<div class="method-heading">
|
|
197
|
-
<a href="#
|
|
199
|
+
<a href="#M000072" class="method-signature">
|
|
198
200
|
<span class="method-name">convert_input</span><span class="method-args">(codebuf, input)</span>
|
|
199
201
|
</a>
|
|
200
202
|
</div>
|
|
201
203
|
|
|
202
204
|
<div class="method-description">
|
|
203
205
|
<p>
|
|
204
|
-
(abstract) convert input to code
|
|
206
|
+
(abstract) <a href="Converter.html#M000070">convert</a> input to code
|
|
205
207
|
</p>
|
|
206
208
|
<p><a class="source-toggle" href="#"
|
|
207
|
-
onclick="toggleCode('
|
|
208
|
-
<div class="method-source-code" id="
|
|
209
|
+
onclick="toggleCode('M000072-source');return false;">[Source]</a></p>
|
|
210
|
+
<div class="method-source-code" id="M000072-source">
|
|
209
211
|
<pre>
|
|
210
|
-
<span class="ruby-comment cmt"># File erubis/converter.rb, line
|
|
212
|
+
<span class="ruby-comment cmt"># File erubis/converter.rb, line 77</span>
|
|
211
213
|
<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>)
|
|
212
214
|
<span class="ruby-identifier">not_implemented</span>
|
|
213
215
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -216,6 +218,55 @@ convert input string into target language
|
|
|
216
218
|
</div>
|
|
217
219
|
</div>
|
|
218
220
|
|
|
221
|
+
<div id="method-M000071" class="method-detail">
|
|
222
|
+
<a name="M000071"></a>
|
|
223
|
+
|
|
224
|
+
<div class="method-heading">
|
|
225
|
+
<a href="#M000071" class="method-signature">
|
|
226
|
+
<span class="method-name">detect_spaces_at_bol</span><span class="method-args">(text, is_bol)</span>
|
|
227
|
+
</a>
|
|
228
|
+
</div>
|
|
229
|
+
|
|
230
|
+
<div class="method-description">
|
|
231
|
+
<p>
|
|
232
|
+
detect spaces at beginning of line
|
|
233
|
+
</p>
|
|
234
|
+
<p><a class="source-toggle" href="#"
|
|
235
|
+
onclick="toggleCode('M000071-source');return false;">[Source]</a></p>
|
|
236
|
+
<div class="method-source-code" id="M000071-source">
|
|
237
|
+
<pre>
|
|
238
|
+
<span class="ruby-comment cmt"># File erubis/converter.rb, line 47</span>
|
|
239
|
+
<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>)
|
|
240
|
+
<span class="ruby-identifier">lspace</span> = <span class="ruby-keyword kw">nil</span>
|
|
241
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">empty?</span>
|
|
242
|
+
<span class="ruby-identifier">lspace</span> = <span class="ruby-value str">""</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">is_bol</span>
|
|
243
|
+
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">text</span>[<span class="ruby-value">-1</span>] <span class="ruby-operator">==</span> <span class="ruby-value">?\n</span>
|
|
244
|
+
<span class="ruby-identifier">lspace</span> = <span class="ruby-value str">""</span>
|
|
245
|
+
<span class="ruby-keyword kw">else</span>
|
|
246
|
+
<span class="ruby-identifier">rindex</span> = <span class="ruby-identifier">text</span>.<span class="ruby-identifier">rindex</span>(<span class="ruby-value">?\n</span>)
|
|
247
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">rindex</span>
|
|
248
|
+
<span class="ruby-identifier">s</span> = <span class="ruby-identifier">text</span>[<span class="ruby-identifier">rindex</span><span class="ruby-operator">+</span><span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>]
|
|
249
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">s</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\A[ \t]*\z/</span>
|
|
250
|
+
<span class="ruby-identifier">lspace</span> = <span class="ruby-identifier">s</span>
|
|
251
|
+
<span class="ruby-comment cmt">#text = text[0..rindex]</span>
|
|
252
|
+
<span class="ruby-identifier">text</span>[<span class="ruby-identifier">rindex</span><span class="ruby-operator">+</span><span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>] = <span class="ruby-value str">''</span>
|
|
253
|
+
<span class="ruby-keyword kw">end</span>
|
|
254
|
+
<span class="ruby-keyword kw">else</span>
|
|
255
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">is_bol</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">text</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\A[ \t]*\z/</span>
|
|
256
|
+
<span class="ruby-comment cmt">#lspace = text</span>
|
|
257
|
+
<span class="ruby-comment cmt">#text = nil</span>
|
|
258
|
+
<span class="ruby-identifier">lspace</span> = <span class="ruby-identifier">text</span>.<span class="ruby-identifier">dup</span>
|
|
259
|
+
<span class="ruby-identifier">text</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>] = <span class="ruby-value str">''</span>
|
|
260
|
+
<span class="ruby-keyword kw">end</span>
|
|
261
|
+
<span class="ruby-keyword kw">end</span>
|
|
262
|
+
<span class="ruby-keyword kw">end</span>
|
|
263
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lspace</span>
|
|
264
|
+
<span class="ruby-keyword kw">end</span>
|
|
265
|
+
</pre>
|
|
266
|
+
</div>
|
|
267
|
+
</div>
|
|
268
|
+
</div>
|
|
269
|
+
|
|
219
270
|
|
|
220
271
|
</div>
|
|
221
272
|
|
|
@@ -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="#M000158">convert!</a>
|
|
97
|
+
<a href="#M000159">load_file</a>
|
|
98
|
+
<a href="#M000157">new</a>
|
|
99
|
+
<a href="#M000160">process</a>
|
|
100
|
+
<a href="#M000161">process_proc</a>
|
|
101
101
|
</div>
|
|
102
102
|
</div>
|
|
103
103
|
|
|
@@ -119,29 +119,40 @@ 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-M000159" class="method-detail">
|
|
123
|
+
<a name="M000159"></a>
|
|
124
124
|
|
|
125
125
|
<div class="method-heading">
|
|
126
|
-
<a href="#
|
|
126
|
+
<a href="#M000159" 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>
|
|
130
130
|
|
|
131
131
|
<div class="method-description">
|
|
132
132
|
<p>
|
|
133
|
-
load file and
|
|
133
|
+
load file, write cache file, and return engine object. this method create
|
|
134
|
+
cache file (filename + ’.cache’) automatically.
|
|
134
135
|
</p>
|
|
135
136
|
<p><a class="source-toggle" href="#"
|
|
136
|
-
onclick="toggleCode('
|
|
137
|
-
<div class="method-source-code" id="
|
|
137
|
+
onclick="toggleCode('M000159-source');return false;">[Source]</a></p>
|
|
138
|
+
<div class="method-source-code" id="M000159-source">
|
|
138
139
|
<pre>
|
|
139
|
-
<span class="ruby-comment cmt"># File erubis/engine.rb, line
|
|
140
|
+
<span class="ruby-comment cmt"># File erubis/engine.rb, line 47</span>
|
|
140
141
|
<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>={})
|
|
141
|
-
<span class="ruby-identifier">
|
|
142
|
-
<span class="ruby-identifier">input</span>.<span class="ruby-identifier">untaint</span> <span class="ruby-comment cmt"># is it ok?</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>
|
|
143
143
|
<span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:filename</span>] = <span class="ruby-identifier">filename</span>
|
|
144
|
-
<span class="ruby-identifier">
|
|
144
|
+
<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
|
+
<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
|
+
<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
|
+
<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>) { <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
|
+
<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">'w'</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
|
+
<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
|
+
<span class="ruby-identifier">f</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">engine</span>.<span class="ruby-identifier">src</span>)
|
|
153
|
+
<span class="ruby-keyword kw">end</span>
|
|
154
|
+
<span class="ruby-keyword kw">end</span>
|
|
155
|
+
<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>
|
|
145
156
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">engine</span>
|
|
146
157
|
<span class="ruby-keyword kw">end</span>
|
|
147
158
|
</pre>
|
|
@@ -149,21 +160,26 @@ load file and create engine object
|
|
|
149
160
|
</div>
|
|
150
161
|
</div>
|
|
151
162
|
|
|
152
|
-
<div id="method-
|
|
153
|
-
<a name="
|
|
163
|
+
<div id="method-M000157" class="method-detail">
|
|
164
|
+
<a name="M000157"></a>
|
|
154
165
|
|
|
155
166
|
<div class="method-heading">
|
|
156
|
-
<a href="#
|
|
167
|
+
<a href="#M000157" class="method-signature">
|
|
157
168
|
<span class="method-name">new</span><span class="method-args">(input=nil, properties={})</span>
|
|
158
169
|
</a>
|
|
159
170
|
</div>
|
|
160
171
|
|
|
161
172
|
<div class="method-description">
|
|
173
|
+
<p>
|
|
174
|
+
include <a href="Evaluator.html">Evaluator</a> include <a
|
|
175
|
+
href="Converter.html">Converter</a> include <a
|
|
176
|
+
href="Generator.html">Generator</a>
|
|
177
|
+
</p>
|
|
162
178
|
<p><a class="source-toggle" href="#"
|
|
163
|
-
onclick="toggleCode('
|
|
164
|
-
<div class="method-source-code" id="
|
|
179
|
+
onclick="toggleCode('M000157-source');return false;">[Source]</a></p>
|
|
180
|
+
<div class="method-source-code" id="M000157-source">
|
|
165
181
|
<pre>
|
|
166
|
-
<span class="ruby-comment cmt"># File erubis/engine.rb, line
|
|
182
|
+
<span class="ruby-comment cmt"># File erubis/engine.rb, line 26</span>
|
|
167
183
|
<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>={})
|
|
168
184
|
<span class="ruby-comment cmt">#@input = input</span>
|
|
169
185
|
<span class="ruby-identifier">init_generator</span>(<span class="ruby-identifier">properties</span>)
|
|
@@ -178,11 +194,11 @@ load file and create engine object
|
|
|
178
194
|
|
|
179
195
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
180
196
|
|
|
181
|
-
<div id="method-
|
|
182
|
-
<a name="
|
|
197
|
+
<div id="method-M000158" class="method-detail">
|
|
198
|
+
<a name="M000158"></a>
|
|
183
199
|
|
|
184
200
|
<div class="method-heading">
|
|
185
|
-
<a href="#
|
|
201
|
+
<a href="#M000158" class="method-signature">
|
|
186
202
|
<span class="method-name">convert!</span><span class="method-args">(input)</span>
|
|
187
203
|
</a>
|
|
188
204
|
</div>
|
|
@@ -192,10 +208,10 @@ load file and create engine object
|
|
|
192
208
|
convert input string and set it to @src
|
|
193
209
|
</p>
|
|
194
210
|
<p><a class="source-toggle" href="#"
|
|
195
|
-
onclick="toggleCode('
|
|
196
|
-
<div class="method-source-code" id="
|
|
211
|
+
onclick="toggleCode('M000158-source');return false;">[Source]</a></p>
|
|
212
|
+
<div class="method-source-code" id="M000158-source">
|
|
197
213
|
<pre>
|
|
198
|
-
<span class="ruby-comment cmt"># File erubis/engine.rb, line
|
|
214
|
+
<span class="ruby-comment cmt"># File erubis/engine.rb, line 38</span>
|
|
199
215
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">convert!</span>(<span class="ruby-identifier">input</span>)
|
|
200
216
|
<span class="ruby-ivar">@src</span> = <span class="ruby-identifier">convert</span>(<span class="ruby-identifier">input</span>)
|
|
201
217
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -204,11 +220,11 @@ convert input string and set it to @src
|
|
|
204
220
|
</div>
|
|
205
221
|
</div>
|
|
206
222
|
|
|
207
|
-
<div id="method-
|
|
208
|
-
<a name="
|
|
223
|
+
<div id="method-M000160" class="method-detail">
|
|
224
|
+
<a name="M000160"></a>
|
|
209
225
|
|
|
210
226
|
<div class="method-heading">
|
|
211
|
-
<a href="#
|
|
227
|
+
<a href="#M000160" class="method-signature">
|
|
212
228
|
<span class="method-name">process</span><span class="method-args">(input, context=nil, filename=nil)</span>
|
|
213
229
|
</a>
|
|
214
230
|
</div>
|
|
@@ -219,10 +235,10 @@ helper method to convert and evaluate input text with context object.
|
|
|
219
235
|
context may be Binding, Hash, or Object.
|
|
220
236
|
</p>
|
|
221
237
|
<p><a class="source-toggle" href="#"
|
|
222
|
-
onclick="toggleCode('
|
|
223
|
-
<div class="method-source-code" id="
|
|
238
|
+
onclick="toggleCode('M000160-source');return false;">[Source]</a></p>
|
|
239
|
+
<div class="method-source-code" id="M000160-source">
|
|
224
240
|
<pre>
|
|
225
|
-
<span class="ruby-comment cmt"># File erubis/engine.rb, line
|
|
241
|
+
<span class="ruby-comment cmt"># File erubis/engine.rb, line 70</span>
|
|
226
242
|
<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>)
|
|
227
243
|
<span class="ruby-identifier">code</span> = <span class="ruby-identifier">convert</span>(<span class="ruby-identifier">input</span>)
|
|
228
244
|
<span class="ruby-identifier">filename</span> <span class="ruby-operator">||=</span> <span class="ruby-value str">'(erubis)'</span>
|
|
@@ -238,11 +254,11 @@ context may be Binding, Hash, or Object.
|
|
|
238
254
|
</div>
|
|
239
255
|
</div>
|
|
240
256
|
|
|
241
|
-
<div id="method-
|
|
242
|
-
<a name="
|
|
257
|
+
<div id="method-M000161" class="method-detail">
|
|
258
|
+
<a name="M000161"></a>
|
|
243
259
|
|
|
244
260
|
<div class="method-heading">
|
|
245
|
-
<a href="#
|
|
261
|
+
<a href="#M000161" class="method-signature">
|
|
246
262
|
<span class="method-name">process_proc</span><span class="method-args">(proc_obj, context=nil, filename=nil)</span>
|
|
247
263
|
</a>
|
|
248
264
|
</div>
|
|
@@ -253,10 +269,10 @@ helper method evaluate Proc object iwth contect object. context may be
|
|
|
253
269
|
Binding, Hash, or Object.
|
|
254
270
|
</p>
|
|
255
271
|
<p><a class="source-toggle" href="#"
|
|
256
|
-
onclick="toggleCode('
|
|
257
|
-
<div class="method-source-code" id="
|
|
272
|
+
onclick="toggleCode('M000161-source');return false;">[Source]</a></p>
|
|
273
|
+
<div class="method-source-code" id="M000161-source">
|
|
258
274
|
<pre>
|
|
259
|
-
<span class="ruby-comment cmt"># File erubis/engine.rb, line
|
|
275
|
+
<span class="ruby-comment cmt"># File erubis/engine.rb, line 86</span>
|
|
260
276
|
<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>)
|
|
261
277
|
<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>)
|
|
262
278
|
<span class="ruby-identifier">filename</span> <span class="ruby-operator">||=</span> <span class="ruby-value str">'(erubis)'</span>
|
|
@@ -98,7 +98,7 @@ this is language-indenedent.
|
|
|
98
98
|
<h3 class="section-bar">Methods</h3>
|
|
99
99
|
|
|
100
100
|
<div class="name-list">
|
|
101
|
-
<a href="#
|
|
101
|
+
<a href="#M000089">add_expr</a>
|
|
102
102
|
</div>
|
|
103
103
|
</div>
|
|
104
104
|
|
|
@@ -120,19 +120,19 @@ this is language-indenedent.
|
|
|
120
120
|
<div id="methods">
|
|
121
121
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
122
122
|
|
|
123
|
-
<div id="method-
|
|
124
|
-
<a name="
|
|
123
|
+
<div id="method-M000089" class="method-detail">
|
|
124
|
+
<a name="M000089"></a>
|
|
125
125
|
|
|
126
126
|
<div class="method-heading">
|
|
127
|
-
<a href="#
|
|
127
|
+
<a href="#M000089" class="method-signature">
|
|
128
128
|
<span class="method-name">add_expr</span><span class="method-args">(src, code, indicator)</span>
|
|
129
129
|
</a>
|
|
130
130
|
</div>
|
|
131
131
|
|
|
132
132
|
<div class="method-description">
|
|
133
133
|
<p><a class="source-toggle" href="#"
|
|
134
|
-
onclick="toggleCode('
|
|
135
|
-
<div class="method-source-code" id="
|
|
134
|
+
onclick="toggleCode('M000089-source');return false;">[Source]</a></p>
|
|
135
|
+
<div class="method-source-code" id="M000089-source">
|
|
136
136
|
<pre>
|
|
137
137
|
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 38</span>
|
|
138
138
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_expr</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>, <span class="ruby-identifier">indicator</span>)
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
|
|
75
75
|
<div id="description">
|
|
76
76
|
<p>
|
|
77
|
-
evaluate code
|
|
77
|
+
<a href="Evaluator.html#M000057">evaluate</a> code
|
|
78
78
|
</p>
|
|
79
79
|
|
|
80
80
|
</div>
|
|
@@ -86,9 +86,9 @@ evaluate code
|
|
|
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="#
|
|
89
|
+
<a href="#M000057">evaluate</a>
|
|
90
|
+
<a href="#M000055">init_evaluator</a>
|
|
91
|
+
<a href="#M000056">result</a>
|
|
92
92
|
</div>
|
|
93
93
|
</div>
|
|
94
94
|
|
|
@@ -128,19 +128,19 @@ evaluate code
|
|
|
128
128
|
<div id="methods">
|
|
129
129
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
130
130
|
|
|
131
|
-
<div id="method-
|
|
132
|
-
<a name="
|
|
131
|
+
<div id="method-M000057" class="method-detail">
|
|
132
|
+
<a name="M000057"></a>
|
|
133
133
|
|
|
134
134
|
<div class="method-heading">
|
|
135
|
-
<a href="#
|
|
135
|
+
<a href="#M000057" class="method-signature">
|
|
136
136
|
<span class="method-name">evaluate</span><span class="method-args">(*args)</span>
|
|
137
137
|
</a>
|
|
138
138
|
</div>
|
|
139
139
|
|
|
140
140
|
<div class="method-description">
|
|
141
141
|
<p><a class="source-toggle" href="#"
|
|
142
|
-
onclick="toggleCode('
|
|
143
|
-
<div class="method-source-code" id="
|
|
142
|
+
onclick="toggleCode('M000057-source');return false;">[Source]</a></p>
|
|
143
|
+
<div class="method-source-code" id="M000057-source">
|
|
144
144
|
<pre>
|
|
145
145
|
<span class="ruby-comment cmt"># File erubis/evaluator.rb, line 33</span>
|
|
146
146
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">evaluate</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
|
@@ -151,19 +151,19 @@ evaluate code
|
|
|
151
151
|
</div>
|
|
152
152
|
</div>
|
|
153
153
|
|
|
154
|
-
<div id="method-
|
|
155
|
-
<a name="
|
|
154
|
+
<div id="method-M000055" class="method-detail">
|
|
155
|
+
<a name="M000055"></a>
|
|
156
156
|
|
|
157
157
|
<div class="method-heading">
|
|
158
|
-
<a href="#
|
|
158
|
+
<a href="#M000055" class="method-signature">
|
|
159
159
|
<span class="method-name">init_evaluator</span><span class="method-args">(properties)</span>
|
|
160
160
|
</a>
|
|
161
161
|
</div>
|
|
162
162
|
|
|
163
163
|
<div class="method-description">
|
|
164
164
|
<p><a class="source-toggle" href="#"
|
|
165
|
-
onclick="toggleCode('
|
|
166
|
-
<div class="method-source-code" id="
|
|
165
|
+
onclick="toggleCode('M000055-source');return false;">[Source]</a></p>
|
|
166
|
+
<div class="method-source-code" id="M000055-source">
|
|
167
167
|
<pre>
|
|
168
168
|
<span class="ruby-comment cmt"># File erubis/evaluator.rb, line 25</span>
|
|
169
169
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">init_evaluator</span>(<span class="ruby-identifier">properties</span>)
|
|
@@ -174,19 +174,19 @@ evaluate code
|
|
|
174
174
|
</div>
|
|
175
175
|
</div>
|
|
176
176
|
|
|
177
|
-
<div id="method-
|
|
178
|
-
<a name="
|
|
177
|
+
<div id="method-M000056" class="method-detail">
|
|
178
|
+
<a name="M000056"></a>
|
|
179
179
|
|
|
180
180
|
<div class="method-heading">
|
|
181
|
-
<a href="#
|
|
181
|
+
<a href="#M000056" class="method-signature">
|
|
182
182
|
<span class="method-name">result</span><span class="method-args">(*args)</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('M000056-source');return false;">[Source]</a></p>
|
|
189
|
+
<div class="method-source-code" id="M000056-source">
|
|
190
190
|
<pre>
|
|
191
191
|
<span class="ruby-comment cmt"># File erubis/evaluator.rb, line 29</span>
|
|
192
192
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">result</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|