erubis 2.2.0 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (220) hide show
  1. data/CHANGES +120 -3
  2. data/README.txt +1 -1
  3. data/benchmark/Makefile +6 -0
  4. data/benchmark/bench.rb +306 -0
  5. data/benchmark/{erubybench.yaml → bench_context.yaml} +20 -20
  6. data/benchmark/templates/_footer.html +4 -0
  7. data/benchmark/{erubybench.rhtml → templates/_header.html} +1 -34
  8. data/benchmark/templates/bench_erb.rhtml +29 -0
  9. data/benchmark/templates/bench_erubis.rhtml +29 -0
  10. data/benchmark/templates/bench_eruby.rhtml +29 -0
  11. data/bin/erubis +2 -2
  12. data/contrib/erubis +3 -3114
  13. data/contrib/erubis-run.rb +132 -0
  14. data/contrib/inline-require +1 -1
  15. data/doc-api/classes/{ERB.html → ActionView/Base/ERB.html} +3 -3
  16. data/doc-api/classes/Erubis.html +8 -1
  17. data/doc-api/classes/Erubis/ArrayEnhancer.html +12 -12
  18. data/doc-api/classes/Erubis/Basic/Converter.html +24 -24
  19. data/doc-api/classes/Erubis/BiPatternEnhancer.html +14 -14
  20. data/doc-api/classes/Erubis/CGenerator.html +60 -60
  21. data/doc-api/classes/Erubis/Context.html +42 -42
  22. data/doc-api/classes/Erubis/Converter.html +27 -27
  23. data/doc-api/classes/Erubis/DeleteIndentEnhancer.html +150 -0
  24. data/doc-api/classes/Erubis/DeleteIndentEruby.html +120 -0
  25. data/doc-api/classes/Erubis/Engine.html +31 -31
  26. data/doc-api/classes/Erubis/ErboutEnhancer.html +175 -0
  27. data/doc-api/classes/Erubis/ErboutEruby.html +120 -0
  28. data/doc-api/classes/Erubis/Eruby.html +5 -0
  29. data/doc-api/classes/Erubis/EscapeEnhancer.html +6 -6
  30. data/doc-api/classes/Erubis/Evaluator.html +19 -19
  31. data/doc-api/classes/Erubis/FastEruby.html +131 -0
  32. data/doc-api/classes/Erubis/HeaderFooterEnhancer.html +14 -14
  33. data/doc-api/classes/Erubis/Helpers/RailsHelper.html +49 -45
  34. data/doc-api/classes/Erubis/InterpolationEnhancer.html +304 -0
  35. data/doc-api/classes/Erubis/InterpolationEruby.html +120 -0
  36. data/doc-api/classes/Erubis/JavaGenerator.html +54 -54
  37. data/doc-api/classes/Erubis/JavascriptGenerator.html +60 -60
  38. data/doc-api/classes/Erubis/Main.html +35 -27
  39. data/doc-api/classes/Erubis/NoCodeEnhancer.html +5 -5
  40. data/doc-api/classes/Erubis/NoTextEnhancer.html +7 -7
  41. data/doc-api/classes/Erubis/OptimizedEruby.html +6 -6
  42. data/doc-api/classes/Erubis/OptimizedGenerator.html +72 -72
  43. data/doc-api/classes/Erubis/OptimizedXmlEruby.html +6 -6
  44. data/doc-api/classes/Erubis/PI/Converter.html +18 -18
  45. data/doc-api/classes/Erubis/PI/Ec.html +6 -6
  46. data/doc-api/classes/Erubis/PI/Ejava.html +6 -6
  47. data/doc-api/classes/Erubis/PI/Ejavascript.html +6 -6
  48. data/doc-api/classes/Erubis/PI/Eperl.html +6 -6
  49. data/doc-api/classes/Erubis/PI/Ephp.html +6 -6
  50. data/doc-api/classes/Erubis/PI/Eruby.html +7 -7
  51. data/doc-api/classes/Erubis/PI/Escheme.html +6 -6
  52. data/doc-api/classes/Erubis/PI/TinyEruby.html +24 -24
  53. data/doc-api/classes/Erubis/PercentLineEnhancer.html +8 -8
  54. data/doc-api/classes/Erubis/PerlGenerator.html +54 -54
  55. data/doc-api/classes/Erubis/PhpGenerator.html +54 -54
  56. data/doc-api/classes/Erubis/PrintEnabledEnhancer.html +20 -20
  57. data/doc-api/classes/Erubis/PrintOutEnhancer.html +30 -30
  58. data/doc-api/classes/Erubis/RubyEvaluator.html +12 -12
  59. data/doc-api/classes/Erubis/RubyGenerator.html +48 -48
  60. data/doc-api/classes/Erubis/SchemeGenerator.html +60 -60
  61. data/doc-api/classes/Erubis/SimplifyEnhancer.html +8 -8
  62. data/doc-api/classes/Erubis/StdoutEnhancer.html +12 -12
  63. data/doc-api/classes/Erubis/StringBufferEnhancer.html +12 -12
  64. data/doc-api/classes/Erubis/TinyEruby.html +24 -24
  65. data/doc-api/classes/Erubis/XmlHelper.html +14 -14
  66. data/doc-api/created.rid +1 -1
  67. data/doc-api/files/README_txt.html +4 -4
  68. data/doc-api/files/erubis/context_rb.html +2 -2
  69. data/doc-api/files/erubis/converter_rb.html +2 -2
  70. data/doc-api/files/erubis/engine/ec_rb.html +2 -2
  71. data/doc-api/files/erubis/engine/ejava_rb.html +2 -2
  72. data/doc-api/files/erubis/engine/ejavascript_rb.html +2 -2
  73. data/doc-api/files/erubis/engine/enhanced_rb.html +2 -2
  74. data/doc-api/files/erubis/engine/eperl_rb.html +2 -2
  75. data/doc-api/files/erubis/engine/ephp_rb.html +2 -2
  76. data/doc-api/files/erubis/engine/eruby_rb.html +2 -2
  77. data/doc-api/files/erubis/engine/escheme_rb.html +2 -2
  78. data/doc-api/files/erubis/engine/optimized_rb.html +2 -2
  79. data/doc-api/files/erubis/engine_rb.html +2 -2
  80. data/doc-api/files/erubis/enhancer_rb.html +2 -2
  81. data/doc-api/files/erubis/error_rb.html +2 -2
  82. data/doc-api/files/erubis/evaluator_rb.html +2 -2
  83. data/doc-api/files/erubis/generator_rb.html +2 -2
  84. data/doc-api/files/erubis/helper_rb.html +2 -2
  85. data/doc-api/files/erubis/helpers/rails_helper_rb.html +2 -2
  86. data/doc-api/files/erubis/local-setting_rb.html +2 -2
  87. data/doc-api/files/erubis/main_rb.html +2 -2
  88. data/doc-api/files/erubis/tiny_rb.html +2 -2
  89. data/doc-api/files/erubis_rb.html +1 -1
  90. data/doc-api/fr_class_index.html +8 -1
  91. data/doc-api/fr_method_index.html +166 -158
  92. data/doc/users-guide.html +623 -215
  93. data/lib/erubis.rb +2 -2
  94. data/lib/erubis/context.rb +2 -2
  95. data/lib/erubis/converter.rb +2 -2
  96. data/lib/erubis/engine.rb +3 -3
  97. data/lib/erubis/engine/ec.rb +2 -2
  98. data/lib/erubis/engine/ejava.rb +2 -2
  99. data/lib/erubis/engine/ejavascript.rb +2 -2
  100. data/lib/erubis/engine/enhanced.rb +17 -2
  101. data/lib/erubis/engine/eperl.rb +2 -2
  102. data/lib/erubis/engine/ephp.rb +2 -2
  103. data/lib/erubis/engine/eruby.rb +10 -2
  104. data/lib/erubis/engine/escheme.rb +2 -2
  105. data/lib/erubis/engine/optimized.rb +2 -2
  106. data/lib/erubis/enhancer.rb +134 -25
  107. data/lib/erubis/error.rb +2 -2
  108. data/lib/erubis/evaluator.rb +2 -2
  109. data/lib/erubis/generator.rb +2 -2
  110. data/lib/erubis/helper.rb +2 -2
  111. data/lib/erubis/helpers/rails_helper.rb +19 -75
  112. data/lib/erubis/local-setting.rb +2 -2
  113. data/lib/erubis/main.rb +63 -36
  114. data/lib/erubis/tiny.rb +2 -2
  115. data/test/assert-text-equal.rb +2 -2
  116. data/test/data/users-guide/Example.ejava +55 -0
  117. data/test/data/users-guide/array_example.result +9 -0
  118. data/test/data/users-guide/arraybuffer_example.result +9 -0
  119. data/test/data/users-guide/bipattern-example.rhtml +4 -0
  120. data/test/data/users-guide/bipattern_example.result +6 -0
  121. data/test/data/users-guide/context.rb +6 -0
  122. data/test/data/users-guide/context.yaml +8 -0
  123. data/test/data/users-guide/escape_example.result +9 -0
  124. data/test/data/users-guide/example.ec +27 -0
  125. data/test/data/users-guide/example.ejs +20 -0
  126. data/test/data/users-guide/example.eperl +18 -0
  127. data/test/data/users-guide/example.ephp +18 -0
  128. data/test/data/users-guide/example.eruby +6 -0
  129. data/test/data/users-guide/example.escheme +28 -0
  130. data/test/data/users-guide/example1.eruby +6 -0
  131. data/test/data/users-guide/example1.rb +16 -0
  132. data/test/data/users-guide/example1.result +16 -0
  133. data/test/data/users-guide/example10.rb +4 -0
  134. data/test/data/users-guide/example10.result +17 -0
  135. data/test/data/users-guide/example10.xhtml +14 -0
  136. data/test/data/users-guide/example10_x.result +17 -0
  137. data/test/data/users-guide/example11.php +20 -0
  138. data/test/data/users-guide/example11.result +23 -0
  139. data/test/data/users-guide/example11.rhtml +21 -0
  140. data/test/data/users-guide/example11_C.result +10 -0
  141. data/test/data/users-guide/example11_N.result +16 -0
  142. data/test/data/users-guide/example11_U.result +16 -0
  143. data/test/data/users-guide/example11_php.result +15 -0
  144. data/test/data/users-guide/example1_x.result +9 -0
  145. data/test/data/users-guide/example2.eruby +7 -0
  146. data/test/data/users-guide/example2.rb +10 -0
  147. data/test/data/users-guide/example2.result +27 -0
  148. data/test/data/users-guide/example2_trim.result +10 -0
  149. data/test/data/users-guide/example2_x.result +10 -0
  150. data/test/data/users-guide/example3.eruby +6 -0
  151. data/test/data/users-guide/example3.rb +10 -0
  152. data/test/data/users-guide/example31.result +22 -0
  153. data/test/data/users-guide/example32.result +4 -0
  154. data/test/data/users-guide/example3_e.result +8 -0
  155. data/test/data/users-guide/example4.eruby +3 -0
  156. data/test/data/users-guide/example4.rb +11 -0
  157. data/test/data/users-guide/example4.result +10 -0
  158. data/test/data/users-guide/example4_x.result +5 -0
  159. data/test/data/users-guide/example5.eruby +6 -0
  160. data/test/data/users-guide/example5.rb +16 -0
  161. data/test/data/users-guide/example5.result +7 -0
  162. data/test/data/users-guide/example6.rb +12 -0
  163. data/test/data/users-guide/example6.result +7 -0
  164. data/test/data/users-guide/example7.eruby +8 -0
  165. data/test/data/users-guide/example71.result +13 -0
  166. data/test/data/users-guide/example72.result +13 -0
  167. data/test/data/users-guide/example8.eruby +6 -0
  168. data/test/data/users-guide/example8_ruby.result +7 -0
  169. data/test/data/users-guide/example8_yaml.result +7 -0
  170. data/test/data/users-guide/example9.eruby +3 -0
  171. data/test/data/users-guide/example9.rb +8 -0
  172. data/test/data/users-guide/example9.result +9 -0
  173. data/test/data/users-guide/example91.result +5 -0
  174. data/test/data/users-guide/example92.result +4 -0
  175. data/test/data/users-guide/example_c.result +29 -0
  176. data/test/data/users-guide/example_java.result +56 -0
  177. data/test/data/users-guide/example_js.result +22 -0
  178. data/test/data/users-guide/example_perl.result +20 -0
  179. data/test/data/users-guide/example_php.result +19 -0
  180. data/test/data/users-guide/example_scheme.result +30 -0
  181. data/test/data/users-guide/example_scheme_display.result +29 -0
  182. data/test/data/users-guide/fasteruby.rb +11 -0
  183. data/test/data/users-guide/fasteruby.result +38 -0
  184. data/test/data/users-guide/fasteruby.rhtml +15 -0
  185. data/test/data/users-guide/headerfooter-example.eruby +9 -0
  186. data/test/data/users-guide/headerfooter-example2.rb +8 -0
  187. data/test/data/users-guide/headerfooter-example2.rhtml +10 -0
  188. data/test/data/users-guide/headerfooter_example.result +11 -0
  189. data/test/data/users-guide/headerfooter_example2.result +13 -0
  190. data/test/data/users-guide/interpolation_example.result +9 -0
  191. data/test/data/users-guide/nocode-example.eruby +14 -0
  192. data/test/data/users-guide/nocode-php.result +20 -0
  193. data/test/data/users-guide/nocode_example.result +15 -0
  194. data/test/data/users-guide/normal-eruby-test.eruby +9 -0
  195. data/test/data/users-guide/normal_eruby_test.result +11 -0
  196. data/test/data/users-guide/notext-example.eruby +14 -0
  197. data/test/data/users-guide/notext-example.php +19 -0
  198. data/test/data/users-guide/notext-php.result +20 -0
  199. data/test/data/users-guide/notext_example.result +16 -0
  200. data/test/data/users-guide/percentline-example.rhtml +4 -0
  201. data/test/data/users-guide/percentline_example.result +7 -0
  202. data/test/data/users-guide/printenable_example.result +4 -0
  203. data/test/data/users-guide/printenabled-example.eruby +3 -0
  204. data/test/data/users-guide/printenabled-example.rb +8 -0
  205. data/test/data/users-guide/printstatement_example.result +8 -0
  206. data/test/data/users-guide/simplify_example.result +9 -0
  207. data/test/data/users-guide/stdout_exmple.result +9 -0
  208. data/test/data/users-guide/stringbuffer_example.result +9 -0
  209. data/test/test-engines.rb +2 -2
  210. data/test/test-enhancers.rb +569 -0
  211. data/test/test-erubis.rb +3 -380
  212. data/test/test-main.rb +39 -15
  213. data/test/test-users-guide.rb +56 -0
  214. data/test/test.rb +4 -3
  215. data/test/testutil.rb +2 -2
  216. metadata +166 -57
  217. data/benchmark/erubybench-lib.rb +0 -189
  218. data/benchmark/erubybench.rb +0 -600
  219. data/bin/notext +0 -154
  220. data/test/test-notext.rb +0 -27
