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
data/contrib/inline-require
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
### usage: inline-require [-h] [-I path[,path2,..]] script
|
|
7
7
|
###
|
|
8
8
|
### copyright(c) 2006 kuwata-lab all rights reserved.
|
|
9
|
-
### $Release: 2.0
|
|
9
|
+
### $Release: 2.1.0 $
|
|
10
10
|
### $Rev: 2 $
|
|
11
11
|
###
|
|
12
12
|
|
|
@@ -53,9 +53,11 @@ class InlineRequire
|
|
|
53
53
|
libpath = find_library(libname)
|
|
54
54
|
$stderr.puts "*** debug: libpath=#{libpath.inspect}" if $debug_mode
|
|
55
55
|
unless libpath
|
|
56
|
-
raise "file '#{filename}'(line #{n}): library '#{libname}' not found."
|
|
56
|
+
#raise "file '#{filename}'(line #{n}): library '#{libname}' not found."
|
|
57
|
+
warn "file '#{filename}'(line #{n}): library '#{libname}' not found."
|
|
58
|
+
else
|
|
59
|
+
flag_inline = true if libpath =~ /\.rb$/ && local_library?(libpath)
|
|
57
60
|
end
|
|
58
|
-
flag_inline = true if libpath =~ /\.rb$/ && local_library?(libpath)
|
|
59
61
|
end
|
|
60
62
|
if !flag_inline
|
|
61
63
|
sbuf << line
|
data/doc-api/classes/Erubis.html
CHANGED
|
@@ -55,6 +55,14 @@
|
|
|
55
55
|
<tr class="top-aligned-row">
|
|
56
56
|
<td><strong>In:</strong></td>
|
|
57
57
|
<td>
|
|
58
|
+
<a href="../files/erubis/context_rb.html">
|
|
59
|
+
erubis/context.rb
|
|
60
|
+
</a>
|
|
61
|
+
<br />
|
|
62
|
+
<a href="../files/erubis/converter_rb.html">
|
|
63
|
+
erubis/converter.rb
|
|
64
|
+
</a>
|
|
65
|
+
<br />
|
|
58
66
|
<a href="../files/erubis/engine/ec_rb.html">
|
|
59
67
|
erubis/engine/ec.rb
|
|
60
68
|
</a>
|
|
@@ -98,6 +106,22 @@
|
|
|
98
106
|
<a href="../files/erubis/enhancer_rb.html">
|
|
99
107
|
erubis/enhancer.rb
|
|
100
108
|
</a>
|
|
109
|
+
<br />
|
|
110
|
+
<a href="../files/erubis/error_rb.html">
|
|
111
|
+
erubis/error.rb
|
|
112
|
+
</a>
|
|
113
|
+
<br />
|
|
114
|
+
<a href="../files/erubis/evaluator_rb.html">
|
|
115
|
+
erubis/evaluator.rb
|
|
116
|
+
</a>
|
|
117
|
+
<br />
|
|
118
|
+
<a href="../files/erubis/generator_rb.html">
|
|
119
|
+
erubis/generator.rb
|
|
120
|
+
</a>
|
|
121
|
+
<br />
|
|
122
|
+
<a href="../files/erubis/helper/rails_rb.html">
|
|
123
|
+
erubis/helper/rails.rb
|
|
124
|
+
</a>
|
|
101
125
|
<br />
|
|
102
126
|
<a href="../files/erubis/helper_rb.html">
|
|
103
127
|
erubis/helper.rb
|
|
@@ -126,7 +150,7 @@
|
|
|
126
150
|
|
|
127
151
|
<div id="description">
|
|
128
152
|
<p>
|
|
129
|
-
$Rev:
|
|
153
|
+
$Rev: 35 $ $Release: 2.1.0 $ copyright(c) 2006 kuwata-lab all rights reserved.
|
|
130
154
|
</p>
|
|
131
155
|
|
|
132
156
|
</div>
|
|
@@ -147,13 +171,29 @@ $Rev: 21 $ $Release: 2.0.1 $ copyright(c) 2006 kuwata-lab all rights reserved.
|
|
|
147
171
|
|
|
148
172
|
Module <a href="Erubis/ArrayBufferEnhancer.html" class="link">Erubis::ArrayBufferEnhancer</a><br />
|
|
149
173
|
Module <a href="Erubis/ArrayEnhancer.html" class="link">Erubis::ArrayEnhancer</a><br />
|
|
174
|
+
Module <a href="Erubis/Basic.html" class="link">Erubis::Basic</a><br />
|
|
150
175
|
Module <a href="Erubis/BiPatternEnhancer.html" class="link">Erubis::BiPatternEnhancer</a><br />
|
|
176
|
+
Module <a href="Erubis/CGenerator.html" class="link">Erubis::CGenerator</a><br />
|
|
177
|
+
Module <a href="Erubis/Converter.html" class="link">Erubis::Converter</a><br />
|
|
151
178
|
Module <a href="Erubis/EscapeEnhancer.html" class="link">Erubis::EscapeEnhancer</a><br />
|
|
179
|
+
Module <a href="Erubis/Evaluator.html" class="link">Erubis::Evaluator</a><br />
|
|
180
|
+
Module <a href="Erubis/Generator.html" class="link">Erubis::Generator</a><br />
|
|
152
181
|
Module <a href="Erubis/HeaderFooterEnhancer.html" class="link">Erubis::HeaderFooterEnhancer</a><br />
|
|
182
|
+
Module <a href="Erubis/Helper.html" class="link">Erubis::Helper</a><br />
|
|
183
|
+
Module <a href="Erubis/JavaGenerator.html" class="link">Erubis::JavaGenerator</a><br />
|
|
184
|
+
Module <a href="Erubis/JavascriptGenerator.html" class="link">Erubis::JavascriptGenerator</a><br />
|
|
185
|
+
Module <a href="Erubis/NoCodeEnhancer.html" class="link">Erubis::NoCodeEnhancer</a><br />
|
|
153
186
|
Module <a href="Erubis/NoTextEnhancer.html" class="link">Erubis::NoTextEnhancer</a><br />
|
|
187
|
+
Module <a href="Erubis/OptimizedGenerator.html" class="link">Erubis::OptimizedGenerator</a><br />
|
|
188
|
+
Module <a href="Erubis/PI.html" class="link">Erubis::PI</a><br />
|
|
154
189
|
Module <a href="Erubis/PercentLineEnhancer.html" class="link">Erubis::PercentLineEnhancer</a><br />
|
|
190
|
+
Module <a href="Erubis/PerlGenerator.html" class="link">Erubis::PerlGenerator</a><br />
|
|
191
|
+
Module <a href="Erubis/PhpGenerator.html" class="link">Erubis::PhpGenerator</a><br />
|
|
155
192
|
Module <a href="Erubis/PrintEnabledEnhancer.html" class="link">Erubis::PrintEnabledEnhancer</a><br />
|
|
156
193
|
Module <a href="Erubis/PrintOutEnhancer.html" class="link">Erubis::PrintOutEnhancer</a><br />
|
|
194
|
+
Module <a href="Erubis/RubyEvaluator.html" class="link">Erubis::RubyEvaluator</a><br />
|
|
195
|
+
Module <a href="Erubis/RubyGenerator.html" class="link">Erubis::RubyGenerator</a><br />
|
|
196
|
+
Module <a href="Erubis/SchemeGenerator.html" class="link">Erubis::SchemeGenerator</a><br />
|
|
157
197
|
Module <a href="Erubis/SimplifyEnhancer.html" class="link">Erubis::SimplifyEnhancer</a><br />
|
|
158
198
|
Module <a href="Erubis/StdoutEnhancer.html" class="link">Erubis::StdoutEnhancer</a><br />
|
|
159
199
|
Module <a href="Erubis/StringBufferEnhancer.html" class="link">Erubis::StringBufferEnhancer</a><br />
|
|
@@ -181,7 +221,9 @@ Class <a href="Erubis/EscapedEscheme.html" class="link">Erubis::EscapedEscheme</
|
|
|
181
221
|
Class <a href="Erubis/Escheme.html" class="link">Erubis::Escheme</a><br />
|
|
182
222
|
Class <a href="Erubis/HeaderFooterEruby.html" class="link">Erubis::HeaderFooterEruby</a><br />
|
|
183
223
|
Class <a href="Erubis/Main.html" class="link">Erubis::Main</a><br />
|
|
224
|
+
Class <a href="Erubis/NoCodeEruby.html" class="link">Erubis::NoCodeEruby</a><br />
|
|
184
225
|
Class <a href="Erubis/NoTextEruby.html" class="link">Erubis::NoTextEruby</a><br />
|
|
226
|
+
Class <a href="Erubis/NotSupportedError.html" class="link">Erubis::NotSupportedError</a><br />
|
|
185
227
|
Class <a href="Erubis/OptimizedEruby.html" class="link">Erubis::OptimizedEruby</a><br />
|
|
186
228
|
Class <a href="Erubis/OptimizedXmlEruby.html" class="link">Erubis::OptimizedXmlEruby</a><br />
|
|
187
229
|
Class <a href="Erubis/PercentLineEruby.html" class="link">Erubis::PercentLineEruby</a><br />
|
|
@@ -90,8 +90,8 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
90
90
|
<h3 class="section-bar">Methods</h3>
|
|
91
91
|
|
|
92
92
|
<div class="name-list">
|
|
93
|
-
<a href="#
|
|
94
|
-
<a href="#
|
|
93
|
+
<a href="#M000007">add_postamble</a>
|
|
94
|
+
<a href="#M000006">add_preamble</a>
|
|
95
95
|
</div>
|
|
96
96
|
</div>
|
|
97
97
|
|
|
@@ -113,21 +113,21 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
113
113
|
<div id="methods">
|
|
114
114
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
115
115
|
|
|
116
|
-
<div id="method-
|
|
117
|
-
<a name="
|
|
116
|
+
<div id="method-M000007" class="method-detail">
|
|
117
|
+
<a name="M000007"></a>
|
|
118
118
|
|
|
119
119
|
<div class="method-heading">
|
|
120
|
-
<a href="#
|
|
120
|
+
<a href="#M000007" class="method-signature">
|
|
121
121
|
<span class="method-name">add_postamble</span><span class="method-args">(src)</span>
|
|
122
122
|
</a>
|
|
123
123
|
</div>
|
|
124
124
|
|
|
125
125
|
<div class="method-description">
|
|
126
126
|
<p><a class="source-toggle" href="#"
|
|
127
|
-
onclick="toggleCode('
|
|
128
|
-
<div class="method-source-code" id="
|
|
127
|
+
onclick="toggleCode('M000007-source');return false;">[Source]</a></p>
|
|
128
|
+
<div class="method-source-code" id="M000007-source">
|
|
129
129
|
<pre>
|
|
130
|
-
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line
|
|
130
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 192</span>
|
|
131
131
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_postamble</span>(<span class="ruby-identifier">src</span>)
|
|
132
132
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"\n"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">src</span>[<span class="ruby-value">-1</span>] <span class="ruby-operator">==</span> <span class="ruby-value">?\n</span>
|
|
133
133
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"_buf.join\n"</span>
|
|
@@ -137,21 +137,21 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
137
137
|
</div>
|
|
138
138
|
</div>
|
|
139
139
|
|
|
140
|
-
<div id="method-
|
|
141
|
-
<a name="
|
|
140
|
+
<div id="method-M000006" class="method-detail">
|
|
141
|
+
<a name="M000006"></a>
|
|
142
142
|
|
|
143
143
|
<div class="method-heading">
|
|
144
|
-
<a href="#
|
|
144
|
+
<a href="#M000006" class="method-signature">
|
|
145
145
|
<span class="method-name">add_preamble</span><span class="method-args">(src)</span>
|
|
146
146
|
</a>
|
|
147
147
|
</div>
|
|
148
148
|
|
|
149
149
|
<div class="method-description">
|
|
150
150
|
<p><a class="source-toggle" href="#"
|
|
151
|
-
onclick="toggleCode('
|
|
152
|
-
<div class="method-source-code" id="
|
|
151
|
+
onclick="toggleCode('M000006-source');return false;">[Source]</a></p>
|
|
152
|
+
<div class="method-source-code" id="M000006-source">
|
|
153
153
|
<pre>
|
|
154
|
-
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line
|
|
154
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 188</span>
|
|
155
155
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_preamble</span>(<span class="ruby-identifier">src</span>)
|
|
156
156
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"_buf = [];"</span>
|
|
157
157
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -89,8 +89,8 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
89
89
|
<h3 class="section-bar">Methods</h3>
|
|
90
90
|
|
|
91
91
|
<div class="name-list">
|
|
92
|
-
<a href="#
|
|
93
|
-
<a href="#
|
|
92
|
+
<a href="#M000155">add_postamble</a>
|
|
93
|
+
<a href="#M000154">add_preamble</a>
|
|
94
94
|
</div>
|
|
95
95
|
</div>
|
|
96
96
|
|
|
@@ -112,21 +112,21 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
112
112
|
<div id="methods">
|
|
113
113
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
114
114
|
|
|
115
|
-
<div id="method-
|
|
116
|
-
<a name="
|
|
115
|
+
<div id="method-M000155" class="method-detail">
|
|
116
|
+
<a name="M000155"></a>
|
|
117
117
|
|
|
118
118
|
<div class="method-heading">
|
|
119
|
-
<a href="#
|
|
119
|
+
<a href="#M000155" class="method-signature">
|
|
120
120
|
<span class="method-name">add_postamble</span><span class="method-args">(src)</span>
|
|
121
121
|
</a>
|
|
122
122
|
</div>
|
|
123
123
|
|
|
124
124
|
<div class="method-description">
|
|
125
125
|
<p><a class="source-toggle" href="#"
|
|
126
|
-
onclick="toggleCode('
|
|
127
|
-
<div class="method-source-code" id="
|
|
126
|
+
onclick="toggleCode('M000155-source');return false;">[Source]</a></p>
|
|
127
|
+
<div class="method-source-code" id="M000155-source">
|
|
128
128
|
<pre>
|
|
129
|
-
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line
|
|
129
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 169</span>
|
|
130
130
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_postamble</span>(<span class="ruby-identifier">src</span>)
|
|
131
131
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"\n"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">src</span>[<span class="ruby-value">-1</span>] <span class="ruby-operator">==</span> <span class="ruby-value">?\n</span>
|
|
132
132
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"_buf\n"</span>
|
|
@@ -136,21 +136,21 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
136
136
|
</div>
|
|
137
137
|
</div>
|
|
138
138
|
|
|
139
|
-
<div id="method-
|
|
140
|
-
<a name="
|
|
139
|
+
<div id="method-M000154" class="method-detail">
|
|
140
|
+
<a name="M000154"></a>
|
|
141
141
|
|
|
142
142
|
<div class="method-heading">
|
|
143
|
-
<a href="#
|
|
143
|
+
<a href="#M000154" class="method-signature">
|
|
144
144
|
<span class="method-name">add_preamble</span><span class="method-args">(src)</span>
|
|
145
145
|
</a>
|
|
146
146
|
</div>
|
|
147
147
|
|
|
148
148
|
<div class="method-description">
|
|
149
149
|
<p><a class="source-toggle" href="#"
|
|
150
|
-
onclick="toggleCode('
|
|
151
|
-
<div class="method-source-code" id="
|
|
150
|
+
onclick="toggleCode('M000154-source');return false;">[Source]</a></p>
|
|
151
|
+
<div class="method-source-code" id="M000154-source">
|
|
152
152
|
<pre>
|
|
153
|
-
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line
|
|
153
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 165</span>
|
|
154
154
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_preamble</span>(<span class="ruby-identifier">src</span>)
|
|
155
155
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"_buf = [];"</span>
|
|
156
156
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -0,0 +1,112 @@
|
|
|
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::Basic</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::Basic</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr class="top-aligned-row">
|
|
56
|
+
<td><strong>In:</strong></td>
|
|
57
|
+
<td>
|
|
58
|
+
<a href="../../files/erubis/converter_rb.html">
|
|
59
|
+
erubis/converter.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
|
+
|
|
76
|
+
|
|
77
|
+
</div>
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
</div>
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
<!-- if includes -->
|
|
84
|
+
|
|
85
|
+
<div id="section">
|
|
86
|
+
|
|
87
|
+
<div id="class-list">
|
|
88
|
+
<h3 class="section-bar">Classes and Modules</h3>
|
|
89
|
+
|
|
90
|
+
Module <a href="Basic/Converter.html" class="link">Erubis::Basic::Converter</a><br />
|
|
91
|
+
Class <a href="Basic/Engine.html" class="link">Erubis::Basic::Engine</a><br />
|
|
92
|
+
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
<!-- if method_list -->
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
<div id="validator-badges">
|
|
108
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
109
|
+
</div>
|
|
110
|
+
|
|
111
|
+
</body>
|
|
112
|
+
</html>
|
|
@@ -0,0 +1,318 @@
|
|
|
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::Basic::Converter</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::Basic::Converter</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr class="top-aligned-row">
|
|
56
|
+
<td><strong>In:</strong></td>
|
|
57
|
+
<td>
|
|
58
|
+
<a href="../../../files/erubis/converter_rb.html">
|
|
59
|
+
erubis/converter.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
|
+
basic converter which supports ’<% … %>’ notation.
|
|
78
|
+
</p>
|
|
79
|
+
|
|
80
|
+
</div>
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
</div>
|
|
84
|
+
|
|
85
|
+
<div id="method-list">
|
|
86
|
+
<h3 class="section-bar">Methods</h3>
|
|
87
|
+
|
|
88
|
+
<div class="name-list">
|
|
89
|
+
<a href="#M000057">add_expr</a>
|
|
90
|
+
<a href="#M000056">convert_input</a>
|
|
91
|
+
<a href="#M000054">init_converter</a>
|
|
92
|
+
<a href="#M000055">pattern_regexp</a>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
|
|
96
|
+
</div>
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
<!-- if includes -->
|
|
100
|
+
<div id="includes">
|
|
101
|
+
<h3 class="section-bar">Included Modules</h3>
|
|
102
|
+
|
|
103
|
+
<div id="includes-list">
|
|
104
|
+
<span class="include-name"><a href="../Converter.html">Erubis::Converter</a></span>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
<div id="section">
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
<div id="constants-list">
|
|
112
|
+
<h3 class="section-bar">Constants</h3>
|
|
113
|
+
|
|
114
|
+
<div class="name-list">
|
|
115
|
+
<table summary="Constants">
|
|
116
|
+
<tr class="top-aligned-row context-row">
|
|
117
|
+
<td class="context-item-name">DEFAULT_REGEXP</td>
|
|
118
|
+
<td>=</td>
|
|
119
|
+
<td class="context-item-value">/(^[ \t]*)?<%(=+|\#)?(.*?)-?%>([ \t]*\r?\n)?/m</td>
|
|
120
|
+
<td width="3em"> </td>
|
|
121
|
+
<td class="context-item-desc">
|
|
122
|
+
DEFAULT_REGEXP = /(.*?)(^[ \t]*)?<%(=+|\#)?(.*?)-?%>([ \t]*\r?\n)?/m
|
|
123
|
+
|
|
124
|
+
</td>
|
|
125
|
+
</tr>
|
|
126
|
+
</table>
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
<div id="attribute-list">
|
|
133
|
+
<h3 class="section-bar">Attributes</h3>
|
|
134
|
+
|
|
135
|
+
<div class="name-list">
|
|
136
|
+
<table>
|
|
137
|
+
<tr class="top-aligned-row context-row">
|
|
138
|
+
<td class="context-item-name">pattern</td>
|
|
139
|
+
<td class="context-item-value"> [RW] </td>
|
|
140
|
+
<td class="context-item-desc"></td>
|
|
141
|
+
</tr>
|
|
142
|
+
<tr class="top-aligned-row context-row">
|
|
143
|
+
<td class="context-item-name">trim</td>
|
|
144
|
+
<td class="context-item-value"> [RW] </td>
|
|
145
|
+
<td class="context-item-desc"></td>
|
|
146
|
+
</tr>
|
|
147
|
+
</table>
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
<!-- if method_list -->
|
|
154
|
+
<div id="methods">
|
|
155
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
|
156
|
+
|
|
157
|
+
<div id="method-M000057" class="method-detail">
|
|
158
|
+
<a name="M000057"></a>
|
|
159
|
+
|
|
160
|
+
<div class="method-heading">
|
|
161
|
+
<a href="#M000057" class="method-signature">
|
|
162
|
+
<span class="method-name">add_expr</span><span class="method-args">(src, code, indicator)</span>
|
|
163
|
+
</a>
|
|
164
|
+
</div>
|
|
165
|
+
|
|
166
|
+
<div class="method-description">
|
|
167
|
+
<p>
|
|
168
|
+
add expression code to src
|
|
169
|
+
</p>
|
|
170
|
+
<p><a class="source-toggle" href="#"
|
|
171
|
+
onclick="toggleCode('M000057-source');return false;">[Source]</a></p>
|
|
172
|
+
<div class="method-source-code" id="M000057-source">
|
|
173
|
+
<pre>
|
|
174
|
+
<span class="ruby-comment cmt"># File erubis/converter.rb, line 133</span>
|
|
175
|
+
<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>)
|
|
176
|
+
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">indicator</span>
|
|
177
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-value str">'='</span>
|
|
178
|
+
<span class="ruby-ivar">@escape</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">add_expr_escaped</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">add_expr_literal</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>)
|
|
179
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-value str">'=='</span>
|
|
180
|
+
<span class="ruby-ivar">@escape</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">add_expr_literal</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">add_expr_escaped</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>)
|
|
181
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-value str">'==='</span>
|
|
182
|
+
<span class="ruby-identifier">add_expr_debug</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>)
|
|
183
|
+
<span class="ruby-keyword kw">end</span>
|
|
184
|
+
<span class="ruby-keyword kw">end</span>
|
|
185
|
+
</pre>
|
|
186
|
+
</div>
|
|
187
|
+
</div>
|
|
188
|
+
</div>
|
|
189
|
+
|
|
190
|
+
<div id="method-M000056" class="method-detail">
|
|
191
|
+
<a name="M000056"></a>
|
|
192
|
+
|
|
193
|
+
<div class="method-heading">
|
|
194
|
+
<a href="#M000056" class="method-signature">
|
|
195
|
+
<span class="method-name">convert_input</span><span class="method-args">(src, input)</span>
|
|
196
|
+
</a>
|
|
197
|
+
</div>
|
|
198
|
+
|
|
199
|
+
<div class="method-description">
|
|
200
|
+
<p><a class="source-toggle" href="#"
|
|
201
|
+
onclick="toggleCode('M000056-source');return false;">[Source]</a></p>
|
|
202
|
+
<div class="method-source-code" id="M000056-source">
|
|
203
|
+
<pre>
|
|
204
|
+
<span class="ruby-comment cmt"># File erubis/converter.rb, line 94</span>
|
|
205
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">convert_input</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">input</span>)
|
|
206
|
+
<span class="ruby-identifier">regexp</span> = <span class="ruby-identifier">pattern_regexp</span>(<span class="ruby-ivar">@pattern</span>)
|
|
207
|
+
<span class="ruby-identifier">pos</span> = <span class="ruby-value">0</span>
|
|
208
|
+
<span class="ruby-identifier">input</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-identifier">regexp</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">lspace</span>, <span class="ruby-identifier">indicator</span>, <span class="ruby-identifier">code</span>, <span class="ruby-identifier">rspace</span><span class="ruby-operator">|</span>
|
|
209
|
+
<span class="ruby-identifier">match</span> = <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">last_match</span>()
|
|
210
|
+
<span class="ruby-identifier">index</span> = <span class="ruby-identifier">match</span>.<span class="ruby-identifier">begin</span>(<span class="ruby-value">0</span>)
|
|
211
|
+
<span class="ruby-identifier">text</span> = <span class="ruby-identifier">input</span>[<span class="ruby-identifier">pos</span>, <span class="ruby-identifier">index</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">pos</span>]
|
|
212
|
+
<span class="ruby-identifier">pos</span> = <span class="ruby-identifier">match</span>.<span class="ruby-identifier">end</span>(<span class="ruby-value">0</span>)
|
|
213
|
+
<span class="ruby-identifier">add_text</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">text</span>)
|
|
214
|
+
<span class="ruby-comment cmt">## * when '<%= %>', do nothing</span>
|
|
215
|
+
<span class="ruby-comment cmt">## * when '<% %>' or '<%# %>', delete spaces iff only spaces are around '<% %>'</span>
|
|
216
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">indicator</span> <span class="ruby-comment cmt"># <% %></span>
|
|
217
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@trim</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">lspace</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">rspace</span>
|
|
218
|
+
<span class="ruby-identifier">add_stmt</span>(<span class="ruby-identifier">src</span>, <span class="ruby-node">"#{lspace}#{code}#{rspace}"</span>)
|
|
219
|
+
<span class="ruby-keyword kw">else</span>
|
|
220
|
+
<span class="ruby-identifier">add_text</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">lspace</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">lspace</span>
|
|
221
|
+
<span class="ruby-identifier">add_stmt</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>)
|
|
222
|
+
<span class="ruby-identifier">add_text</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">rspace</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">rspace</span>
|
|
223
|
+
<span class="ruby-keyword kw">end</span>
|
|
224
|
+
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">indicator</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-value">?\#</span> <span class="ruby-comment cmt"># <%# %></span>
|
|
225
|
+
<span class="ruby-identifier">n</span> = <span class="ruby-identifier">code</span>.<span class="ruby-identifier">count</span>(<span class="ruby-value str">"\n"</span>) <span class="ruby-operator">+</span> (<span class="ruby-identifier">rspace</span> <span class="ruby-value">? </span><span class="ruby-value">1</span> <span class="ruby-operator">:</span> <span class="ruby-value">0</span>)
|
|
226
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@trim</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">lspace</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">rspace</span>
|
|
227
|
+
<span class="ruby-identifier">add_stmt</span>(<span class="ruby-identifier">src</span>, <span class="ruby-value str">"\n"</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">n</span>)
|
|
228
|
+
<span class="ruby-keyword kw">else</span>
|
|
229
|
+
<span class="ruby-identifier">add_text</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">lspace</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">lspace</span>
|
|
230
|
+
<span class="ruby-identifier">add_stmt</span>(<span class="ruby-identifier">src</span>, <span class="ruby-value str">"\n"</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">n</span>)
|
|
231
|
+
<span class="ruby-identifier">add_text</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">rspace</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">rspace</span>
|
|
232
|
+
<span class="ruby-keyword kw">end</span>
|
|
233
|
+
<span class="ruby-keyword kw">else</span> <span class="ruby-comment cmt"># <%= %></span>
|
|
234
|
+
<span class="ruby-identifier">add_text</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">lspace</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">lspace</span>
|
|
235
|
+
<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>)
|
|
236
|
+
<span class="ruby-identifier">add_text</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">rspace</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">rspace</span>
|
|
237
|
+
<span class="ruby-keyword kw">end</span>
|
|
238
|
+
<span class="ruby-keyword kw">end</span>
|
|
239
|
+
<span class="ruby-identifier">rest</span> = <span class="ruby-identifier">$'</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">input</span> <span class="ruby-comment cmt"># add input when no matched</span>
|
|
240
|
+
<span class="ruby-identifier">add_text</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">rest</span>)
|
|
241
|
+
<span class="ruby-keyword kw">end</span>
|
|
242
|
+
</pre>
|
|
243
|
+
</div>
|
|
244
|
+
</div>
|
|
245
|
+
</div>
|
|
246
|
+
|
|
247
|
+
<div id="method-M000054" class="method-detail">
|
|
248
|
+
<a name="M000054"></a>
|
|
249
|
+
|
|
250
|
+
<div class="method-heading">
|
|
251
|
+
<a href="#M000054" class="method-signature">
|
|
252
|
+
<span class="method-name">init_converter</span><span class="method-args">(properties={})</span>
|
|
253
|
+
</a>
|
|
254
|
+
</div>
|
|
255
|
+
|
|
256
|
+
<div class="method-description">
|
|
257
|
+
<p><a class="source-toggle" href="#"
|
|
258
|
+
onclick="toggleCode('M000054-source');return false;">[Source]</a></p>
|
|
259
|
+
<div class="method-source-code" id="M000054-source">
|
|
260
|
+
<pre>
|
|
261
|
+
<span class="ruby-comment cmt"># File erubis/converter.rb, line 73</span>
|
|
262
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">init_converter</span>(<span class="ruby-identifier">properties</span>={})
|
|
263
|
+
<span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">properties</span>)
|
|
264
|
+
<span class="ruby-ivar">@pattern</span> = <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:pattern</span>]
|
|
265
|
+
<span class="ruby-ivar">@trim</span> = <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:trim</span>] <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">false</span>
|
|
266
|
+
<span class="ruby-keyword kw">end</span>
|
|
267
|
+
</pre>
|
|
268
|
+
</div>
|
|
269
|
+
</div>
|
|
270
|
+
</div>
|
|
271
|
+
|
|
272
|
+
<h3 class="section-bar">Protected Instance methods</h3>
|
|
273
|
+
|
|
274
|
+
<div id="method-M000055" class="method-detail">
|
|
275
|
+
<a name="M000055"></a>
|
|
276
|
+
|
|
277
|
+
<div class="method-heading">
|
|
278
|
+
<a href="#M000055" class="method-signature">
|
|
279
|
+
<span class="method-name">pattern_regexp</span><span class="method-args">(pattern=@pattern)</span>
|
|
280
|
+
</a>
|
|
281
|
+
</div>
|
|
282
|
+
|
|
283
|
+
<div class="method-description">
|
|
284
|
+
<p>
|
|
285
|
+
return regexp of pattern to parse eRuby script
|
|
286
|
+
</p>
|
|
287
|
+
<p><a class="source-toggle" href="#"
|
|
288
|
+
onclick="toggleCode('M000055-source');return false;">[Source]</a></p>
|
|
289
|
+
<div class="method-source-code" id="M000055-source">
|
|
290
|
+
<pre>
|
|
291
|
+
<span class="ruby-comment cmt"># File erubis/converter.rb, line 83</span>
|
|
292
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pattern_regexp</span>(<span class="ruby-identifier">pattern</span>=<span class="ruby-ivar">@pattern</span>)
|
|
293
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">pattern</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">pattern</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'<% %>'</span>
|
|
294
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-constant">DEFAULT_REGEXP</span>
|
|
295
|
+
<span class="ruby-keyword kw">else</span>
|
|
296
|
+
<span class="ruby-identifier">prefix</span>, <span class="ruby-identifier">postfix</span> = <span class="ruby-identifier">pattern</span>.<span class="ruby-identifier">split</span>()
|
|
297
|
+
<span class="ruby-comment cmt">#return /(.*?)(^[ \t]*)?#{prefix}(=+|\#)?(.*?)-?#{postfix}([ \t]*\r?\n)?/m</span>
|
|
298
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-node">/(^[ \t]*)?#{prefix}(=+|\#)?(.*?)-?#{postfix}([ \t]*\r?\n)?/</span><span class="ruby-identifier">m</span>
|
|
299
|
+
<span class="ruby-keyword kw">end</span>
|
|
300
|
+
<span class="ruby-keyword kw">end</span>
|
|
301
|
+
</pre>
|
|
302
|
+
</div>
|
|
303
|
+
</div>
|
|
304
|
+
</div>
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
</div>
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
</div>
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
<div id="validator-badges">
|
|
314
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
315
|
+
</div>
|
|
316
|
+
|
|
317
|
+
</body>
|
|
318
|
+
</html>
|