doc-api/classes/Erubis.html in erubis-2.1.0 vs doc-api/classes/Erubis.html in erubis-2.2.0
- old
+ new
@@ -117,26 +117,30 @@
<br />
<a href="../files/erubis/generator_rb.html">
erubis/generator.rb
</a>
<br />
- <a href="../files/erubis/helper/rails_rb.html">
- erubis/helper/rails.rb
- </a>
- <br />
<a href="../files/erubis/helper_rb.html">
erubis/helper.rb
</a>
<br />
+ <a href="../files/erubis/helpers/rails_helper_rb.html">
+ erubis/helpers/rails_helper.rb
+ </a>
+ <br />
<a href="../files/erubis/main_rb.html">
erubis/main.rb
</a>
<br />
<a href="../files/erubis/tiny_rb.html">
erubis/tiny.rb
</a>
<br />
+ <a href="../files/erubis_rb.html">
+ erubis.rb
+ </a>
+ <br />
</td>
</tr>
</table>
</div>
@@ -148,12 +152,56 @@
<div id="contextContent">
<div id="description">
<p>
-$Rev: 35 $ $Release: 2.1.0 $ copyright(c) 2006 kuwata-lab all rights reserved.
+an implementation of eRuby
</p>
+<p>
+ex.
+</p>
+<pre>
+ input = <<'END'
+ <ul>
+ <% for item in @list %>
+ <li><%= item %>
+ <%== item %></li>
+ <% end %>
+ </ul>
+ END
+ list = ['<aaa>', 'b&b', '"ccc"']
+ eruby = Erubis::Eruby.new(input)
+ puts "--- code ---"
+ puts eruby.src
+ puts "--- result ---"
+ context = Erubis::Context.new() # or new(:list=>list)
+ context[:list] = list
+ puts eruby.evaluate(context)
+</pre>
+<p>
+result:
+</p>
+<pre>
+ --- source ---
+ _buf = ''; _buf << '<ul>
+ '; for item in @list
+ _buf << ' <li>'; _buf << ( item ).to_s; _buf << '
+ '; _buf << ' '; _buf << Erubis::XmlHelper.escape_xml( item ); _buf << '</li>
+ '; end
+ _buf << '</ul>
+ ';
+ _buf.to_s
+ --- result ---
+ <ul>
+ <li><aaa>
+ &lt;aaa&gt;</li>
+ <li>b&b
+ b&amp;b</li>
+ <li>"ccc"
+ &quot;ccc&quot;</li>
+ </ul>
+</pre>
</div>
</div>
@@ -177,11 +225,11 @@
Module <a href="Erubis/Converter.html" class="link">Erubis::Converter</a><br />
Module <a href="Erubis/EscapeEnhancer.html" class="link">Erubis::EscapeEnhancer</a><br />
Module <a href="Erubis/Evaluator.html" class="link">Erubis::Evaluator</a><br />
Module <a href="Erubis/Generator.html" class="link">Erubis::Generator</a><br />
Module <a href="Erubis/HeaderFooterEnhancer.html" class="link">Erubis::HeaderFooterEnhancer</a><br />
-Module <a href="Erubis/Helper.html" class="link">Erubis::Helper</a><br />
+Module <a href="Erubis/Helpers.html" class="link">Erubis::Helpers</a><br />
Module <a href="Erubis/JavaGenerator.html" class="link">Erubis::JavaGenerator</a><br />
Module <a href="Erubis/JavascriptGenerator.html" class="link">Erubis::JavascriptGenerator</a><br />
Module <a href="Erubis/NoCodeEnhancer.html" class="link">Erubis::NoCodeEnhancer</a><br />
Module <a href="Erubis/NoTextEnhancer.html" class="link">Erubis::NoTextEnhancer</a><br />
Module <a href="Erubis/OptimizedGenerator.html" class="link">Erubis::OptimizedGenerator</a><br />
@@ -252,9 +300,14 @@
</tr>
<tr class="top-aligned-row context-row">
<td class="context-item-name">EscapedEjs</td>
<td>=</td>
<td class="context-item-value">EscapedEjavascript</td>
+ </tr>
+ <tr class="top-aligned-row context-row">
+ <td class="context-item-name">VERSION</td>
+ <td>=</td>
+ <td class="context-item-value">('$Release: 2.2.0 $' =~ /([.\d]+)/) && $1</td>
</tr>
</table>
</div>
</div>
\ No newline at end of file