@@ -139,8 +139,8 @@ this is language-independent.
139
139
  <h3 class="section-bar">Methods</h3>
140
140
 
141
141
  <div class="name-list">
142
- <a href="#M000082">add_text</a>&nbsp;&nbsp;
143
- <a href="#M000083">convert</a>&nbsp;&nbsp;
142
+ <a href="#M000087">add_text</a>&nbsp;&nbsp;
143
+ <a href="#M000088">convert</a>&nbsp;&nbsp;
144
144
  </div>
145
145
  </div>
146
146
 
@@ -193,21 +193,21 @@ this is language-independent.
193
193
  <div id="methods">
194
194
  <h3 class="section-bar">Public Instance methods</h3>
195
195
 
196
- <div id="method-M000082" class="method-detail">
197
- <a name="M000082"></a>
196
+ <div id="method-M000087" class="method-detail">
197
+ <a name="M000087"></a>
198
198
 
199
199
  <div class="method-heading">
200
- <a href="#M000082" class="method-signature">
200
+ <a href="#M000087" class="method-signature">
201
201
  <span class="method-name">add_text</span><span class="method-args">(src, text)</span>
202
202
  </a>
203
203
  </div>
204
204
 
205
205
  <div class="method-description">
206
206
  <p><a class="source-toggle" href="#"
