erubis 2.0.1 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. data/ChangeLog +150 -2
  2. data/LGPL +504 -0
  3. data/README.txt +14 -8
  4. data/benchmark/erubybench.rb +1 -1
  5. data/benchmark/erubybench.rhtml +3 -3
  6. data/bin/erubis +1 -1
  7. data/bin/notext +154 -0
  8. data/contrib/erubis +1036 -374
  9. data/contrib/inline-require +5 -3
  10. data/doc-api/classes/Erubis.html +43 -1
  11. data/doc-api/classes/Erubis/ArrayBufferEnhancer.html +14 -14
  12. data/doc-api/classes/Erubis/ArrayEnhancer.html +14 -14
  13. data/doc-api/classes/Erubis/Basic.html +112 -0
  14. data/doc-api/classes/Erubis/Basic/Converter.html +318 -0
  15. data/doc-api/classes/Erubis/Basic/Engine.html +130 -0
  16. data/doc-api/classes/Erubis/BiPatternEnhancer.html +14 -14
  17. data/doc-api/classes/Erubis/CGenerator.html +386 -0
  18. data/doc-api/classes/Erubis/Context.html +31 -32
  19. data/doc-api/classes/Erubis/Converter.html +231 -0
  20. data/doc-api/classes/Erubis/Ec.html +9 -283
  21. data/doc-api/classes/Erubis/Ejava.html +9 -274
  22. data/doc-api/classes/Erubis/Ejavascript.html +9 -298
  23. data/doc-api/classes/Erubis/Engine.html +68 -508
  24. data/doc-api/classes/Erubis/Eperl.html +9 -259
  25. data/doc-api/classes/Erubis/Ephp.html +9 -239
  26. data/doc-api/classes/Erubis/ErubisError.html +2 -2
  27. data/doc-api/classes/Erubis/Eruby.html +4 -187
  28. data/doc-api/classes/Erubis/EscapeEnhancer.html +9 -11
  29. data/doc-api/classes/Erubis/Escheme.html +9 -272
  30. data/doc-api/classes/Erubis/Evaluator.html +212 -0
  31. data/doc-api/classes/Erubis/Generator.html +410 -0
  32. data/doc-api/classes/Erubis/HeaderFooterEnhancer.html +16 -16
  33. data/doc-api/classes/Erubis/Helper.html +112 -0
  34. data/doc-api/classes/Erubis/Helper/CachedRailsTemplate.html +198 -0
  35. data/doc-api/classes/Erubis/Helper/RailsTemplate.html +366 -0
  36. data/doc-api/classes/Erubis/JavaGenerator.html +359 -0
  37. data/doc-api/classes/Erubis/JavascriptGenerator.html +381 -0
  38. data/doc-api/classes/Erubis/Main.html +27 -25
  39. data/doc-api/classes/Erubis/NoCodeEnhancer.html +249 -0
  40. data/doc-api/classes/Erubis/NoCodeEruby.html +120 -0
  41. data/doc-api/classes/Erubis/NoTextEnhancer.html +8 -8
  42. data/doc-api/classes/Erubis/NotSupportedError.html +119 -0
  43. data/doc-api/classes/Erubis/OptimizedEruby.html +22 -304
  44. data/doc-api/classes/Erubis/OptimizedGenerator.html +439 -0
  45. data/doc-api/classes/Erubis/OptimizedXmlEruby.html +7 -7
  46. data/doc-api/classes/Erubis/PI.html +124 -0
  47. data/doc-api/classes/Erubis/PI/Converter.html +318 -0
  48. data/doc-api/classes/Erubis/PI/Ec.html +166 -0
  49. data/doc-api/classes/Erubis/PI/Ejava.html +166 -0
  50. data/doc-api/classes/Erubis/PI/Ejavascript.html +166 -0
  51. data/doc-api/classes/Erubis/PI/Engine.html +122 -0
  52. data/doc-api/classes/Erubis/PI/Eperl.html +166 -0
  53. data/doc-api/classes/Erubis/PI/Ephp.html +166 -0
  54. data/doc-api/classes/Erubis/PI/Eruby.html +155 -0
  55. data/doc-api/classes/Erubis/PI/Escheme.html +166 -0
  56. data/doc-api/classes/Erubis/PI/TinyEruby.html +305 -0
  57. data/doc-api/classes/Erubis/PercentLineEnhancer.html +7 -7
  58. data/doc-api/classes/Erubis/PerlGenerator.html +344 -0
  59. data/doc-api/classes/Erubis/PhpGenerator.html +350 -0
  60. data/doc-api/classes/Erubis/PrintEnabledEnhancer.html +24 -24
  61. data/doc-api/classes/Erubis/PrintOutEnhancer.html +35 -35
  62. data/doc-api/classes/Erubis/RubyEvaluator.html +190 -0
  63. data/doc-api/classes/Erubis/RubyGenerator.html +327 -0
  64. data/doc-api/classes/Erubis/SchemeGenerator.html +382 -0
  65. data/doc-api/classes/Erubis/SimplifyEnhancer.html +17 -13
  66. data/doc-api/classes/Erubis/StdoutEnhancer.html +14 -14
  67. data/doc-api/classes/Erubis/StringBufferEnhancer.html +14 -14
  68. data/doc-api/classes/Erubis/TinyEruby.html +45 -40
  69. data/doc-api/classes/Erubis/XmlHelper.html +14 -14
  70. data/doc-api/created.rid +1 -1
  71. data/doc-api/files/__/README_txt.html +27 -9
  72. data/doc-api/files/erubis/context_rb.html +107 -0
  73. data/doc-api/files/erubis/converter_rb.html +114 -0
  74. data/doc-api/files/erubis/engine/ec_rb.html +2 -2
  75. data/doc-api/files/erubis/engine/ejava_rb.html +2 -2
  76. data/doc-api/files/erubis/engine/ejavascript_rb.html +2 -2
  77. data/doc-api/files/erubis/engine/enhanced_rb.html +2 -2
  78. data/doc-api/files/erubis/engine/eperl_rb.html +2 -2
  79. data/doc-api/files/erubis/engine/ephp_rb.html +2 -2
  80. data/doc-api/files/erubis/engine/eruby_rb.html +3 -2
  81. data/doc-api/files/erubis/engine/escheme_rb.html +2 -2
  82. data/doc-api/files/erubis/engine/optimized_rb.html +2 -2
  83. data/doc-api/files/erubis/engine_rb.html +6 -3
  84. data/doc-api/files/erubis/enhancer_rb.html +2 -9
  85. data/doc-api/files/erubis/error_rb.html +107 -0
  86. data/doc-api/files/erubis/evaluator_rb.html +115 -0
  87. data/doc-api/files/erubis/generator_rb.html +114 -0
  88. data/doc-api/files/erubis/helper/rails_rb.html +140 -0
  89. data/doc-api/files/erubis/helper_rb.html +1 -1
  90. data/doc-api/files/erubis/local-setting_rb.html +1 -1
  91. data/doc-api/files/erubis/main_rb.html +2 -2
  92. data/doc-api/files/erubis/tiny_rb.html +2 -2
  93. data/doc-api/files/erubis_rb.html +2 -2
  94. data/doc-api/fr_class_index.html +32 -0
  95. data/doc-api/fr_file_index.html +6 -0
  96. data/doc-api/fr_method_index.html +178 -136
  97. data/doc/users-guide.html +538 -199
  98. data/examples/{Makefile → basic/Makefile} +11 -11
  99. data/examples/basic/example.ec +42 -0
  100. data/examples/{example.ejava → basic/example.ejava} +5 -1
  101. data/examples/{example.ejavascript → basic/example.ejs} +0 -0
  102. data/examples/{example.eperl → basic/example.eperl} +2 -2
  103. data/examples/{example.ephp → basic/example.ephp} +0 -0
  104. data/examples/{example.eruby → basic/example.eruby} +0 -0
  105. data/examples/{example.escheme → basic/example.escheme} +0 -0
  106. data/examples/pi/Makefile +54 -0
  107. data/examples/pi/example.ec +42 -0
  108. data/examples/pi/example.ejava +45 -0
  109. data/examples/pi/example.ejs +16 -0
  110. data/examples/pi/example.eperl +16 -0
  111. data/examples/pi/example.ephp +17 -0
  112. data/examples/pi/example.eruby +15 -0
  113. data/examples/pi/example.escheme +26 -0
  114. data/lib/erubis.rb +15 -8
  115. data/lib/erubis/context.rb +54 -0
  116. data/lib/erubis/converter.rb +307 -0
  117. data/lib/erubis/engine.rb +57 -227
  118. data/lib/erubis/engine/ec.rb +31 -20
  119. data/lib/erubis/engine/ejava.rb +33 -21
  120. data/lib/erubis/engine/ejavascript.rb +30 -18
  121. data/lib/erubis/engine/enhanced.rb +7 -2
  122. data/lib/erubis/engine/eperl.rb +33 -19
  123. data/lib/erubis/engine/ephp.rb +32 -14
  124. data/lib/erubis/engine/eruby.rb +34 -7
  125. data/lib/erubis/engine/escheme.rb +34 -15
  126. data/lib/erubis/engine/optimized.rb +25 -11
  127. data/lib/erubis/enhancer.rb +53 -19
  128. data/lib/erubis/error.rb +24 -0
  129. data/lib/erubis/evaluator.rb +71 -0
  130. data/lib/erubis/generator.rb +83 -0
  131. data/lib/erubis/helper.rb +1 -1
  132. data/lib/erubis/helper/rails.rb +159 -0
  133. data/lib/erubis/local-setting.rb +1 -1
  134. data/lib/erubis/main.rb +87 -46
  135. data/lib/erubis/tiny.rb +81 -7
  136. data/test/assert-text-equal.rb +1 -1
  137. data/test/test-engines.rb +8 -9
  138. data/test/test-erubis.rb +196 -18
  139. data/test/{test-bin.rb → test-main.rb} +123 -21
  140. data/test/test-notext.rb +27 -0
  141. data/test/test.rb +5 -3
  142. data/test/testutil.rb +25 -36
  143. metadata +75 -13
  144. data/COPYING +0 -340
  145. 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="#M000005">add_postamble</a>&nbsp;&nbsp;
