erubis 2.0.1 → 2.1.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 +150 -2
- data/LGPL +504 -0
- data/README.txt +14 -8
- data/benchmark/erubybench.rb +1 -1
- data/benchmark/erubybench.rhtml +3 -3
- data/bin/erubis +1 -1
- data/bin/notext +154 -0
- data/contrib/erubis +1036 -374
- data/contrib/inline-require +5 -3
- data/doc-api/classes/Erubis.html +43 -1
- data/doc-api/classes/Erubis/ArrayBufferEnhancer.html +14 -14
- data/doc-api/classes/Erubis/ArrayEnhancer.html +14 -14
- data/doc-api/classes/Erubis/Basic.html +112 -0
- data/doc-api/classes/Erubis/Basic/Converter.html +318 -0
- data/doc-api/classes/Erubis/Basic/Engine.html +130 -0
- data/doc-api/classes/Erubis/BiPatternEnhancer.html +14 -14
- data/doc-api/classes/Erubis/CGenerator.html +386 -0
- data/doc-api/classes/Erubis/Context.html +31 -32
- data/doc-api/classes/Erubis/Converter.html +231 -0
- data/doc-api/classes/Erubis/Ec.html +9 -283
- data/doc-api/classes/Erubis/Ejava.html +9 -274
- data/doc-api/classes/Erubis/Ejavascript.html +9 -298
- data/doc-api/classes/Erubis/Engine.html +68 -508
- data/doc-api/classes/Erubis/Eperl.html +9 -259
- data/doc-api/classes/Erubis/Ephp.html +9 -239
- data/doc-api/classes/Erubis/ErubisError.html +2 -2
- data/doc-api/classes/Erubis/Eruby.html +4 -187
- data/doc-api/classes/Erubis/EscapeEnhancer.html +9 -11
- data/doc-api/classes/Erubis/Escheme.html +9 -272
- data/doc-api/classes/Erubis/Evaluator.html +212 -0
- data/doc-api/classes/Erubis/Generator.html +410 -0
- data/doc-api/classes/Erubis/HeaderFooterEnhancer.html +16 -16
- data/doc-api/classes/Erubis/Helper.html +112 -0
- data/doc-api/classes/Erubis/Helper/CachedRailsTemplate.html +198 -0
- data/doc-api/classes/Erubis/Helper/RailsTemplate.html +366 -0
- data/doc-api/classes/Erubis/JavaGenerator.html +359 -0
- data/doc-api/classes/Erubis/JavascriptGenerator.html +381 -0
- data/doc-api/classes/Erubis/Main.html +27 -25
- data/doc-api/classes/Erubis/NoCodeEnhancer.html +249 -0
- data/doc-api/classes/Erubis/NoCodeEruby.html +120 -0
- data/doc-api/classes/Erubis/NoTextEnhancer.html +8 -8
- data/doc-api/classes/Erubis/NotSupportedError.html +119 -0
- data/doc-api/classes/Erubis/OptimizedEruby.html +22 -304
- data/doc-api/classes/Erubis/OptimizedGenerator.html +439 -0
- data/doc-api/classes/Erubis/OptimizedXmlEruby.html +7 -7
- data/doc-api/classes/Erubis/PI.html +124 -0
- data/doc-api/classes/Erubis/PI/Converter.html +318 -0
- data/doc-api/classes/Erubis/PI/Ec.html +166 -0
- data/doc-api/classes/Erubis/PI/Ejava.html +166 -0
- data/doc-api/classes/Erubis/PI/Ejavascript.html +166 -0
- data/doc-api/classes/Erubis/PI/Engine.html +122 -0
- data/doc-api/classes/Erubis/PI/Eperl.html +166 -0
- data/doc-api/classes/Erubis/PI/Ephp.html +166 -0
- data/doc-api/classes/Erubis/PI/Eruby.html +155 -0
- data/doc-api/classes/Erubis/PI/Escheme.html +166 -0
- data/doc-api/classes/Erubis/PI/TinyEruby.html +305 -0
- data/doc-api/classes/Erubis/PercentLineEnhancer.html +7 -7
- data/doc-api/classes/Erubis/PerlGenerator.html +344 -0
- data/doc-api/classes/Erubis/PhpGenerator.html +350 -0
- data/doc-api/classes/Erubis/PrintEnabledEnhancer.html +24 -24
- data/doc-api/classes/Erubis/PrintOutEnhancer.html +35 -35
- data/doc-api/classes/Erubis/RubyEvaluator.html +190 -0
- data/doc-api/classes/Erubis/RubyGenerator.html +327 -0
- data/doc-api/classes/Erubis/SchemeGenerator.html +382 -0
- data/doc-api/classes/Erubis/SimplifyEnhancer.html +17 -13
- data/doc-api/classes/Erubis/StdoutEnhancer.html +14 -14
- data/doc-api/classes/Erubis/StringBufferEnhancer.html +14 -14
- data/doc-api/classes/Erubis/TinyEruby.html +45 -40
- data/doc-api/classes/Erubis/XmlHelper.html +14 -14
- data/doc-api/created.rid +1 -1
- data/doc-api/files/__/README_txt.html +27 -9
- data/doc-api/files/erubis/context_rb.html +107 -0
- data/doc-api/files/erubis/converter_rb.html +114 -0
- 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 +3 -2
- 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 +6 -3
- data/doc-api/files/erubis/enhancer_rb.html +2 -9
- data/doc-api/files/erubis/error_rb.html +107 -0
- data/doc-api/files/erubis/evaluator_rb.html +115 -0
- data/doc-api/files/erubis/generator_rb.html +114 -0
- data/doc-api/files/erubis/helper/rails_rb.html +140 -0
- data/doc-api/files/erubis/helper_rb.html +1 -1
- data/doc-api/files/erubis/local-setting_rb.html +1 -1
- data/doc-api/files/erubis/main_rb.html +2 -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 +32 -0
- data/doc-api/fr_file_index.html +6 -0
- data/doc-api/fr_method_index.html +178 -136
- data/doc/users-guide.html +538 -199
- data/examples/{Makefile → basic/Makefile} +11 -11
- data/examples/basic/example.ec +42 -0
- data/examples/{example.ejava → basic/example.ejava} +5 -1
- data/examples/{example.ejavascript → basic/example.ejs} +0 -0
- data/examples/{example.eperl → basic/example.eperl} +2 -2
- data/examples/{example.ephp → basic/example.ephp} +0 -0
- data/examples/{example.eruby → basic/example.eruby} +0 -0
- data/examples/{example.escheme → basic/example.escheme} +0 -0
- data/examples/pi/Makefile +54 -0
- data/examples/pi/example.ec +42 -0
- data/examples/pi/example.ejava +45 -0
- data/examples/pi/example.ejs +16 -0
- data/examples/pi/example.eperl +16 -0
- data/examples/pi/example.ephp +17 -0
- data/examples/pi/example.eruby +15 -0
- data/examples/pi/example.escheme +26 -0
- data/lib/erubis.rb +15 -8
- data/lib/erubis/context.rb +54 -0
- data/lib/erubis/converter.rb +307 -0
- data/lib/erubis/engine.rb +57 -227
- data/lib/erubis/engine/ec.rb +31 -20
- data/lib/erubis/engine/ejava.rb +33 -21
- data/lib/erubis/engine/ejavascript.rb +30 -18
- data/lib/erubis/engine/enhanced.rb +7 -2
- data/lib/erubis/engine/eperl.rb +33 -19
- data/lib/erubis/engine/ephp.rb +32 -14
- data/lib/erubis/engine/eruby.rb +34 -7
- data/lib/erubis/engine/escheme.rb +34 -15
- data/lib/erubis/engine/optimized.rb +25 -11
- data/lib/erubis/enhancer.rb +53 -19
- data/lib/erubis/error.rb +24 -0
- data/lib/erubis/evaluator.rb +71 -0
- data/lib/erubis/generator.rb +83 -0
- data/lib/erubis/helper.rb +1 -1
- data/lib/erubis/helper/rails.rb +159 -0
- data/lib/erubis/local-setting.rb +1 -1
- data/lib/erubis/main.rb +87 -46
- data/lib/erubis/tiny.rb +81 -7
- data/test/assert-text-equal.rb +1 -1
- data/test/test-engines.rb +8 -9
- data/test/test-erubis.rb +196 -18
- data/test/{test-bin.rb → test-main.rb} +123 -21
- data/test/test-notext.rb +27 -0
- data/test/test.rb +5 -3
- data/test/testutil.rb +25 -36
- metadata +75 -13
- data/COPYING +0 -340
- data/examples/example.ec +0 -24
|
@@ -98,9 +98,9 @@ ex.
|
|
|
98
98
|
<h3 class="section-bar">Methods</h3>
|
|
99
99
|
|
|
100
100
|
<div class="name-list">
|
|
101
|
-
<a href="#
|
|
102
|
-
<a href="#
|
|
103
|
-
<a href="#
|
|
101
|
+
<a href="#M000173">execute</a>
|
|
102
|
+
<a href="#M000171">main</a>
|
|
103
|
+
<a href="#M000172">new</a>
|
|
104
104
|
</div>
|
|
105
105
|
</div>
|
|
106
106
|
|
|
@@ -122,19 +122,19 @@ ex.
|
|
|
122
122
|
<div id="methods">
|
|
123
123
|
<h3 class="section-bar">Public Class methods</h3>
|
|
124
124
|
|
|
125
|
-
<div id="method-
|
|
126
|
-
<a name="
|
|
125
|
+
<div id="method-M000171" class="method-detail">
|
|
126
|
+
<a name="M000171"></a>
|
|
127
127
|
|
|
128
128
|
<div class="method-heading">
|
|
129
|
-
<a href="#
|
|
129
|
+
<a href="#M000171" class="method-signature">
|
|
130
130
|
<span class="method-name">main</span><span class="method-args">(argv=ARGV)</span>
|
|
131
131
|
</a>
|
|
132
132
|
</div>
|
|
133
133
|
|
|
134
134
|
<div class="method-description">
|
|
135
135
|
<p><a class="source-toggle" href="#"
|
|
136
|
-
onclick="toggleCode('
|
|
137
|
-
<div class="method-source-code" id="
|
|
136
|
+
onclick="toggleCode('M000171-source');return false;">[Source]</a></p>
|
|
137
|
+
<div class="method-source-code" id="M000171-source">
|
|
138
138
|
<pre>
|
|
139
139
|
<span class="ruby-comment cmt"># File erubis/main.rb, line 40</span>
|
|
140
140
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">main</span>(<span class="ruby-identifier">argv</span>=<span class="ruby-constant">ARGV</span>)
|
|
@@ -152,19 +152,19 @@ ex.
|
|
|
152
152
|
</div>
|
|
153
153
|
</div>
|
|
154
154
|
|
|
155
|
-
<div id="method-
|
|
156
|
-
<a name="
|
|
155
|
+
<div id="method-M000172" class="method-detail">
|
|
156
|
+
<a name="M000172"></a>
|
|
157
157
|
|
|
158
158
|
<div class="method-heading">
|
|
159
|
-
<a href="#
|
|
159
|
+
<a href="#M000172" class="method-signature">
|
|
160
160
|
<span class="method-name">new</span><span class="method-args">()</span>
|
|
161
161
|
</a>
|
|
162
162
|
</div>
|
|
163
163
|
|
|
164
164
|
<div class="method-description">
|
|
165
165
|
<p><a class="source-toggle" href="#"
|
|
166
|
-
onclick="toggleCode('
|
|
167
|
-
<div class="method-source-code" id="
|
|
166
|
+
onclick="toggleCode('M000172-source');return false;">[Source]</a></p>
|
|
167
|
+
<div class="method-source-code" id="M000172-source">
|
|
168
168
|
<pre>
|
|
169
169
|
<span class="ruby-comment cmt"># File erubis/main.rb, line 51</span>
|
|
170
170
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
|
|
@@ -202,19 +202,19 @@ ex.
|
|
|
202
202
|
|
|
203
203
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
204
204
|
|
|
205
|
-
<div id="method-
|
|
206
|
-
<a name="
|
|
205
|
+
<div id="method-M000173" class="method-detail">
|
|
206
|
+
<a name="M000173"></a>
|
|
207
207
|
|
|
208
208
|
<div class="method-heading">
|
|
209
|
-
<a href="#
|
|
209
|
+
<a href="#M000173" class="method-signature">
|
|
210
210
|
<span class="method-name">execute</span><span class="method-args">(argv=ARGV)</span>
|
|
211
211
|
</a>
|
|
212
212
|
</div>
|
|
213
213
|
|
|
214
214
|
<div class="method-description">
|
|
215
215
|
<p><a class="source-toggle" href="#"
|
|
216
|
-
onclick="toggleCode('
|
|
217
|
-
<div class="method-source-code" id="
|
|
216
|
+
onclick="toggleCode('M000173-source');return false;">[Source]</a></p>
|
|
217
|
+
<div class="method-source-code" id="M000173-source">
|
|
218
218
|
<pre>
|
|
219
219
|
<span class="ruby-comment cmt"># File erubis/main.rb, line 81</span>
|
|
220
220
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">execute</span>(<span class="ruby-identifier">argv</span>=<span class="ruby-constant">ARGV</span>)
|
|
@@ -251,15 +251,15 @@ ex.
|
|
|
251
251
|
|
|
252
252
|
<span class="ruby-comment cmt">## action</span>
|
|
253
253
|
<span class="ruby-identifier">action</span> = <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">action</span>
|
|
254
|
-
<span class="ruby-identifier">action</span> <span class="ruby-operator">||=</span> <span class="ruby-value str">'
|
|
254
|
+
<span class="ruby-identifier">action</span> <span class="ruby-operator">||=</span> <span class="ruby-value str">'convert'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">source</span>
|
|
255
255
|
|
|
256
256
|
<span class="ruby-comment cmt">## lang</span>
|
|
257
257
|
<span class="ruby-identifier">lang</span> = <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">lang</span> <span class="ruby-operator">||</span> <span class="ruby-value str">'ruby'</span>
|
|
258
|
-
<span class="ruby-identifier">action</span> <span class="ruby-operator">||=</span> <span class="ruby-value str">'
|
|
258
|
+
<span class="ruby-identifier">action</span> <span class="ruby-operator">||=</span> <span class="ruby-value str">'convert'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">lang</span>
|
|
259
259
|
|
|
260
260
|
<span class="ruby-comment cmt">## class name of Eruby</span>
|
|
261
261
|
<span class="ruby-identifier">classname</span> = <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">class</span>
|
|
262
|
-
<span class="ruby-identifier">klass</span> = <span class="ruby-identifier">get_classobj</span>(<span class="ruby-identifier">classname</span>, <span class="ruby-identifier">lang</span>)
|
|
262
|
+
<span class="ruby-identifier">klass</span> = <span class="ruby-identifier">get_classobj</span>(<span class="ruby-identifier">classname</span>, <span class="ruby-identifier">lang</span>, <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:pi</span>])
|
|
263
263
|
|
|
264
264
|
<span class="ruby-comment cmt">## kanji code</span>
|
|
265
265
|
<span class="ruby-identifier">$KCODE</span> = <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">kanji</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">kanji</span>
|
|
@@ -269,31 +269,33 @@ ex.
|
|
|
269
269
|
<span class="ruby-identifier">context</span> = <span class="ruby-identifier">load_yamlfiles</span>(<span class="ruby-identifier">yamlfiles</span>, <span class="ruby-identifier">opts</span>)
|
|
270
270
|
|
|
271
271
|
<span class="ruby-comment cmt">## properties for engine</span>
|
|
272
|
+
<span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:escape</span>] = <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">escape</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">properties</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-identifier">:escape</span>)
|
|
272
273
|
<span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:pattern</span>] = <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">pattern</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">pattern</span>
|
|
273
274
|
<span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:trim</span>] = <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">notrim</span>
|
|
274
275
|
<span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:preamble</span>] = <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:postamble</span>] = <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">bodyonly</span>
|
|
276
|
+
<span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:pi</span>] = <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:pi</span>] <span class="ruby-operator">==</span> <span class="ruby-keyword kw">true</span>
|
|
275
277
|
|
|
276
278
|
<span class="ruby-comment cmt">## create engine and extend enhancers</span>
|
|
277
279
|
<span class="ruby-identifier">engine</span> = <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">properties</span>)
|
|
278
280
|
<span class="ruby-identifier">enhancers</span> = <span class="ruby-identifier">get_enhancers</span>(<span class="ruby-identifier">opts</span>.<span class="ruby-identifier">enhancers</span>)
|
|
279
|
-
<span class="ruby-
|
|
281
|
+
<span class="ruby-comment cmt">#enhancers.push(Erubis::EscapeEnhancer) if opts.escape</span>
|
|
280
282
|
<span class="ruby-identifier">enhancers</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">enhancer</span><span class="ruby-operator">|</span>
|
|
281
283
|
<span class="ruby-identifier">engine</span>.<span class="ruby-identifier">extend</span>(<span class="ruby-identifier">enhancer</span>)
|
|
282
284
|
<span class="ruby-identifier">engine</span>.<span class="ruby-identifier">bipattern</span> = <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:bipattern</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">enhancer</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Erubis</span><span class="ruby-operator">::</span><span class="ruby-constant">BiPatternEnhancer</span>
|
|
283
285
|
<span class="ruby-keyword kw">end</span>
|
|
284
286
|
|
|
285
|
-
<span class="ruby-comment cmt">##
|
|
287
|
+
<span class="ruby-comment cmt">## convert and execute</span>
|
|
286
288
|
<span class="ruby-identifier">val</span> = <span class="ruby-keyword kw">nil</span>
|
|
287
289
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">filenames</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">filenames</span>.<span class="ruby-identifier">empty?</span>
|
|
288
290
|
<span class="ruby-identifier">filenames</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">filename</span><span class="ruby-operator">|</span>
|
|
289
291
|
<span class="ruby-identifier">test</span>(<span class="ruby-value">?f</span>, <span class="ruby-identifier">filename</span>) <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">raise</span> <span class="ruby-constant">CommandOptionError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">"#{filename}: file not found."</span>)
|
|
290
292
|
<span class="ruby-identifier">engine</span>.<span class="ruby-identifier">filename</span> = <span class="ruby-identifier">filename</span>
|
|
291
|
-
<span class="ruby-identifier">engine</span>.<span class="ruby-identifier">
|
|
293
|
+
<span class="ruby-identifier">engine</span>.<span class="ruby-identifier">convert!</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">filename</span>))
|
|
292
294
|
<span class="ruby-identifier">print</span> <span class="ruby-identifier">val</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">val</span> = <span class="ruby-identifier">do_action</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">engine</span>, <span class="ruby-identifier">context</span>, <span class="ruby-identifier">opts</span>)
|
|
293
295
|
<span class="ruby-keyword kw">end</span>
|
|
294
296
|
<span class="ruby-keyword kw">else</span>
|
|
295
297
|
<span class="ruby-identifier">engine</span>.<span class="ruby-identifier">filename</span> = <span class="ruby-value str">'(stdin)'</span>
|
|
296
|
-
<span class="ruby-identifier">engine</span>.<span class="ruby-identifier">
|
|
298
|
+
<span class="ruby-identifier">engine</span>.<span class="ruby-identifier">convert!</span>(<span class="ruby-identifier">$stdin</span>.<span class="ruby-identifier">read</span>())
|
|
297
299
|
<span class="ruby-identifier">print</span> <span class="ruby-identifier">val</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">val</span> = <span class="ruby-identifier">do_action</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">engine</span>, <span class="ruby-identifier">context</span>, <span class="ruby-identifier">opts</span>)
|
|
298
300
|
<span class="ruby-keyword kw">end</span>
|
|
299
301
|
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
7
|
+
<head>
|
|
8
|
+
<title>Module: Erubis::NoCodeEnhancer</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
|
12
|
+
<script type="text/javascript">
|
|
13
|
+
// <![CDATA[
|
|
14
|
+
|
|
15
|
+
function popupCode( url ) {
|
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function toggleCode( id ) {
|
|
20
|
+
if ( document.getElementById )
|
|
21
|
+
elem = document.getElementById( id );
|
|
22
|
+
else if ( document.all )
|
|
23
|
+
elem = eval( "document.all." + id );
|
|
24
|
+
else
|
|
25
|
+
return false;
|
|
26
|
+
|
|
27
|
+
elemStyle = elem.style;
|
|
28
|
+
|
|
29
|
+
if ( elemStyle.display != "block" ) {
|
|
30
|
+
elemStyle.display = "block"
|
|
31
|
+
} else {
|
|
32
|
+
elemStyle.display = "none"
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Make codeblocks hidden by default
|
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
40
|
+
|
|
41
|
+
// ]]>
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
</head>
|
|
45
|
+
<body>
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
<div id="classHeader">
|
|
50
|
+
<table class="header-table">
|
|
51
|
+
<tr class="top-aligned-row">
|
|
52
|
+
<td><strong>Module</strong></td>
|
|
53
|
+
<td class="class-name-in-header">Erubis::NoCodeEnhancer</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr class="top-aligned-row">
|
|
56
|
+
<td><strong>In:</strong></td>
|
|
57
|
+
<td>
|
|
58
|
+
<a href="../../files/erubis/enhancer_rb.html">
|
|
59
|
+
erubis/enhancer.rb
|
|
60
|
+
</a>
|
|
61
|
+
<br />
|
|
62
|
+
</td>
|
|
63
|
+
</tr>
|
|
64
|
+
|
|
65
|
+
</table>
|
|
66
|
+
</div>
|
|
67
|
+
<!-- banner header -->
|
|
68
|
+
|
|
69
|
+
<div id="bodyContent">
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
<div id="contextContent">
|
|
74
|
+
|
|
75
|
+
<div id="description">
|
|
76
|
+
<p>
|
|
77
|
+
remove code and leave text, especially useful when validating HTML tags.
|
|
78
|
+
</p>
|
|
79
|
+
<p>
|
|
80
|
+
ex.
|
|
81
|
+
</p>
|
|
82
|
+
<pre>
|
|
83
|
+
$ erubis -s -E NoCode file.eruby | tidy -errors
|
|
84
|
+
</pre>
|
|
85
|
+
<p>
|
|
86
|
+
this is language independent.
|
|
87
|
+
</p>
|
|
88
|
+
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
<div id="method-list">
|
|
95
|
+
<h3 class="section-bar">Methods</h3>
|
|
96
|
+
|
|
97
|
+
<div class="name-list">
|
|
98
|
+
<a href="#M000004">add_expr</a>
|
|
99
|
+
<a href="#M000002">add_postamble</a>
|
|
100
|
+
<a href="#M000001">add_preamble</a>
|
|
101
|
+
<a href="#M000005">add_stmt</a>
|
|
102
|
+
<a href="#M000003">add_text</a>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
<!-- if includes -->
|
|
110
|
+
|
|
111
|
+
<div id="section">
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
<!-- if method_list -->
|
|
121
|
+
<div id="methods">
|
|
122
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
|
123
|
+
|
|
124
|
+
<div id="method-M000004" class="method-detail">
|
|
125
|
+
<a name="M000004"></a>
|
|
126
|
+
|
|
127
|
+
<div class="method-heading">
|
|
128
|
+
<a href="#M000004" class="method-signature">
|
|
129
|
+
<span class="method-name">add_expr</span><span class="method-args">(src, code, indicator)</span>
|
|
130
|
+
</a>
|
|
131
|
+
</div>
|
|
132
|
+
|
|
133
|
+
<div class="method-description">
|
|
134
|
+
<p><a class="source-toggle" href="#"
|
|
135
|
+
onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
|
|
136
|
+
<div class="method-source-code" id="M000004-source">
|
|
137
|
+
<pre>
|
|
138
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 295</span>
|
|
139
|
+
<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>)
|
|
140
|
+
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"\n"</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">code</span>.<span class="ruby-identifier">count</span>(<span class="ruby-value str">"\n"</span>)
|
|
141
|
+
<span class="ruby-keyword kw">end</span>
|
|
142
|
+
</pre>
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
|
|
147
|
+
<div id="method-M000002" class="method-detail">
|
|
148
|
+
<a name="M000002"></a>
|
|
149
|
+
|
|
150
|
+
<div class="method-heading">
|
|
151
|
+
<a href="#M000002" class="method-signature">
|
|
152
|
+
<span class="method-name">add_postamble</span><span class="method-args">(src)</span>
|
|
153
|
+
</a>
|
|
154
|
+
</div>
|
|
155
|
+
|
|
156
|
+
<div class="method-description">
|
|
157
|
+
<p><a class="source-toggle" href="#"
|
|
158
|
+
onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
|
|
159
|
+
<div class="method-source-code" id="M000002-source">
|
|
160
|
+
<pre>
|
|
161
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 288</span>
|
|
162
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_postamble</span>(<span class="ruby-identifier">src</span>)
|
|
163
|
+
<span class="ruby-keyword kw">end</span>
|
|
164
|
+
</pre>
|
|
165
|
+
</div>
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
|
|
169
|
+
<div id="method-M000001" class="method-detail">
|
|
170
|
+
<a name="M000001"></a>
|
|
171
|
+
|
|
172
|
+
<div class="method-heading">
|
|
173
|
+
<a href="#M000001" class="method-signature">
|
|
174
|
+
<span class="method-name">add_preamble</span><span class="method-args">(src)</span>
|
|
175
|
+
</a>
|
|
176
|
+
</div>
|
|
177
|
+
|
|
178
|
+
<div class="method-description">
|
|
179
|
+
<p><a class="source-toggle" href="#"
|
|
180
|
+
onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
|
|
181
|
+
<div class="method-source-code" id="M000001-source">
|
|
182
|
+
<pre>
|
|
183
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 285</span>
|
|
184
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_preamble</span>(<span class="ruby-identifier">src</span>)
|
|
185
|
+
<span class="ruby-keyword kw">end</span>
|
|
186
|
+
</pre>
|
|
187
|
+
</div>
|
|
188
|
+
</div>
|
|
189
|
+
</div>
|
|
190
|
+
|
|
191
|
+
<div id="method-M000005" class="method-detail">
|
|
192
|
+
<a name="M000005"></a>
|
|
193
|
+
|
|
194
|
+
<div class="method-heading">
|
|
195
|
+
<a href="#M000005" class="method-signature">
|
|
196
|
+
<span class="method-name">add_stmt</span><span class="method-args">(src, code)</span>
|
|
197
|
+
</a>
|
|
198
|
+
</div>
|
|
199
|
+
|
|
200
|
+
<div class="method-description">
|
|
201
|
+
<p><a class="source-toggle" href="#"
|
|
202
|
+
onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
|
|
203
|
+
<div class="method-source-code" id="M000005-source">
|
|
204
|
+
<pre>
|
|
205
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 299</span>
|
|
206
|
+
<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>)
|
|
207
|
+
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"\n"</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">code</span>.<span class="ruby-identifier">count</span>(<span class="ruby-value str">"\n"</span>)
|
|
208
|
+
<span class="ruby-keyword kw">end</span>
|
|
209
|
+
</pre>
|
|
210
|
+
</div>
|
|
211
|
+
</div>
|
|
212
|
+
</div>
|
|
213
|
+
|
|
214
|
+
<div id="method-M000003" class="method-detail">
|
|
215
|
+
<a name="M000003"></a>
|
|
216
|
+
|
|
217
|
+
<div class="method-heading">
|
|
218
|
+
<a href="#M000003" class="method-signature">
|
|
219
|
+
<span class="method-name">add_text</span><span class="method-args">(src, text)</span>
|
|
220
|
+
</a>
|
|
221
|
+
</div>
|
|
222
|
+
|
|
223
|
+
<div class="method-description">
|
|
224
|
+
<p><a class="source-toggle" href="#"
|
|
225
|
+
onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
|
|
226
|
+
<div class="method-source-code" id="M000003-source">
|
|
227
|
+
<pre>
|
|
228
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 291</span>
|
|
229
|
+
<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>)
|
|
230
|
+
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">text</span>
|
|
231
|
+
<span class="ruby-keyword kw">end</span>
|
|
232
|
+
</pre>
|
|
233
|
+
</div>
|
|
234
|
+
</div>
|
|
235
|
+
</div>
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
</div>
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
</div>
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
<div id="validator-badges">
|
|
245
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
246
|
+
</div>
|
|
247
|
+
|
|
248
|
+
</body>
|
|
249
|
+
</html>
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
7
|
+
<head>
|
|
8
|
+
<title>Class: Erubis::NoCodeEruby</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
|
12
|
+
<script type="text/javascript">
|
|
13
|
+
// <![CDATA[
|
|
14
|
+
|
|
15
|
+
function popupCode( url ) {
|
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function toggleCode( id ) {
|
|
20
|
+
if ( document.getElementById )
|
|
21
|
+
elem = document.getElementById( id );
|
|
22
|
+
else if ( document.all )
|
|
23
|
+
elem = eval( "document.all." + id );
|
|
24
|
+
else
|
|
25
|
+
return false;
|
|
26
|
+
|
|
27
|
+
elemStyle = elem.style;
|
|
28
|
+
|
|
29
|
+
if ( elemStyle.display != "block" ) {
|
|
30
|
+
elemStyle.display = "block"
|
|
31
|
+
} else {
|
|
32
|
+
elemStyle.display = "none"
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Make codeblocks hidden by default
|
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
40
|
+
|
|
41
|
+
// ]]>
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
</head>
|
|
45
|
+
<body>
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
<div id="classHeader">
|
|
50
|
+
<table class="header-table">
|
|
51
|
+
<tr class="top-aligned-row">
|
|
52
|
+
<td><strong>Class</strong></td>
|
|
53
|
+
<td class="class-name-in-header">Erubis::NoCodeEruby</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr class="top-aligned-row">
|
|
56
|
+
<td><strong>In:</strong></td>
|
|
57
|
+
<td>
|
|
58
|
+
<a href="../../files/erubis/engine/enhanced_rb.html">
|
|
59
|
+
erubis/engine/enhanced.rb
|
|
60
|
+
</a>
|
|
61
|
+
<br />
|
|
62
|
+
</td>
|
|
63
|
+
</tr>
|
|
64
|
+
|
|
65
|
+
<tr class="top-aligned-row">
|
|
66
|
+
<td><strong>Parent:</strong></td>
|
|
67
|
+
<td>
|
|
68
|
+
<a href="Eruby.html">
|
|
69
|
+
Eruby
|
|
70
|
+
</a>
|
|
71
|
+
</td>
|
|
72
|
+
</tr>
|
|
73
|
+
</table>
|
|
74
|
+
</div>
|
|
75
|
+
<!-- banner header -->
|
|
76
|
+
|
|
77
|
+
<div id="bodyContent">
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
<div id="contextContent">
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
</div>
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
<!-- if includes -->
|
|
92
|
+
<div id="includes">
|
|
93
|
+
<h3 class="section-bar">Included Modules</h3>
|
|
94
|
+
|
|
95
|
+
<div id="includes-list">
|
|
96
|
+
<span class="include-name"><a href="NoCodeEnhancer.html">NoCodeEnhancer</a></span>
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
<div id="section">
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
<!-- if method_list -->
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
</div>
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
<div id="validator-badges">
|
|
116
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
117
|
+
</div>
|
|
118
|
+
|
|
119
|
+
</body>
|
|
120
|
+
</html>
|