207
- onclick="toggleCode('M000082-source');return false;">[Source]</a></p>
208
- <div class="method-source-code" id="M000082-source">
207
+ onclick="toggleCode('M000087-source');return false;">[Source]</a></p>
208
+ <div class="method-source-code" id="M000087-source">
209
209
  <pre>
210
- <span class="ruby-comment cmt"># File erubis/enhancer.rb, line 524</span>
210
+ <span class="ruby-comment cmt"># File erubis/enhancer.rb, line 522</span>
211
211
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_text</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">text</span>)
212
212
  <span class="ruby-identifier">text</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-constant">HEADER_FOOTER_PATTERN</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">txt</span>, <span class="ruby-identifier">lspace</span>, <span class="ruby-identifier">word</span>, <span class="ruby-identifier">content</span>, <span class="ruby-identifier">rspace</span><span class="ruby-operator">|</span>
213
213
  <span class="ruby-identifier">flag_trim</span> = <span class="ruby-ivar">@trim</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">lspace</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">rspace</span>
@@ -225,21 +225,21 @@ this is language-independent.
225
225
  </div>
226
226
  </div>
227
227
 
228
- <div id="method-M000083" class="method-detail">
229
- <a name="M000083"></a>
228
+ <div id="method-M000088" class="method-detail">
229
+ <a name="M000088"></a>
230
230
 