93
- <a href="#M000004">add_preamble</a>&nbsp;&nbsp;
92
+ <a href="#M000062">add_postamble</a>&nbsp;&nbsp;
93
+ <a href="#M000061">add_preamble</a>&nbsp;&nbsp;
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-M000005" class="method-detail">
116
- <a name="M000005"></a>
115
+ <div id="method-M000062" class="method-detail">
116
+ <a name="M000062"></a>
117
117
 
118
118
  <div class="method-heading">
119
- <a href="#M000005" class="method-signature">
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('M000005-source');return false;">[Source]</a></p>
127
- <div class="method-source-code" id="M000005-source">
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 79</span>
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">&lt;&lt;</span> <span class="ruby-value str">&quot;\n''\n&quot;</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-M000004" class="method-detail">
139
- <a name="M000004"></a>
138
+ <div id="method-M000061" class="method-detail">
139
+ <a name="M000061"></a>
140
140
 
141
141
  <div class="method-heading">
142
- <a href="#M000004" class="method-signature">
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('M000004-source');return false;">[Source]</a></p>
150
- <div class="method-source-code" id="M000004-source">
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 75</span>
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">&lt;&lt;</span> <span class="ruby-value str">&quot;_buf = $stdout;&quot;</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="#M000027">add_postamble</a>&nbsp;&nbsp;
93
- <a href="#M000026">add_preamble</a>&nbsp;&nbsp;
92
+ <a href="#M000159">add_postamble</a>&nbsp;&nbsp;
93
+ <a href="#M000158">add_preamble</a>&nbsp;&nbsp;
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-M000027" class="method-detail">
116
- <a name="M000027"></a>
115
+ <div id="method-M000159" class="method-detail">
116
+ <a name="M000159"></a>
117
117
 
