erubis 2.0.1 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -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="#M000062">add_postamble</a>
|
93
|
+
<a href="#M000061">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-M000062" class="method-detail">
|
116
|
+
<a name="M000062"></a>
|
117
117
|
|
118
118
|
<div class="method-heading">
|
119
|
-
<a href="#
|
119
|
+
<a href="#M000062" 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('M000062-source');return false;">[Source]</a></p>
|
127
|
+
<div class="method-source-code" id="M000062-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 74</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''\n"</span>
|
132
132
|
<span class="ruby-keyword kw">end</span>
|
@@ -135,21 +135,21 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
135
135
|
</div>
|
136
136
|
</div>
|
137
137
|
|
138
|
-
<div id="method-
|
139
|
-
<a name="
|
138
|
+
<div id="method-M000061" class="method-detail">
|
139
|
+
<a name="M000061"></a>
|
140
140
|
|
141
141
|
<div class="method-heading">
|
142
|
-
<a href="#
|
142
|
+
<a href="#M000061" class="method-signature">
|
143
143
|
<span class="method-name">add_preamble</span><span class="method-args">(src)</span>
|
144
144
|
</a>
|
145
145
|
</div>
|
146
146
|
|
147
147
|
<div class="method-description">
|
148
148
|
<p><a class="source-toggle" href="#"
|
149
|
-
onclick="toggleCode('
|
150
|
-
<div class="method-source-code" id="
|
149
|
+
onclick="toggleCode('M000061-source');return false;">[Source]</a></p>
|
150
|
+
<div class="method-source-code" id="M000061-source">
|
151
151
|
<pre>
|
152
|
-
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line
|
152
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 70</span>
|
153
153
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_preamble</span>(<span class="ruby-identifier">src</span>)
|
154
154
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"_buf = $stdout;"</span>
|
155
155
|
<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="#M000159">add_postamble</a>
|
93
|
+
<a href="#M000158">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-M000159" class="method-detail">
|
116
|
+
<a name="M000159"></a>
|
117
117
|
|
118
118
|
<div class="method-heading">
|
119
|
-
<a href="#
|
119
|
+
<a href="#M000159" 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('M000159-source');return false;">[Source]</a></p>
|
127
|
+
<div class="method-source-code" id="M000159-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 215</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-M000158" class="method-detail">
|
140
|
+
<a name="M000158"></a>
|
141
141
|
|
142
142
|
<div class="method-heading">
|
143
|
-
<a href="#
|
143
|
+
<a href="#M000158" 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('M000158-source');return false;">[Source]</a></p>
|
151
|
+
<div class="method-source-code" id="M000158-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 211</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>
|
@@ -101,11 +101,11 @@ ex.
|
|
101
101
|
<h3 class="section-bar">Methods</h3>
|
102
102
|
|
103
103
|
<div class="name-list">
|
104
|
-
<a href="#
|
105
|
-
<a href="#
|
106
|
-
<a href="#
|
107
|
-
<a href="#
|
108
|
-
<a href="#
|
104
|
+
<a href="#M000161">convert</a>
|
105
|
+
<a href="#M000162">escape_text</a>
|
106
|
+
<a href="#M000164">evaluate</a>
|
107
|
+
<a href="#M000160">new</a>
|
108
|
+
<a href="#M000163">result</a>
|
109
109
|
</div>
|
110
110
|
</div>
|
111
111
|
|
@@ -125,7 +125,7 @@ ex.
|
|
125
125
|
<tr class="top-aligned-row context-row">
|
126
126
|
<td class="context-item-name">EMBEDDED_PATTERN</td>
|
127
127
|
<td>=</td>
|
128
|
-
<td class="context-item-value"
|
128
|
+
<td class="context-item-value">/<%(=+|\#)?(.*?)-?%>/m</td>
|
129
129
|
</tr>
|
130
130
|
</table>
|
131
131
|
</div>
|
@@ -153,23 +153,23 @@ ex.
|
|
153
153
|
<div id="methods">
|
154
154
|
<h3 class="section-bar">Public Class methods</h3>
|
155
155
|
|
156
|
-
<div id="method-
|
157
|
-
<a name="
|
156
|
+
<div id="method-M000160" class="method-detail">
|
157
|
+
<a name="M000160"></a>
|
158
158
|
|
159
159
|
<div class="method-heading">
|
160
|
-
<a href="#
|
161
|
-
<span class="method-name">new</span><span class="method-args">(input)</span>
|
160
|
+
<a href="#M000160" class="method-signature">
|
161
|
+
<span class="method-name">new</span><span class="method-args">(input=nil)</span>
|
162
162
|
</a>
|
163
163
|
</div>
|
164
164
|
|
165
165
|
<div class="method-description">
|
166
166
|
<p><a class="source-toggle" href="#"
|
167
|
-
onclick="toggleCode('
|
168
|
-
<div class="method-source-code" id="
|
167
|
+
onclick="toggleCode('M000160-source');return false;">[Source]</a></p>
|
168
|
+
<div class="method-source-code" id="M000160-source">
|
169
169
|
<pre>
|
170
170
|
<span class="ruby-comment cmt"># File erubis/tiny.rb, line 20</span>
|
171
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">input</span>)
|
172
|
-
<span class="ruby-ivar">@src</span> = <span class="ruby-identifier">
|
171
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">input</span>=<span class="ruby-keyword kw">nil</span>)
|
172
|
+
<span class="ruby-ivar">@src</span> = <span class="ruby-identifier">convert</span>(<span class="ruby-identifier">input</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">input</span>
|
173
173
|
<span class="ruby-keyword kw">end</span>
|
174
174
|
</pre>
|
175
175
|
</div>
|
@@ -178,24 +178,29 @@ ex.
|
|
178
178
|
|
179
179
|
<h3 class="section-bar">Public Instance methods</h3>
|
180
180
|
|
181
|
-
<div id="method-
|
182
|
-
<a name="
|
181
|
+
<div id="method-M000161" class="method-detail">
|
182
|
+
<a name="M000161"></a>
|
183
183
|
|
184
184
|
<div class="method-heading">
|
185
|
-
<a href="#
|
186
|
-
<span class="method-name">
|
185
|
+
<a href="#M000161" class="method-signature">
|
186
|
+
<span class="method-name">convert</span><span class="method-args">(input)</span>
|
187
187
|
</a>
|
188
188
|
</div>
|
189
189
|
|
190
190
|
<div class="method-description">
|
191
191
|
<p><a class="source-toggle" href="#"
|
192
|
-
onclick="toggleCode('
|
193
|
-
<div class="method-source-code" id="
|
192
|
+
onclick="toggleCode('M000161-source');return false;">[Source]</a></p>
|
193
|
+
<div class="method-source-code" id="M000161-source">
|
194
194
|
<pre>
|
195
195
|
<span class="ruby-comment cmt"># File erubis/tiny.rb, line 27</span>
|
196
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
196
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">convert</span>(<span class="ruby-identifier">input</span>)
|
197
197
|
<span class="ruby-identifier">src</span> = <span class="ruby-value str">"_buf = [];"</span> <span class="ruby-comment cmt"># preamble</span>
|
198
|
-
<span class="ruby-identifier">
|
198
|
+
<span class="ruby-identifier">pos</span> = <span class="ruby-value">0</span>
|
199
|
+
<span class="ruby-identifier">input</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-constant">EMBEDDED_PATTERN</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">indicator</span>, <span class="ruby-identifier">code</span><span class="ruby-operator">|</span>
|
200
|
+
<span class="ruby-identifier">match</span> = <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">last_match</span>
|
201
|
+
<span class="ruby-identifier">index</span> = <span class="ruby-identifier">match</span>.<span class="ruby-identifier">begin</span>(<span class="ruby-value">0</span>)
|
202
|
+
<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>]
|
203
|
+
<span class="ruby-identifier">pos</span> = <span class="ruby-identifier">match</span>.<span class="ruby-identifier">end</span>(<span class="ruby-value">0</span>)
|
199
204
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">" _buf << '"</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">escape_text</span>(<span class="ruby-identifier">text</span>) <span class="ruby-operator"><<</span> <span class="ruby-value str">"';"</span>
|
200
205
|
<span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">indicator</span> <span class="ruby-comment cmt"># <% %></span>
|
201
206
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">code</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">";"</span>
|
@@ -216,21 +221,21 @@ ex.
|
|
216
221
|
</div>
|
217
222
|
</div>
|
218
223
|
|
219
|
-
<div id="method-
|
220
|
-
<a name="
|
224
|
+
<div id="method-M000162" class="method-detail">
|
225
|
+
<a name="M000162"></a>
|
221
226
|
|
222
227
|
<div class="method-heading">
|
223
|
-
<a href="#
|
228
|
+
<a href="#M000162" class="method-signature">
|
224
229
|
<span class="method-name">escape_text</span><span class="method-args">(text)</span>
|
225
230
|
</a>
|
226
231
|
</div>
|
227
232
|
|
228
233
|
<div class="method-description">
|
229
234
|
<p><a class="source-toggle" href="#"
|
230
|
-
onclick="toggleCode('
|
231
|
-
<div class="method-source-code" id="
|
235
|
+
onclick="toggleCode('M000162-source');return false;">[Source]</a></p>
|
236
|
+
<div class="method-source-code" id="M000162-source">
|
232
237
|
<pre>
|
233
|
-
<span class="ruby-comment cmt"># File erubis/tiny.rb, line
|
238
|
+
<span class="ruby-comment cmt"># File erubis/tiny.rb, line 51</span>
|
234
239
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escape_text</span>(<span class="ruby-identifier">text</span>)
|
235
240
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/['\\]/</span>, <span class="ruby-value str">'\\\\\&'</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">text</span>
|
236
241
|
<span class="ruby-keyword kw">end</span>
|
@@ -239,21 +244,21 @@ ex.
|
|
239
244
|
</div>
|
240
245
|
</div>
|
241
246
|
|
242
|
-
<div id="method-
|
243
|
-
<a name="
|
247
|
+
<div id="method-M000164" class="method-detail">
|
248
|
+
<a name="M000164"></a>
|
244
249
|
|
245
250
|
<div class="method-heading">
|
246
|
-
<a href="#
|
251
|
+
<a href="#M000164" class="method-signature">
|
247
252
|
<span class="method-name">evaluate</span><span class="method-args">(context=Object.new)</span>
|
248
253
|
</a>
|
249
254
|
</div>
|
250
255
|
|
251
256
|
<div class="method-description">
|
252
257
|
<p><a class="source-toggle" href="#"
|
253
|
-
onclick="toggleCode('
|
254
|
-
<div class="method-source-code" id="
|
258
|
+
onclick="toggleCode('M000164-source');return false;">[Source]</a></p>
|
259
|
+
<div class="method-source-code" id="M000164-source">
|
255
260
|
<pre>
|
256
|
-
<span class="ruby-comment cmt"># File erubis/tiny.rb, line
|
261
|
+
<span class="ruby-comment cmt"># File erubis/tiny.rb, line 59</span>
|
257
262
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">evaluate</span>(<span class="ruby-identifier">context</span>=<span class="ruby-constant">Object</span>.<span class="ruby-identifier">new</span>)
|
258
263
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">context</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
|
259
264
|
<span class="ruby-identifier">obj</span> = <span class="ruby-constant">Object</span>.<span class="ruby-identifier">new</span>
|
@@ -267,21 +272,21 @@ ex.
|
|
267
272
|
</div>
|
268
273
|
</div>
|
269
274
|
|
270
|
-
<div id="method-
|
271
|
-
<a name="
|
275
|
+
<div id="method-M000163" class="method-detail">
|
276
|
+
<a name="M000163"></a>
|
272
277
|
|
273
278
|
<div class="method-heading">
|
274
|
-
<a href="#
|
279
|
+
<a href="#M000163" class="method-signature">
|
275
280
|
<span class="method-name">result</span><span class="method-args">(binding=TOPLEVEL_BINDING)</span>
|
276
281
|
</a>
|
277
282
|
</div>
|
278
283
|
|
279
284
|
<div class="method-description">
|
280
285
|
<p><a class="source-toggle" href="#"
|
281
|
-
onclick="toggleCode('
|
282
|
-
<div class="method-source-code" id="
|
286
|
+
onclick="toggleCode('M000163-source');return false;">[Source]</a></p>
|
287
|
+
<div class="method-source-code" id="M000163-source">
|
283
288
|
<pre>
|
284
|
-
<span class="ruby-comment cmt"># File erubis/tiny.rb, line
|
289
|
+
<span class="ruby-comment cmt"># File erubis/tiny.rb, line 55</span>
|
285
290
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">result</span>(<span class="ruby-identifier">binding</span>=<span class="ruby-constant">TOPLEVEL_BINDING</span>)
|
286
291
|
<span class="ruby-identifier">eval</span> <span class="ruby-ivar">@src</span>, <span class="ruby-identifier">binding</span>
|
287
292
|
<span class="ruby-keyword kw">end</span>
|
@@ -86,9 +86,9 @@ helper for xml
|
|
86
86
|
<h3 class="section-bar">Methods</h3>
|
87
87
|
|
88
88
|
<div class="name-list">
|
89
|
-
<a href="#
|
90
|
-
<a href="#
|
91
|
-
<a href="#
|
89
|
+
<a href="#M000075">escape_xml</a>
|
90
|
+
<a href="#M000076">h</a>
|
91
|
+
<a href="#M000077">html_escape</a>
|
92
92
|
</div>
|
93
93
|
</div>
|
94
94
|
|
@@ -123,19 +123,19 @@ helper for xml
|
|
123
123
|
<div id="methods">
|
124
124
|
<h3 class="section-bar">Public Instance methods</h3>
|
125
125
|
|
126
|
-
<div id="method-
|
127
|
-
<a name="
|
126
|
+
<div id="method-M000075" class="method-detail">
|
127
|
+
<a name="M000075"></a>
|
128
128
|
|
129
129
|
<div class="method-heading">
|
130
|
-
<a href="#
|
130
|
+
<a href="#M000075" class="method-signature">
|
131
131
|
<span class="method-name">escape_xml</span><span class="method-args">(obj)</span>
|
132
132
|
</a>
|
133
133
|
</div>
|
134
134
|
|
135
135
|
<div class="method-description">
|
136
136
|
<p><a class="source-toggle" href="#"
|
137
|
-
onclick="toggleCode('
|
138
|
-
<div class="method-source-code" id="
|
137
|
+
onclick="toggleCode('M000075-source');return false;">[Source]</a></p>
|
138
|
+
<div class="method-source-code" id="M000075-source">
|
139
139
|
<pre>
|
140
140
|
<span class="ruby-comment cmt"># File erubis/helper.rb, line 25</span>
|
141
141
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escape_xml</span>(<span class="ruby-identifier">obj</span>)
|
@@ -150,8 +150,8 @@ helper for xml
|
|
150
150
|
</div>
|
151
151
|
</div>
|
152
152
|
|
153
|
-
<div id="method-
|
154
|
-
<a name="
|
153
|
+
<div id="method-M000076" class="method-detail">
|
154
|
+
<a name="M000076"></a>
|
155
155
|
|
156
156
|
<div class="method-heading">
|
157
157
|
<span class="method-name">h</span><span class="method-args">(obj)</span>
|
@@ -159,13 +159,13 @@ helper for xml
|
|
159
159
|
|
160
160
|
<div class="method-description">
|
161
161
|
<p>
|
162
|
-
Alias for <a href="XmlHelper.html#
|
162
|
+
Alias for <a href="XmlHelper.html#M000075">escape_xml</a>
|
163
163
|
</p>
|
164
164
|
</div>
|
165
165
|
</div>
|
166
166
|
|
167
|
-
<div id="method-
|
168
|
-
<a name="
|
167
|
+
<div id="method-M000077" class="method-detail">
|
168
|
+
<a name="M000077"></a>
|
169
169
|
|
170
170
|
<div class="method-heading">
|
171
171
|
<span class="method-name">html_escape</span><span class="method-args">(obj)</span>
|
@@ -173,7 +173,7 @@ Alias for <a href="XmlHelper.html#M000006">escape_xml</a>
|
|
173
173
|
|
174
174
|
<div class="method-description">
|
175
175
|
<p>
|
176
|
-
Alias for <a href="XmlHelper.html#
|
176
|
+
Alias for <a href="XmlHelper.html#M000075">escape_xml</a>
|
177
177
|
</p>
|
178
178
|
</div>
|
179
179
|
</div>
|
data/doc-api/created.rid
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Sun
|
1
|
+
Sun Sep 24 21:10:10 JST 2006
|
@@ -56,7 +56,7 @@
|
|
56
56
|
</tr>
|
57
57
|
<tr class="top-aligned-row">
|
58
58
|
<td><strong>Last Update:</strong></td>
|
59
|
-
<td>
|
59
|
+
<td>Tue Sep 19 23:23:50 JST 2006</td>
|
60
60
|
</tr>
|
61
61
|
</table>
|
62
62
|
</div>
|
@@ -71,7 +71,7 @@
|
|
71
71
|
<div id="description">
|
72
72
|
<h1>README</h1>
|
73
73
|
<table>
|
74
|
-
<tr><td valign="top">release:</td><td>$Release: 2.0
|
74
|
+
<tr><td valign="top">release:</td><td>$Release: 2.1.0 $
|
75
75
|
|
76
76
|
</td></tr>
|
77
77
|
<tr><td valign="top">copyright:</td><td>copyright(c) 2006 kuwata-lab all rights reserved.
|
@@ -84,25 +84,36 @@
|
|
84
84
|
eRuby. It has the following features.
|
85
85
|
</p>
|
86
86
|
<ul>
|
87
|
-
<li>Very fast
|
87
|
+
<li>Very fast, almost three times faster than ERB and even faster than eruby
|
88
|
+
|
89
|
+
</li>
|
90
|
+
<li>Multi-language support (Ruby/PHP/C/Java/Scheme/Perl/Javascript)
|
91
|
+
|
92
|
+
</li>
|
93
|
+
<li>Auto escaping support
|
88
94
|
|
89
95
|
</li>
|
90
96
|
<li>Auto trimming spaces around ’<% %>’
|
91
97
|
|
92
98
|
</li>
|
93
|
-
<li>
|
99
|
+
<li>Embedded pattern changeable (default ’<% %>’)
|
94
100
|
|
95
101
|
</li>
|
96
|
-
<li>
|
102
|
+
<li>Enable to handle Processing Instructions (PI) as embedded pattern (ex.
|
103
|
+
’<?rb … ?>’)
|
97
104
|
|
98
105
|
</li>
|
99
|
-
<li>Context object available
|
106
|
+
<li>Context object available and easy to combine eRuby template with YAML
|
107
|
+
datafile
|
100
108
|
|
101
109
|
</li>
|
102
|
-
<li>
|
110
|
+
<li>Print statement available
|
103
111
|
|
104
112
|
</li>
|
105
|
-
<li>
|
113
|
+
<li>Easy to extend and customize in subclass
|
114
|
+
|
115
|
+
</li>
|
116
|
+
<li>Ruby on Rails support
|
106
117
|
|
107
118
|
</li>
|
108
119
|
</ul>
|
@@ -163,6 +174,10 @@ If you are exploring Eruby, see the following class at first.
|
|
163
174
|
<li><a href="../../classes/Erubis/Eruby.html">Erubis::Eruby</a>
|
164
175
|
(erubis/engine/eruby.rb) — engine class for eRuby.
|
165
176
|
|
177
|
+
</li>
|
178
|
+
<li><a href="../../classes/Erubis/Converter.html">Erubis::Converter</a>
|
179
|
+
(erubis/converter.rb) — convert eRuby script into Ruby code.
|
180
|
+
|
166
181
|
</li>
|
167
182
|
</ul>
|
168
183
|
<h2>Benchmark</h2>
|
@@ -173,7 +188,10 @@ erubybenchmark.rb’ in benchmark directory.
|
|
173
188
|
</p>
|
174
189
|
<h2>License</h2>
|
175
190
|
<p>
|
176
|
-
|
191
|
+
LGPL version 2.1
|
192
|
+
</p>
|
193
|
+
<p>
|
194
|
+
If you need looser license, please suggest me.
|
177
195
|
</p>
|
178
196
|
<h2>Author</h2>
|
179
197
|
<p>
|