231
231
  <div class="method-heading">
232
- <a href="#M000083" class="method-signature">
232
+ <a href="#M000088" class="method-signature">
233
233
  <span class="method-name">convert</span><span class="method-args">(input)</span>
234
234
  </a>
235
235
  </div>
236
236
 
237
237
  <div class="method-description">
238
238
  <p><a class="source-toggle" href="#"
239
- onclick="toggleCode('M000083-source');return false;">[Source]</a></p>
240
- <div class="method-source-code" id="M000083-source">
239
+ onclick="toggleCode('M000088-source');return false;">[Source]</a></p>
240
+ <div class="method-source-code" id="M000088-source">
241
241
  <pre>
242
- <span class="ruby-comment cmt"># File erubis/enhancer.rb, line 539</span>
242
+ <span class="ruby-comment cmt"># File erubis/enhancer.rb, line 537</span>
243
243
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">convert</span>(<span class="ruby-identifier">input</span>)
244
244
  <span class="ruby-identifier">source</span> = <span class="ruby-keyword kw">super</span>
245
245
  <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@src</span> = <span class="ruby-node">&quot;#{@header}#{source}#{@footer}&quot;</span>
@@ -84,15 +84,15 @@ howto:
84
84
 
85
85
  <pre>
86
86
  require 'erubis/helpers/rails_helper'
87
- #Erubis::Helpers::RailsHelper.engine_class = Erubis::Eruby
87
+ #Erubis::Helpers::RailsHelper.engine_class = Erubis::Eruby # or Erubis::FastEruby
88
88
  #Erubis::Helpers::RailsHelper.init_properties = {}
89
- #Erubis::Helpers::RailsHelper.show_src = false
89
+ #Erubis::Helpers::RailsHelper.show_src = false # set true for debugging
90
90
  </pre>
91
91
  </li>
92
92
  <li>(optional) apply the patch for &#8216;action_view/base.rb&#8216;
93
93
 
94
94
  <pre>
95
- $ cd /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.1/lib/action_view/
95
+ $ cd /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/
96
96
  $ sudo patch -p1 &lt; /tmp/erubis_2.X.X/contrib/action_view_base_rb.patch
97
97
  </pre>
98
98
  </li>
@@ -116,12 +116,12 @@ debug.
116
116
  <h3 class="section-bar">Methods</h3>
117
117
 
118
118
  <div class="name-list">
119
- <a href="#M000073">engine_class</a>&nbsp;&nbsp;
120
- <a href="#M000074">engine_class=</a>&nbsp;&nbsp;
121
- <a href="#M000075">init_properties</a>&nbsp;&nbsp;
122
- <a href="#M000076">init_properties=</a>&nbsp;&nbsp;
123
- <a href="#M000077">show_src</a>&nbsp;&nbsp;
124
- <a href="#M000078">show_src=</a>&nbsp;&nbsp;
119
+ <a href="#M000078">engine_class</a>&nbsp;&nbsp;
120
+ <a href="#M000079">engine_class=</a>&nbsp;&nbsp;
121
+ <a href="#M000080">init_properties</a>&nbsp;&nbsp;
122
+ <a href="#M000081">init_properties=</a>&nbsp;&nbsp;
123
+ <a href="#M000082">show_src</a>&nbsp;&nbsp;
124
+ <a href="#M000083">show_src=</a>&nbsp;&nbsp;
125
125
  </div>
126
126
  </div>
127
127
 
@@ -143,21 +143,25 @@ debug.
143
143
  <div id="methods">
144
144
  <h3 class="section-bar">Public Class methods</h3>
145
145
 