118
118
  <div class="method-heading">
119
- <a href="#M000027" class="method-signature">
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('M000027-source');return false;">[Source]</a></p>
127
- <div class="method-source-code" id="M000027-source">
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 220</span>
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">&lt;&lt;</span> <span class="ruby-value str">&quot;\n&quot;</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">&lt;&lt;</span> <span class="ruby-value str">&quot;_buf\n&quot;</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-M000026" class="method-detail">
140
- <a name="M000026"></a>
139
+ <div id="method-M000158" class="method-detail">
140
+ <a name="M000158"></a>
141
141
 
142
142
  <div class="method-heading">
143
- <a href="#M000026" class="method-signature">
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('M000026-source');return false;">[Source]</a></p>
151
- <div class="method-source-code" id="M000026-source">
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 216</span>
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">&lt;&lt;</span> <span class="ruby-value str">&quot;_buf = '';&quot;</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="#M000059">compile</a>&nbsp;&nbsp;
105
- <a href="#M000060">escape_text</a>&nbsp;&nbsp;
106
- <a href="#M000062">evaluate</a>&nbsp;&nbsp;
107
- <a href="#M000058">new</a>&nbsp;&nbsp;
108
- <a href="#M000061">result</a>&nbsp;&nbsp;
104
+ <a href="#M000161">convert</a>&nbsp;&nbsp;
105
+ <a href="#M000162">escape_text</a>&nbsp;&nbsp;
106
+ <a href="#M000164">evaluate</a>&nbsp;&nbsp;
107
+ <a href="#M000160">new</a>&nbsp;&nbsp;
108
+ <a href="#M000163">result</a>&nbsp;&nbsp;
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">/(.*?)&lt;%(=+|\#)?(.*?)-?%&gt;/m</td>
128
+ <td class="context-item-value">/&lt;%(=+|\#)?(.*?)-?%&gt;/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-M000058" class="method-detail">
157
- <a name="M000058"></a>
156
+ <div id="method-M000160" class="method-detail">
157
+ <a name="M000160"></a>
158
158
 
159
159
  <div class="method-heading">
160
- <a href="#M000058" class="method-signature">
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('M000058-source');return false;">[Source]</a></p>
168
- <div class="method-source-code" id="M000058-source">
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">compile</span>(<span class="ruby-identifier">input</span>)
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-M000059" class="method-detail">
182
- <a name="M000059"></a>
181
+ <div id="method-M000161" class="method-detail">
182
+ <a name="M000161"></a>
183
183
 
184
184
  <div class="method-heading">
185
- <a href="#M000059" class="method-signature">
186
- <span class="method-name">compile</span><span class="method-args">(input)</span>
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('M000059-source');return false;">[Source]</a></p>
193
- <div class="method-source-code" id="M000059-source">
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">compile</span>(<span class="ruby-identifier">input</span>)
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">&quot;_buf = [];&quot;</span> <span class="ruby-comment cmt"># preamble</span>
198
- <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">text</span>, <span class="ruby-identifier">indicator</span>, <span class="ruby-identifier">code</span><span class="ruby-operator">|</span>
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">&lt;&lt;</span> <span class="ruby-value str">&quot; _buf &lt;&lt; '&quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">escape_text</span>(<span class="ruby-identifier">text</span>) <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;';&quot;</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"># &lt;% %&gt;</span>
201
206
  <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">code</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;;&quot;</span>
@@ -216,21 +221,21 @@ ex.
216
221
  </div>
217
222
  </div>
218
223
 
219
- <div id="method-M000060" class="method-detail">
220
- <a name="M000060"></a>
224
+ <div id="method-M000162" class="method-detail">
225
+ <a name="M000162"></a>
221
226
 
222
227
  <div class="method-heading">
223
- <a href="#M000060" class="method-signature">
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('M000060-source');return false;">[Source]</a></p>
231
- <div class="method-source-code" id="M000060-source">
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 46</span>
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">'\\\\\&amp;'</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-M000062" class="method-detail">
243
- <a name="M000062"></a>
247
+ <div id="method-M000164" class="method-detail">
248
+ <a name="M000164"></a>
244
249
 
245
250
  <div class="method-heading">
246
- <a href="#M000062" class="method-signature">
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('M000062-source');return false;">[Source]</a></p>
254
- <div class="method-source-code" id="M000062-source">
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 54</span>
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-M000061" class="method-detail">
271
- <a name="M000061"></a>
275
+ <div id="method-M000163" class="method-detail">
276
+ <a name="M000163"></a>
272
277
 
273
278
  <div class="method-heading">
274
- <a href="#M000061" class="method-signature">
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('M000061-source');return false;">[Source]</a></p>
282
- <div class="method-source-code" id="M000061-source">
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 50</span>
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="#M000006">escape_xml</a>&nbsp;&nbsp;
90
- <a href="#M000007">h</a>&nbsp;&nbsp;
91
- <a href="#M000008">html_escape</a>&nbsp;&nbsp;
89
+ <a href="#M000075">escape_xml</a>&nbsp;&nbsp;
90
+ <a href="#M000076">h</a>&nbsp;&nbsp;
91
+ <a href="#M000077">html_escape</a>&nbsp;&nbsp;
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-M000006" class="method-detail">
127
- <a name="M000006"></a>
126
+ <div id="method-M000075" class="method-detail">
127
+ <a name="M000075"></a>
128
128
 
129
129
  <div class="method-heading">
130
- <a href="#M000006" class="method-signature">
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('M000006-source');return false;">[Source]</a></p>
138
- <div class="method-source-code" id="M000006-source">
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-M000007" class="method-detail">
154
- <a name="M000007"></a>
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#M000006">escape_xml</a>
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-M000008" class="method-detail">
168
- <a name="M000008"></a>
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#M000006">escape_xml</a>
176
+ Alias for <a href="XmlHelper.html#M000075">escape_xml</a>
177
177
  </p>
178
178
  </div>
179
179
  </div>
@@ -1 +1 @@
1
- Sun May 21 17:27:38 JST 2006
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>Fri May 19 18:57:42 JST 2006</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.1 $
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 (about three times faster than ERB and almost as fast as eruby)
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 &#8217;&lt;% %&gt;&#8217;
91
97
 
92
98
  </li>
93
- <li>Auto escape (sanitizing)
99
+ <li>Embedded pattern changeable (default &#8217;&lt;% %&gt;&#8217;)
94
100
 
95
101
  </li>
96
- <li>Changeable embedded pattern (default &#8217;&lt;% %&gt;&#8217;)
102
+ <li>Enable to handle Processing Instructions (PI) as embedded pattern (ex.
103
+ &#8217;&lt;?rb &#8230; ?&gt;&#8217;)
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>Easy to expand and customize in subclass
110
+ <li>Print statement available
103
111
 
104
112
  </li>
105
- <li>Multi-language support (Ruby/PHP/C/Java/Scheme/Perl/Javascript)
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) &#8212; engine class for eRuby.
165
176
 
177
+ </li>
178
+ <li><a href="../../classes/Erubis/Converter.html">Erubis::Converter</a>
179
+ (erubis/converter.rb) &#8212; convert eRuby script into Ruby code.
180
+
166
181
  </li>
167
182
  </ul>
168
183
  <h2>Benchmark</h2>
@@ -173,7 +188,10 @@ erubybenchmark.rb&#8217; in benchmark directory.
173
188
  </p>
174
189
  <h2>License</h2>
175
190
  <p>
176
- GPL ver.2
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>