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
|
@@ -119,8 +119,8 @@ this is language independent.
|
|
|
119
119
|
<h3 class="section-bar">Methods</h3>
|
|
120
120
|
|
|
121
121
|
<div class="name-list">
|
|
122
|
-
<a href="#
|
|
123
|
-
<a href="#
|
|
122
|
+
<a href="#M000122">add_text</a>
|
|
123
|
+
<a href="#M000121">new</a>
|
|
124
124
|
</div>
|
|
125
125
|
</div>
|
|
126
126
|
|
|
@@ -142,21 +142,21 @@ this is language independent.
|
|
|
142
142
|
<div id="methods">
|
|
143
143
|
<h3 class="section-bar">Public Class methods</h3>
|
|
144
144
|
|
|
145
|
-
<div id="method-
|
|
146
|
-
<a name="
|
|
145
|
+
<div id="method-M000121" class="method-detail">
|
|
146
|
+
<a name="M000121"></a>
|
|
147
147
|
|
|
148
148
|
<div class="method-heading">
|
|
149
|
-
<a href="#
|
|
149
|
+
<a href="#M000121" class="method-signature">
|
|
150
150
|
<span class="method-name">new</span><span class="method-args">(input, properties={})</span>
|
|
151
151
|
</a>
|
|
152
152
|
</div>
|
|
153
153
|
|
|
154
154
|
<div class="method-description">
|
|
155
155
|
<p><a class="source-toggle" href="#"
|
|
156
|
-
onclick="toggleCode('
|
|
157
|
-
<div class="method-source-code" id="
|
|
156
|
+
onclick="toggleCode('M000121-source');return false;">[Source]</a></p>
|
|
157
|
+
<div class="method-source-code" id="M000121-source">
|
|
158
158
|
<pre>
|
|
159
|
-
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line
|
|
159
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 410</span>
|
|
160
160
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">input</span>, <span class="ruby-identifier">properties</span>={})
|
|
161
161
|
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">bipattern</span> = <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:bipattern</span>] <span class="ruby-comment cmt"># or '\$\{ \}'</span>
|
|
162
162
|
<span class="ruby-keyword kw">super</span>
|
|
@@ -168,21 +168,21 @@ this is language independent.
|
|
|
168
168
|
|
|
169
169
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
170
170
|
|
|
171
|
-
<div id="method-
|
|
172
|
-
<a name="
|
|
171
|
+
<div id="method-M000122" class="method-detail">
|
|
172
|
+
<a name="M000122"></a>
|
|
173
173
|
|
|
174
174
|
<div class="method-heading">
|
|
175
|
-
<a href="#
|
|
175
|
+
<a href="#M000122" class="method-signature">
|
|
176
176
|
<span class="method-name">add_text</span><span class="method-args">(src, text)</span>
|
|
177
177
|
</a>
|
|
178
178
|
</div>
|
|
179
179
|
|
|
180
180
|
<div class="method-description">
|
|
181
181
|
<p><a class="source-toggle" href="#"
|
|
182
|
-
onclick="toggleCode('
|
|
183
|
-
<div class="method-source-code" id="
|
|
182
|
+
onclick="toggleCode('M000122-source');return false;">[Source]</a></p>
|
|
183
|
+
<div class="method-source-code" id="M000122-source">
|
|
184
184
|
<pre>
|
|
185
|
-
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line
|
|
185
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 422</span>
|
|
186
186
|
<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>)
|
|
187
187
|
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">text</span>
|
|
188
188
|
<span class="ruby-identifier">text</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-ivar">@bipattern_regexp</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">txt</span>, <span class="ruby-identifier">indicator</span>, <span class="ruby-identifier">code</span><span class="ruby-operator">|</span>
|
|
@@ -80,16 +80,16 @@
|
|
|
80
80
|
<h3 class="section-bar">Methods</h3>
|
|
81
81
|
|
|
82
82
|
<div class="name-list">
|
|
83
|
-
<a href="#
|
|
84
|
-
<a href="#
|
|
85
|
-
<a href="#
|
|
86
|
-
<a href="#
|
|
87
|
-
<a href="#
|
|
88
|
-
<a href="#
|
|
89
|
-
<a href="#
|
|
90
|
-
<a href="#
|
|
91
|
-
<a href="#
|
|
92
|
-
<a href="#
|
|
83
|
+
<a href="#M000119">add_expr_debug</a>
|
|
84
|
+
<a href="#M000118">add_expr_escaped</a>
|
|
85
|
+
<a href="#M000117">add_expr_literal</a>
|
|
86
|
+
<a href="#M000120">add_postamble</a>
|
|
87
|
+
<a href="#M000112">add_preamble</a>
|
|
88
|
+
<a href="#M000116">add_stmt</a>
|
|
89
|
+
<a href="#M000115">add_text</a>
|
|
90
|
+
<a href="#M000113">escape_text</a>
|
|
91
|
+
<a href="#M000114">escaped_expr</a>
|
|
92
|
+
<a href="#M000111">init_generator</a>
|
|
93
93
|
</div>
|
|
94
94
|
</div>
|
|
95
95
|
|
|
@@ -118,19 +118,19 @@
|
|
|
118
118
|
<div id="methods">
|
|
119
119
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
120
120
|
|
|
121
|
-
<div id="method-
|
|
122
|
-
<a name="
|
|
121
|
+
<div id="method-M000119" class="method-detail">
|
|
122
|
+
<a name="M000119"></a>
|
|
123
123
|
|
|
124
124
|
<div class="method-heading">
|
|
125
|
-
<a href="#
|
|
125
|
+
<a href="#M000119" class="method-signature">
|
|
126
126
|
<span class="method-name">add_expr_debug</span><span class="method-args">(src, code)</span>
|
|
127
127
|
</a>
|
|
128
128
|
</div>
|
|
129
129
|
|
|
130
130
|
<div class="method-description">
|
|
131
131
|
<p><a class="source-toggle" href="#"
|
|
132
|
-
onclick="toggleCode('
|
|
133
|
-
<div class="method-source-code" id="
|
|
132
|
+
onclick="toggleCode('M000119-source');return false;">[Source]</a></p>
|
|
133
|
+
<div class="method-source-code" id="M000119-source">
|
|
134
134
|
<pre>
|
|
135
135
|
<span class="ruby-comment cmt"># File erubis/engine/ec.rb, line 73</span>
|
|
136
136
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_expr_debug</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>)
|
|
@@ -147,19 +147,19 @@
|
|
|
147
147
|
</div>
|
|
148
148
|
</div>
|
|
149
149
|
|
|
150
|
-
<div id="method-
|
|
151
|
-
<a name="
|
|
150
|
+
<div id="method-M000118" class="method-detail">
|
|
151
|
+
<a name="M000118"></a>
|
|
152
152
|
|
|
153
153
|
<div class="method-heading">
|
|
154
|
-
<a href="#
|
|
154
|
+
<a href="#M000118" class="method-signature">
|
|
155
155
|
<span class="method-name">add_expr_escaped</span><span class="method-args">(src, code)</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('M000118-source');return false;">[Source]</a></p>
|
|
162
|
+
<div class="method-source-code" id="M000118-source">
|
|
163
163
|
<pre>
|
|
164
164
|
<span class="ruby-comment cmt"># File erubis/engine/ec.rb, line 68</span>
|
|
165
165
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_expr_escaped</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>)
|
|
@@ -171,19 +171,19 @@
|
|
|
171
171
|
</div>
|
|
172
172
|
</div>
|
|
173
173
|
|
|
174
|
-
<div id="method-
|
|
175
|
-
<a name="
|
|
174
|
+
<div id="method-M000117" class="method-detail">
|
|
175
|
+
<a name="M000117"></a>
|
|
176
176
|
|
|
177
177
|
<div class="method-heading">
|
|
178
|
-
<a href="#
|
|
178
|
+
<a href="#M000117" class="method-signature">
|
|
179
179
|
<span class="method-name">add_expr_literal</span><span class="method-args">(src, code)</span>
|
|
180
180
|
</a>
|
|
181
181
|
</div>
|
|
182
182
|
|
|
183
183
|
<div class="method-description">
|
|
184
184
|
<p><a class="source-toggle" href="#"
|
|
185
|
-
onclick="toggleCode('
|
|
186
|
-
<div class="method-source-code" id="
|
|
185
|
+
onclick="toggleCode('M000117-source');return false;">[Source]</a></p>
|
|
186
|
+
<div class="method-source-code" id="M000117-source">
|
|
187
187
|
<pre>
|
|
188
188
|
<span class="ruby-comment cmt"># File erubis/engine/ec.rb, line 63</span>
|
|
189
189
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_expr_literal</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>)
|
|
@@ -195,19 +195,19 @@
|
|
|
195
195
|
</div>
|
|
196
196
|
</div>
|
|
197
197
|
|
|
198
|
-
<div id="method-
|
|
199
|
-
<a name="
|
|
198
|
+
<div id="method-M000120" class="method-detail">
|
|
199
|
+
<a name="M000120"></a>
|
|
200
200
|
|
|
201
201
|
<div class="method-heading">
|
|
202
|
-
<a href="#
|
|
202
|
+
<a href="#M000120" class="method-signature">
|
|
203
203
|
<span class="method-name">add_postamble</span><span class="method-args">(src)</span>
|
|
204
204
|
</a>
|
|
205
205
|
</div>
|
|
206
206
|
|
|
207
207
|
<div class="method-description">
|
|
208
208
|
<p><a class="source-toggle" href="#"
|
|
209
|
-
onclick="toggleCode('
|
|
210
|
-
<div class="method-source-code" id="
|
|
209
|
+
onclick="toggleCode('M000120-source');return false;">[Source]</a></p>
|
|
210
|
+
<div class="method-source-code" id="M000120-source">
|
|
211
211
|
<pre>
|
|
212
212
|
<span class="ruby-comment cmt"># File erubis/engine/ec.rb, line 83</span>
|
|
213
213
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_postamble</span>(<span class="ruby-identifier">src</span>)
|
|
@@ -218,19 +218,19 @@
|
|
|
218
218
|
</div>
|
|
219
219
|
</div>
|
|
220
220
|
|
|
221
|
-
<div id="method-
|
|
222
|
-
<a name="
|
|
221
|
+
<div id="method-M000112" class="method-detail">
|
|
222
|
+
<a name="M000112"></a>
|
|
223
223
|
|
|
224
224
|
<div class="method-heading">
|
|
225
|
-
<a href="#
|
|
225
|
+
<a href="#M000112" class="method-signature">
|
|
226
226
|
<span class="method-name">add_preamble</span><span class="method-args">(src)</span>
|
|
227
227
|
</a>
|
|
228
228
|
</div>
|
|
229
229
|
|
|
230
230
|
<div class="method-description">
|
|
231
231
|
<p><a class="source-toggle" href="#"
|
|
232
|
-
onclick="toggleCode('
|
|
233
|
-
<div class="method-source-code" id="
|
|
232
|
+
onclick="toggleCode('M000112-source');return false;">[Source]</a></p>
|
|
233
|
+
<div class="method-source-code" id="M000112-source">
|
|
234
234
|
<pre>
|
|
235
235
|
<span class="ruby-comment cmt"># File erubis/engine/ec.rb, line 31</span>
|
|
236
236
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_preamble</span>(<span class="ruby-identifier">src</span>)
|
|
@@ -241,19 +241,19 @@
|
|
|
241
241
|
</div>
|
|
242
242
|
</div>
|
|
243
243
|
|
|
244
|
-
<div id="method-
|
|
245
|
-
<a name="
|
|
244
|
+
<div id="method-M000116" class="method-detail">
|
|
245
|
+
<a name="M000116"></a>
|
|
246
246
|
|
|
247
247
|
<div class="method-heading">
|
|
248
|
-
<a href="#
|
|
248
|
+
<a href="#M000116" class="method-signature">
|
|
249
249
|
<span class="method-name">add_stmt</span><span class="method-args">(src, code)</span>
|
|
250
250
|
</a>
|
|
251
251
|
</div>
|
|
252
252
|
|
|
253
253
|
<div class="method-description">
|
|
254
254
|
<p><a class="source-toggle" href="#"
|
|
255
|
-
onclick="toggleCode('
|
|
256
|
-
<div class="method-source-code" id="
|
|
255
|
+
onclick="toggleCode('M000116-source');return false;">[Source]</a></p>
|
|
256
|
+
<div class="method-source-code" id="M000116-source">
|
|
257
257
|
<pre>
|
|
258
258
|
<span class="ruby-comment cmt"># File erubis/engine/ec.rb, line 59</span>
|
|
259
259
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_stmt</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>)
|
|
@@ -264,19 +264,19 @@
|
|
|
264
264
|
</div>
|
|
265
265
|
</div>
|
|
266
266
|
|
|
267
|
-
<div id="method-
|
|
268
|
-
<a name="
|
|
267
|
+
<div id="method-M000115" class="method-detail">
|
|
268
|
+
<a name="M000115"></a>
|
|
269
269
|
|
|
270
270
|
<div class="method-heading">
|
|
271
|
-
<a href="#
|
|
271
|
+
<a href="#M000115" class="method-signature">
|
|
272
272
|
<span class="method-name">add_text</span><span class="method-args">(src, text)</span>
|
|
273
273
|
</a>
|
|
274
274
|
</div>
|
|
275
275
|
|
|
276
276
|
<div class="method-description">
|
|
277
277
|
<p><a class="source-toggle" href="#"
|
|
278
|
-
onclick="toggleCode('
|
|
279
|
-
<div class="method-source-code" id="
|
|
278
|
+
onclick="toggleCode('M000115-source');return false;">[Source]</a></p>
|
|
279
|
+
<div class="method-source-code" id="M000115-source">
|
|
280
280
|
<pre>
|
|
281
281
|
<span class="ruby-comment cmt"># File erubis/engine/ec.rb, line 45</span>
|
|
282
282
|
<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>)
|
|
@@ -297,19 +297,19 @@
|
|
|
297
297
|
</div>
|
|
298
298
|
</div>
|
|
299
299
|
|
|
300
|
-
<div id="method-
|
|
301
|
-
<a name="
|
|
300
|
+
<div id="method-M000113" class="method-detail">
|
|
301
|
+
<a name="M000113"></a>
|
|
302
302
|
|
|
303
303
|
<div class="method-heading">
|
|
304
|
-
<a href="#
|
|
304
|
+
<a href="#M000113" class="method-signature">
|
|
305
305
|
<span class="method-name">escape_text</span><span class="method-args">(text)</span>
|
|
306
306
|
</a>
|
|
307
307
|
</div>
|
|
308
308
|
|
|
309
309
|
<div class="method-description">
|
|
310
310
|
<p><a class="source-toggle" href="#"
|
|
311
|
-
onclick="toggleCode('
|
|
312
|
-
<div class="method-source-code" id="
|
|
311
|
+
onclick="toggleCode('M000113-source');return false;">[Source]</a></p>
|
|
312
|
+
<div class="method-source-code" id="M000113-source">
|
|
313
313
|
<pre>
|
|
314
314
|
<span class="ruby-comment cmt"># File erubis/engine/ec.rb, line 35</span>
|
|
315
315
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escape_text</span>(<span class="ruby-identifier">text</span>)
|
|
@@ -322,19 +322,19 @@
|
|
|
322
322
|
</div>
|
|
323
323
|
</div>
|
|
324
324
|
|
|
325
|
-
<div id="method-
|
|
326
|
-
<a name="
|
|
325
|
+
<div id="method-M000114" class="method-detail">
|
|
326
|
+
<a name="M000114"></a>
|
|
327
327
|
|
|
328
328
|
<div class="method-heading">
|
|
329
|
-
<a href="#
|
|
329
|
+
<a href="#M000114" class="method-signature">
|
|
330
330
|
<span class="method-name">escaped_expr</span><span class="method-args">(code)</span>
|
|
331
331
|
</a>
|
|
332
332
|
</div>
|
|
333
333
|
|
|
334
334
|
<div class="method-description">
|
|
335
335
|
<p><a class="source-toggle" href="#"
|
|
336
|
-
onclick="toggleCode('
|
|
337
|
-
<div class="method-source-code" id="
|
|
336
|
+
onclick="toggleCode('M000114-source');return false;">[Source]</a></p>
|
|
337
|
+
<div class="method-source-code" id="M000114-source">
|
|
338
338
|
<pre>
|
|
339
339
|
<span class="ruby-comment cmt"># File erubis/engine/ec.rb, line 41</span>
|
|
340
340
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escaped_expr</span>(<span class="ruby-identifier">code</span>)
|
|
@@ -345,19 +345,19 @@
|
|
|
345
345
|
</div>
|
|
346
346
|
</div>
|
|
347
347
|
|
|
348
|
-
<div id="method-
|
|
349
|
-
<a name="
|
|
348
|
+
<div id="method-M000111" class="method-detail">
|
|
349
|
+
<a name="M000111"></a>
|
|
350
350
|
|
|
351
351
|
<div class="method-heading">
|
|
352
|
-
<a href="#
|
|
352
|
+
<a href="#M000111" class="method-signature">
|
|
353
353
|
<span class="method-name">init_generator</span><span class="method-args">(properties={})</span>
|
|
354
354
|
</a>
|
|
355
355
|
</div>
|
|
356
356
|
|
|
357
357
|
<div class="method-description">
|
|
358
358
|
<p><a class="source-toggle" href="#"
|
|
359
|
-
onclick="toggleCode('
|
|
360
|
-
<div class="method-source-code" id="
|
|
359
|
+
onclick="toggleCode('M000111-source');return false;">[Source]</a></p>
|
|
360
|
+
<div class="method-source-code" id="M000111-source">
|
|
361
361
|
<pre>
|
|
362
362
|
<span class="ruby-comment cmt"># File erubis/engine/ec.rb, line 24</span>
|
|
363
363
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">init_generator</span>(<span class="ruby-identifier">properties</span>={})
|
|
@@ -112,10 +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="#
|
|
115
|
+
<a href="#M000167">[]</a>
|
|
116
|
+
<a href="#M000168">[]=</a>
|
|
117
|
+
<a href="#M000170">each</a>
|
|
118
|
+
<a href="#M000169">keys</a>
|
|
119
|
+
<a href="#M000166">new</a>
|
|
120
|
+
<a href="#M000171">to_hash</a>
|
|
121
|
+
<a href="#M000172">update</a>
|
|
119
122
|
</div>
|
|
120
123
|
</div>
|
|
121
124
|
|
|
@@ -123,6 +126,13 @@ ex.
|
|
|
123
126
|
|
|
124
127
|
|
|
125
128
|
<!-- if includes -->
|
|
129
|
+
<div id="includes">
|
|
130
|
+
<h3 class="section-bar">Included Modules</h3>
|
|
131
|
+
|
|
132
|
+
<div id="includes-list">
|
|
133
|
+
<span class="include-name">Enumerable</span>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
126
136
|
|
|
127
137
|
<div id="section">
|
|
128
138
|
|
|
@@ -137,21 +147,21 @@ ex.
|
|
|
137
147
|
<div id="methods">
|
|
138
148
|
<h3 class="section-bar">Public Class methods</h3>
|
|
139
149
|
|
|
140
|
-
<div id="method-
|
|
141
|
-
<a name="
|
|
150
|
+
<div id="method-M000166" class="method-detail">
|
|
151
|
+
<a name="M000166"></a>
|
|
142
152
|
|
|
143
153
|
<div class="method-heading">
|
|
144
|
-
<a href="#
|
|
154
|
+
<a href="#M000166" class="method-signature">
|
|
145
155
|
<span class="method-name">new</span><span class="method-args">(hash=nil)</span>
|
|
146
156
|
</a>
|
|
147
157
|
</div>
|
|
148
158
|
|
|
149
159
|
<div class="method-description">
|
|
150
160
|
<p><a class="source-toggle" href="#"
|
|
151
|
-
onclick="toggleCode('
|
|
152
|
-
<div class="method-source-code" id="
|
|
161
|
+
onclick="toggleCode('M000166-source');return false;">[Source]</a></p>
|
|
162
|
+
<div class="method-source-code" id="M000166-source">
|
|
153
163
|
<pre>
|
|
154
|
-
<span class="ruby-comment cmt"># File erubis/context.rb, line
|
|
164
|
+
<span class="ruby-comment cmt"># File erubis/context.rb, line 34</span>
|
|
155
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>)
|
|
156
166
|
<span class="ruby-identifier">hash</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
|
|
157
167
|
<span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">value</span>
|
|
@@ -164,21 +174,21 @@ ex.
|
|
|
164
174
|
|
|
165
175
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
166
176
|
|
|
167
|
-
<div id="method-
|
|
168
|
-
<a name="
|
|
177
|
+
<div id="method-M000167" class="method-detail">
|
|
178
|
+
<a name="M000167"></a>
|
|
169
179
|
|
|
170
180
|
<div class="method-heading">
|
|
171
|
-
<a href="#
|
|
181
|
+
<a href="#M000167" class="method-signature">
|
|
172
182
|
<span class="method-name">[]</span><span class="method-args">(key)</span>
|
|
173
183
|
</a>
|
|
174
184
|
</div>
|
|
175
185
|
|
|
176
186
|
<div class="method-description">
|
|
177
187
|
<p><a class="source-toggle" href="#"
|
|
178
|
-
onclick="toggleCode('
|
|
179
|
-
<div class="method-source-code" id="
|
|
188
|
+
onclick="toggleCode('M000167-source');return false;">[Source]</a></p>
|
|
189
|
+
<div class="method-source-code" id="M000167-source">
|
|
180
190
|
<pre>
|
|
181
|
-
<span class="ruby-comment cmt"># File erubis/context.rb, line
|
|
191
|
+
<span class="ruby-comment cmt"># File erubis/context.rb, line 40</span>
|
|
182
192
|
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">key</span>)
|
|
183
193
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">instance_variable_get</span>(<span class="ruby-node">"@#{key}"</span>)
|
|
184
194
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -187,21 +197,21 @@ ex.
|
|
|
187
197
|
</div>
|
|
188
198
|
</div>
|
|
189
199
|
|
|
190
|
-
<div id="method-
|
|
191
|
-
<a name="
|
|
200
|
+
<div id="method-M000168" class="method-detail">
|
|
201
|
+
<a name="M000168"></a>
|
|
192
202
|
|
|
193
203
|
<div class="method-heading">
|
|
194
|
-
<a href="#
|
|
204
|
+
<a href="#M000168" class="method-signature">
|
|
195
205
|
<span class="method-name">[]=</span><span class="method-args">(key, value)</span>
|
|
196
206
|
</a>
|
|
197
207
|
</div>
|
|
198
208
|
|
|
199
209
|
<div class="method-description">
|
|
200
210
|
<p><a class="source-toggle" href="#"
|
|
201
|
-
onclick="toggleCode('
|
|
202
|
-
<div class="method-source-code" id="
|
|
211
|
+
onclick="toggleCode('M000168-source');return false;">[Source]</a></p>
|
|
212
|
+
<div class="method-source-code" id="M000168-source">
|
|
203
213
|
<pre>
|
|
204
|
-
<span class="ruby-comment cmt"># File erubis/context.rb, line
|
|
214
|
+
<span class="ruby-comment cmt"># File erubis/context.rb, line 44</span>
|
|
205
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>)
|
|
206
216
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-node">"@#{key}"</span>, <span class="ruby-identifier">value</span>)
|
|
207
217
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -210,23 +220,109 @@ ex.
|
|
|
210
220
|
</div>
|
|
211
221
|
</div>
|
|
212
222
|
|
|
213
|
-
<div id="method-
|
|
214
|
-
<a name="
|
|
223
|
+
<div id="method-M000170" class="method-detail">
|
|
224
|
+
<a name="M000170"></a>
|
|
215
225
|
|
|
216
226
|
<div class="method-heading">
|
|
217
|
-
<a href="#
|
|
227
|
+
<a href="#M000170" class="method-signature">
|
|
228
|
+
<span class="method-name">each</span><span class="method-args">() {|key, value| ...}</span>
|
|
229
|
+
</a>
|
|
230
|
+
</div>
|
|
231
|
+
|
|
232
|
+
<div class="method-description">
|
|
233
|
+
<p><a class="source-toggle" href="#"
|
|
234
|
+
onclick="toggleCode('M000170-source');return false;">[Source]</a></p>
|
|
235
|
+
<div class="method-source-code" id="M000170-source">
|
|
236
|
+
<pre>
|
|
237
|
+
<span class="ruby-comment cmt"># File erubis/context.rb, line 52</span>
|
|
238
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">each</span>
|
|
239
|
+
<span class="ruby-identifier">instance_variables</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
|
|
240
|
+
<span class="ruby-identifier">key</span> = <span class="ruby-identifier">name</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>]
|
|
241
|
+
<span class="ruby-identifier">value</span> = <span class="ruby-identifier">instance_variable_get</span>(<span class="ruby-identifier">name</span>)
|
|
242
|
+
<span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>)
|
|
243
|
+
<span class="ruby-keyword kw">end</span>
|
|
244
|
+
<span class="ruby-keyword kw">end</span>
|
|
245
|
+
</pre>
|
|
246
|
+
</div>
|
|
247
|
+
</div>
|
|
248
|
+
</div>
|
|
249
|
+
|
|
250
|
+
<div id="method-M000169" class="method-detail">
|
|
251
|
+
<a name="M000169"></a>
|
|
252
|
+
|
|
253
|
+
<div class="method-heading">
|
|
254
|
+
<a href="#M000169" class="method-signature">
|
|
218
255
|
<span class="method-name">keys</span><span class="method-args">()</span>
|
|
219
256
|
</a>
|
|
220
257
|
</div>
|
|
221
258
|
|
|
222
259
|
<div class="method-description">
|
|
223
260
|
<p><a class="source-toggle" href="#"
|
|
224
|
-
onclick="toggleCode('
|
|
225
|
-
<div class="method-source-code" id="
|
|
261
|
+
onclick="toggleCode('M000169-source');return false;">[Source]</a></p>
|
|
262
|
+
<div class="method-source-code" id="M000169-source">
|
|
226
263
|
<pre>
|
|
227
|
-
<span class="ruby-comment cmt"># File erubis/context.rb, line
|
|
264
|
+
<span class="ruby-comment cmt"># File erubis/context.rb, line 48</span>
|
|
228
265
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">keys</span>
|
|
229
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">instance_variables</span>.<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span> <span class="ruby-identifier">name</span>[<span class="ruby-value">1</span
|
|
266
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">instance_variables</span>.<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span> <span class="ruby-identifier">name</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>] }
|
|
267
|
+
<span class="ruby-keyword kw">end</span>
|
|
268
|
+
</pre>
|
|
269
|
+
</div>
|
|
270
|
+
</div>
|
|
271
|
+
</div>
|
|
272
|
+
|
|
273
|
+
<div id="method-M000171" class="method-detail">
|
|
274
|
+
<a name="M000171"></a>
|
|
275
|
+
|
|
276
|
+
<div class="method-heading">
|
|
277
|
+
<a href="#M000171" class="method-signature">
|
|
278
|
+
<span class="method-name">to_hash</span><span class="method-args">()</span>
|
|
279
|
+
</a>
|
|
280
|
+
</div>
|
|
281
|
+
|
|
282
|
+
<div class="method-description">
|
|
283
|
+
<p><a class="source-toggle" href="#"
|
|
284
|
+
onclick="toggleCode('M000171-source');return false;">[Source]</a></p>
|
|
285
|
+
<div class="method-source-code" id="M000171-source">
|
|
286
|
+
<pre>
|
|
287
|
+
<span class="ruby-comment cmt"># File erubis/context.rb, line 60</span>
|
|
288
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_hash</span>
|
|
289
|
+
<span class="ruby-identifier">hash</span> = {}
|
|
290
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span> <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">key</span>] }
|
|
291
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">hash</span>
|
|
292
|
+
<span class="ruby-keyword kw">end</span>
|
|
293
|
+
</pre>
|
|
294
|
+
</div>
|
|
295
|
+
</div>
|
|
296
|
+
</div>
|
|
297
|
+
|
|
298
|
+
<div id="method-M000172" class="method-detail">
|
|
299
|
+
<a name="M000172"></a>
|
|
300
|
+
|
|
301
|
+
<div class="method-heading">
|
|
302
|
+
<a href="#M000172" class="method-signature">
|
|
303
|
+
<span class="method-name">update</span><span class="method-args">(context_or_hash)</span>
|
|
304
|
+
</a>
|
|
305
|
+
</div>
|
|
306
|
+
|
|
307
|
+
<div class="method-description">
|
|
308
|
+
<p><a class="source-toggle" href="#"
|
|
309
|
+
onclick="toggleCode('M000172-source');return false;">[Source]</a></p>
|
|
310
|
+
<div class="method-source-code" id="M000172-source">
|
|
311
|
+
<pre>
|
|
312
|
+
<span class="ruby-comment cmt"># File erubis/context.rb, line 66</span>
|
|
313
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">update</span>(<span class="ruby-identifier">context_or_hash</span>)
|
|
314
|
+
<span class="ruby-identifier">arg</span> = <span class="ruby-identifier">context_or_hash</span>
|
|
315
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
|
|
316
|
+
<span class="ruby-identifier">arg</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">val</span><span class="ruby-operator">|</span>
|
|
317
|
+
<span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">val</span>
|
|
318
|
+
<span class="ruby-keyword kw">end</span>
|
|
319
|
+
<span class="ruby-keyword kw">else</span>
|
|
320
|
+
<span class="ruby-identifier">arg</span>.<span class="ruby-identifier">instance_variables</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">varname</span><span class="ruby-operator">|</span>
|
|
321
|
+
<span class="ruby-identifier">key</span> = <span class="ruby-identifier">varname</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>]
|
|
322
|
+
<span class="ruby-identifier">val</span> = <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">instance_variable_get</span>(<span class="ruby-identifier">varname</span>)
|
|
323
|
+
<span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">val</span>
|
|
324
|
+
<span class="ruby-keyword kw">end</span>
|
|
325
|
+
<span class="ruby-keyword kw">end</span>
|
|
230
326
|
<span class="ruby-keyword kw">end</span>
|
|
231
327
|
</pre>
|
|
232
328
|
</div>
|