146
- <div id="method-M000073" class="method-detail">
147
- <a name="M000073"></a>
146
+ <div id="method-M000078" class="method-detail">
147
+ <a name="M000078"></a>
148
148
 
149
149
  <div class="method-heading">
150
- <a href="#M000073" class="method-signature">
150
+ <a href="#M000078" class="method-signature">
151
151
  <span class="method-name">engine_class</span><span class="method-args">()</span>
152
152
  </a>
153
153
  </div>
154
154
 
155
155
  <div class="method-description">
156
+ <p>
157
+ @@<a href="RailsHelper.html#M000078">engine_class</a> = <a
158
+ href="../FastEruby.html">Erubis::FastEruby</a>
159
+ </p>
156
160
  <p><a class="source-toggle" href="#"
157
- onclick="toggleCode('M000073-source');return false;">[Source]</a></p>
158
- <div class="method-source-code" id="M000073-source">
161
+ onclick="toggleCode('M000078-source');return false;">[Source]</a></p>
162
+ <div class="method-source-code" id="M000078-source">
159
163
  <pre>
160
- <span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line 42</span>
164
+ <span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line 51</span>
161
165
  <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">engine_class</span>
162
166
  <span class="ruby-ivar">@@engine_class</span>
163
167
  <span class="ruby-keyword kw">end</span>
@@ -166,21 +170,21 @@ debug.
166
170
  </div>
167
171
  </div>
168
172
 
169
- <div id="method-M000074" class="method-detail">
170
- <a name="M000074"></a>
173
+ <div id="method-M000079" class="method-detail">
174
+ <a name="M000079"></a>
171
175
 
172
176
  <div class="method-heading">
173
- <a href="#M000074" class="method-signature">
177
+ <a href="#M000079" class="method-signature">
174
178
  <span class="method-name">engine_class=</span><span class="method-args">(klass)</span>
175
179
  </a>
176
180
  </div>
177
181
 
178
182
  <div class="method-description">
179
183
  <p><a class="source-toggle" href="#"
180
- onclick="toggleCode('M000074-source');return false;">[Source]</a></p>
181
- <div class="method-source-code" id="M000074-source">
184
+ onclick="toggleCode('M000079-source');return false;">[Source]</a></p>
185
+ <div class="method-source-code" id="M000079-source">
182
186
  <pre>
183
- <span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line 46</span>
187
+ <span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line 55</span>
184
188
  <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">engine_class=</span>(<span class="ruby-identifier">klass</span>)
185
189
  <span class="ruby-ivar">@@engine_class</span> = <span class="ruby-identifier">klass</span>
186
190
  <span class="ruby-keyword kw">end</span>
@@ -189,21 +193,21 @@ debug.
189
193
  </div>
190
194
  </div>
191
195
 
192
- <div id="method-M000075" class="method-detail">
193
- <a name="M000075"></a>
196
+ <div id="method-M000080" class="method-detail">
197
+ <a name="M000080"></a>
194
198
 
195
199
  <div class="method-heading">
196
- <a href="#M000075" class="method-signature">
200
+ <a href="#M000080" class="method-signature">
197
201
  <span class="method-name">init_properties</span><span class="method-args">()</span>
198
202
  </a>
199
203
  </div>
200
204
 
201
205
  <div class="method-description">
202
206
  <p><a class="source-toggle" href="#"
203
- onclick="toggleCode('M000075-source');return false;">[Source]</a></p>
204
- <div class="method-source-code" id="M000075-source">
207
+ onclick="toggleCode('M000080-source');return false;">[Source]</a></p>
208
+ <div class="method-source-code" id="M000080-source">
205
209
  <pre>
206
- <span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line 53</span>
210
+ <span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line 62</span>
207
211
  <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">init_properties</span>
208
212
  <span class="ruby-ivar">@@init_properties</span>
209
213
  <span class="ruby-keyword kw">end</span>
@@ -212,21 +216,21 @@ debug.
212
216
  </div>
213
217
  </div>
214
218
 
215
- <div id="method-M000076" class="method-detail">
216
- <a name="M000076"></a>
219
+ <div id="method-M000081" class="method-detail">
220
+ <a name="M000081"></a>
217
221
 
218
222
  <div class="method-heading">
219
- <a href="#M000076" class="method-signature">
223
+ <a href="#M000081" class="method-signature">
220
224
  <span class="method-name">init_properties=</span><span class="method-args">(hash)</span>
221
225
  </a>
222
226
  </div>
223
227
 
224
228
  <div class="method-description">
225
229
  <p><a class="source-toggle" href="#"
226
- onclick="toggleCode('M000076-source');return false;">[Source]</a></p>
227
- <div class="method-source-code" id="M000076-source">
230
+ onclick="toggleCode('M000081-source');return false;">[Source]</a></p>
231
+ <div class="method-source-code" id="M000081-source">
228
232
  <pre>
229
- <span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line 57</span>
233
+ <span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line 66</span>
230
234
  <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">init_properties=</span>(<span class="ruby-identifier">hash</span>)
231
235
  <span class="ruby-ivar">@@init_properties</span> = <span class="ruby-identifier">hash</span>
232
236
  <span class="ruby-keyword kw">end</span>
@@ -235,21 +239,21 @@ debug.
235
239
  </div>
236
240
  </div>
237
241
 
238
- <div id="method-M000077" class="method-detail">
239
- <a name="M000077"></a>
242
+ <div id="method-M000082" class="method-detail">
243
+ <a name="M000082"></a>
240
244
 
241
245
  <div class="method-heading">
242
- <a href="#M000077" class="method-signature">
246
+ <a href="#M000082" class="method-signature">
243
247
  <span class="method-name">show_src</span><span class="method-args">()</span>
244
248
  </a>
245
249
  </div>
246
250
 
247
251
  <div class="method-description">
248
252
  <p><a class="source-toggle" href="#"
249
- onclick="toggleCode('M000077-source');return false;">[Source]</a></p>
250
- <div class="method-source-code" id="M000077-source">
253
+ onclick="toggleCode('M000082-source');return false;">[Source]</a></p>
254
+ <div class="method-source-code" id="M000082-source">
251
255
  <pre>
252
- <span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line 64</span>
256
+ <span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line 73</span>
253
257
  <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">show_src</span>
254
258
  <span class="ruby-ivar">@@show_src</span>
255
259
  <span class="ruby-keyword kw">end</span>
@@ -258,21 +262,21 @@ debug.
258
262
  </div>
259
263
  </div>
260
264
 
261
- <div id="method-M000078" class="method-detail">
262
- <a name="M000078"></a>
265
+ <div id="method-M000083" class="method-detail">
266
+ <a name="M000083"></a>
263
267
 
264
268
  <div class="method-heading">
265
- <a href="#M000078" class="method-signature">
269
+ <a href="#M000083" class="method-signature">
266
270
  <span class="method-name">show_src=</span><span class="method-args">(flag)</span>
267
271
  </a>
268
272
  </div>
269
273
 
270
274
  <div class="method-description">
271
275
  <p><a class="source-toggle" href="#"
272
- onclick="toggleCode('M000078-source');return false;">[Source]</a></p>
273
- <div class="method-source-code" id="M000078-source">
276
+ onclick="toggleCode('M000083-source');return false;">[Source]</a></p>
277
+ <div class="method-source-code" id="M000083-source">
274
278
  <pre>
275
- <span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line 68</span>
279
+ <span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line 77</span>
276
280
  <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">show_src=</span>(<span class="ruby-identifier">flag</span>)
277
281
  <span class="ruby-ivar">@@show_src</span> = <span class="ruby-identifier">flag</span>
278
282
  <span class="ruby-keyword kw">end</span>
@@ -0,0 +1,304 @@
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::InterpolationEnhancer</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::InterpolationEnhancer</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/erubis/enhancer_rb.html">
59
+ erubis/enhancer.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ </table>
66
+ </div>
67
+ <!-- banner header -->
68
+
69
+ <div id="bodyContent">
70
+
71
+
72
+
73
+ <div id="contextContent">
74
+
75
+ <div id="description">
76
+ <p>
77
+ convert &quot;&lt;h1&gt;&lt;%=title%&gt;&lt;/h1&gt;&quot; into &quot;_buf
78
+ &lt;&lt; %Q`&lt;h1&gt;#{title}&lt;/h1&gt;`&quot;
79
+ </p>
80
+ <p>
81
+ this is only for <a href="Eruby.html">Eruby</a>.
82
+ </p>
83
+
84
+ </div>
85
+
86
+
87
+ </div>
88
+
89
+ <div id="method-list">
90
+ <h3 class="section-bar">Methods</h3>
91
+
92
+ <div class="name-list">
93
+ <a href="#M000020">_add_text_to_str</a>&nbsp;&nbsp;
94
+ <a href="#M000021">add_expr_escaped</a>&nbsp;&nbsp;
95
+ <a href="#M000022">add_expr_literal</a>&nbsp;&nbsp;
96
+ <a href="#M000019">add_text</a>&nbsp;&nbsp;
97
+ <a href="#M000018">convert_input</a>&nbsp;&nbsp;
98
+ </div>
99
+ </div>
100
+
101
+ </div>
102
+
103
+
104
+ <!-- if includes -->
105
+
106
+ <div id="section">
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+ <!-- if method_list -->
116
+ <div id="methods">
117
+ <h3 class="section-bar">Public Instance methods</h3>
118
+
119
+ <div id="method-M000020" class="method-detail">
120
+ <a name="M000020"></a>
121
+
122
+ <div class="method-heading">
123
+ <a href="#M000020" class="method-signature">
124
+ <span class="method-name">_add_text_to_str</span><span class="method-args">(str, text)</span>
125
+ </a>
126
+ </div>
127
+
128
+ <div class="method-description">
129
+ <p><a class="source-toggle" href="#"
130
+ onclick="toggleCode('M000020-source');return false;">[Source]</a></p>
131
+ <div class="method-source-code" id="M000020-source">
132
+ <pre>
133
+ <span class="ruby-comment cmt"># File erubis/enhancer.rb, line 639</span>
134
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_add_text_to_str</span>(<span class="ruby-identifier">str</span>, <span class="ruby-identifier">text</span>)
135
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">text</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">empty?</span>
136
+ <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>)
137
+ <span class="ruby-identifier">str</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">text</span>
138
+ <span class="ruby-keyword kw">end</span>
139
+ </pre>
140
+ </div>
141
+ </div>
142
+ </div>
143
+
144
+ <div id="method-M000021" class="method-detail">
145
+ <a name="M000021"></a>
146
+
147
+ <div class="method-heading">
148
+ <a href="#M000021" class="method-signature">
149
+ <span class="method-name">add_expr_escaped</span><span class="method-args">(str, code)</span>
150
+ </a>
151
+ </div>
152
+
153
+ <div class="method-description">
154
+ <p><a class="source-toggle" href="#"
155
+ onclick="toggleCode('M000021-source');return false;">[Source]</a></p>
156
+ <div class="method-source-code" id="M000021-source">
157
+ <pre>
158
+ <span class="ruby-comment cmt"># File erubis/enhancer.rb, line 645</span>
159
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_expr_escaped</span>(<span class="ruby-identifier">str</span>, <span class="ruby-identifier">code</span>)
160
+ <span class="ruby-identifier">str</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;\#{#{escaped_expr(code)}}&quot;</span>
161
+ <span class="ruby-keyword kw">end</span>
162
+ </pre>
163
+ </div>
164
+ </div>
165
+ </div>
166
+
167
+ <div id="method-M000022" class="method-detail">
168
+ <a name="M000022"></a>
169
+
170
+ <div class="method-heading">
171
+ <a href="#M000022" class="method-signature">
172
+ <span class="method-name">add_expr_literal</span><span class="method-args">(str, code)</span>
173
+ </a>
174
+ </div>
175
+
176
+ <div class="method-description">
177
+ <p><a class="source-toggle" href="#"
178
+ onclick="toggleCode('M000022-source');return false;">[Source]</a></p>
179
+ <div class="method-source-code" id="M000022-source">
180
+ <pre>
181
+ <span class="ruby-comment cmt"># File erubis/enhancer.rb, line 649</span>
182
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_expr_literal</span>(<span class="ruby-identifier">str</span>, <span class="ruby-identifier">code</span>)
183
+ <span class="ruby-identifier">str</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;\#{#{code}}&quot;</span>
184
+ <span class="ruby-keyword kw">end</span>
185
+ </pre>
186
+ </div>
187
+ </div>
188
+ </div>
189
+
190
+ <div id="method-M000019" class="method-detail">
191
+ <a name="M000019"></a>
192
+
193
+ <div class="method-heading">
194
+ <a href="#M000019" class="method-signature">
195
+ <span class="method-name">add_text</span><span class="method-args">(src, text)</span>
196
+ </a>
197
+ </div>
198
+
199
+ <div class="method-description">
200
+ <p><a class="source-toggle" href="#"
201
+ onclick="toggleCode('M000019-source');return false;">[Source]</a></p>
202
+ <div class="method-source-code" id="M000019-source">
203
+ <pre>
204
+ <span class="ruby-comment cmt"># File erubis/enhancer.rb, line 628</span>
205
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_text</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">text</span>)
206
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">text</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">empty?</span>
207
+ <span class="ruby-comment cmt">#src &lt;&lt; &quot; _buf &lt;&lt; %Q`&quot; &lt;&lt; text &lt;&lt; &quot;`;&quot;</span>
208
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">text</span>[<span class="ruby-value">-1</span>] <span class="ruby-operator">==</span> <span class="ruby-value">?\n</span>
209
+ <span class="ruby-identifier">text</span>[<span class="ruby-value">-1</span>] = <span class="ruby-value str">&quot;\\n&quot;</span>
210
+ <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot; _buf &lt;&lt; %Q`&quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;`\n&quot;</span>
211
+ <span class="ruby-keyword kw">else</span>
212
+ <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot; _buf &lt;&lt; %Q`&quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;`;&quot;</span>
213
+ <span class="ruby-keyword kw">end</span>
214
+ <span class="ruby-keyword kw">end</span>
215
+ </pre>
216
+ </div>
217
+ </div>
218
+ </div>
219
+
220
+ <div id="method-M000018" class="method-detail">
221
+ <a name="M000018"></a>
222
+
223
+ <div class="method-heading">
224
+ <a href="#M000018" class="method-signature">
225
+ <span class="method-name">convert_input</span><span class="method-args">(src, input)</span>
226
+ </a>
227
+ </div>
228
+
229
+ <div class="method-description">
230
+ <p><a class="source-toggle" href="#"
231
+ onclick="toggleCode('M000018-source');return false;">[Source]</a></p>
232
+ <div class="method-source-code" id="M000018-source">
233
+ <pre>
234
+ <span class="ruby-comment cmt"># File erubis/enhancer.rb, line 575</span>
235
+ <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>)
236
+ <span class="ruby-identifier">pat</span> = <span class="ruby-ivar">@pattern</span>
237
+ <span class="ruby-identifier">regexp</span> = <span class="ruby-identifier">pat</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">pat</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'&lt;% %&gt;'</span> <span class="ruby-operator">?</span> <span class="ruby-constant">Basic</span><span class="ruby-operator">::</span><span class="ruby-constant">Converter</span><span class="ruby-operator">::</span><span class="ruby-constant">DEFAULT_REGEXP</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">pattern_regexp</span>(<span class="ruby-identifier">pat</span>)
238
+ <span class="ruby-identifier">pos</span> = <span class="ruby-value">0</span>
239
+ <span class="ruby-identifier">is_bol</span> = <span class="ruby-keyword kw">true</span> <span class="ruby-comment cmt"># is beginning of line</span>
240
+ <span class="ruby-identifier">str</span> = <span class="ruby-value str">''</span>
241
+ <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">indicator</span>, <span class="ruby-identifier">code</span>, <span class="ruby-identifier">rspace</span><span class="ruby-operator">|</span>
242
+ <span class="ruby-identifier">match</span> = <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">last_match</span>()
243
+ <span class="ruby-identifier">len</span> = <span class="ruby-identifier">match</span>.<span class="ruby-identifier">begin</span>(<span class="ruby-value">0</span>) <span class="ruby-operator">-</span> <span class="ruby-identifier">pos</span>
244
+ <span class="ruby-identifier">text</span> = <span class="ruby-identifier">input</span>[<span class="ruby-identifier">pos</span>, <span class="ruby-identifier">len</span>]
245
+ <span class="ruby-identifier">pos</span> = <span class="ruby-identifier">match</span>.<span class="ruby-identifier">end</span>(<span class="ruby-value">0</span>)
246
+ <span class="ruby-identifier">ch</span> = <span class="ruby-identifier">indicator</span> <span class="ruby-value">? </span><span class="ruby-identifier">indicator</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">:</span> <span class="ruby-keyword kw">nil</span>
247
+ <span class="ruby-identifier">lspace</span> = <span class="ruby-identifier">ch</span> <span class="ruby-operator">==</span> <span class="ruby-value">?=</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">detect_spaces_at_bol</span>(<span class="ruby-identifier">text</span>, <span class="ruby-identifier">is_bol</span>)
248
+ <span class="ruby-identifier">is_bol</span> = <span class="ruby-identifier">rspace</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">true</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">false</span>
249
+ <span class="ruby-identifier">_add_text_to_str</span>(<span class="ruby-identifier">str</span>, <span class="ruby-identifier">text</span>)
250
+ <span class="ruby-comment cmt">## * when '&lt;%= %&gt;', do nothing</span>
251
+ <span class="ruby-comment cmt">## * when '&lt;% %&gt;' or '&lt;%# %&gt;', delete spaces iff only spaces are around '&lt;% %&gt;'</span>
252
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">ch</span> <span class="ruby-operator">==</span> <span class="ruby-value">?=</span> <span class="ruby-comment cmt"># &lt;%= %&gt;</span>
253
+ <span class="ruby-identifier">str</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">lspace</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">lspace</span>
254
+ <span class="ruby-identifier">add_expr</span>(<span class="ruby-identifier">str</span>, <span class="ruby-identifier">code</span>, <span class="ruby-identifier">indicator</span>)
255
+ <span class="ruby-identifier">str</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">rspace</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">rspace</span>
256
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">ch</span> <span class="ruby-operator">==</span> <span class="ruby-value">?\#</span> <span class="ruby-comment cmt"># &lt;%# %&gt;</span>
257
+ <span class="ruby-identifier">n</span> = <span class="ruby-identifier">code</span>.<span class="ruby-identifier">count</span>(<span class="ruby-value str">&quot;\n&quot;</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>)
258
+ <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@trim</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">lspace</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">rspace</span>
259
+ <span class="ruby-identifier">add_text</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">str</span>)
260
+ <span class="ruby-identifier">str</span> = <span class="ruby-value str">''</span>
261
+ <span class="ruby-identifier">add_stmt</span>(<span class="ruby-identifier">src</span>, <span class="ruby-value str">&quot;\n&quot;</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">n</span>)
262
+ <span class="ruby-keyword kw">else</span>
263
+ <span class="ruby-identifier">str</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">lspace</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">lspace</span>
264
+ <span class="ruby-identifier">add_text</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">str</span>)
265
+ <span class="ruby-identifier">str</span> = <span class="ruby-value str">''</span>
266
+ <span class="ruby-identifier">add_stmt</span>(<span class="ruby-identifier">src</span>, <span class="ruby-value str">&quot;\n&quot;</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">n</span>)
267
+ <span class="ruby-identifier">str</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">rspace</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">rspace</span>
268
+ <span class="ruby-keyword kw">end</span>
269
+ <span class="ruby-keyword kw">else</span> <span class="ruby-comment cmt"># &lt;% %&gt;</span>
270
+ <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@trim</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">lspace</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">rspace</span>
271
+ <span class="ruby-identifier">add_text</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">str</span>)
272
+ <span class="ruby-identifier">str</span> = <span class="ruby-value str">''</span>
273
+ <span class="ruby-identifier">add_stmt</span>(<span class="ruby-identifier">src</span>, <span class="ruby-node">&quot;#{lspace}#{code}#{rspace}&quot;</span>)
274
+ <span class="ruby-keyword kw">else</span>
275
+ <span class="ruby-identifier">str</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">lspace</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">lspace</span>
276
+ <span class="ruby-identifier">add_text</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">str</span>)
277
+ <span class="ruby-identifier">str</span> = <span class="ruby-value str">''</span>
278
+ <span class="ruby-identifier">add_stmt</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>)
279
+ <span class="ruby-identifier">str</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">rspace</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">rspace</span>
280
+ <span class="ruby-keyword kw">end</span>
281
+ <span class="ruby-keyword kw">end</span>
282
+ <span class="ruby-keyword kw">end</span>
283
+ <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>
284
+ <span class="ruby-identifier">_add_text_to_str</span>(<span class="ruby-identifier">str</span>, <span class="ruby-identifier">rest</span>)
285
+ <span class="ruby-identifier">add_text</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">str</span>)
286
+ <span class="ruby-keyword kw">end</span>
287
+ </pre>
288
+ </div>
289
+ </div>
290
+ </div>
291
+
292
+
293
+ </div>
294
+
295
+
296
+ </div>
297
+
298
+
299
+ <div id="validator-badges">
300
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
301
+ </div>
302
+
303
+ </body>
304
+ </html>