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 = &lt;&lt;'END' + &lt;ul&gt; + &lt;% for item in @list %&gt; + &lt;li&gt;&lt;%= item %&gt; + &lt;%== item %&gt;&lt;/li&gt; + &lt;% end %&gt; + &lt;/ul&gt; + END + list = ['&lt;aaa&gt;', 'b&amp;b', '&quot;ccc&quot;'] + eruby = Erubis::Eruby.new(input) + puts &quot;--- code ---&quot; + puts eruby.src + puts &quot;--- result ---&quot; + context = Erubis::Context.new() # or new(:list=&gt;list) + context[:list] = list + puts eruby.evaluate(context) +</pre> +<p> +result: +</p> +<pre> + --- source --- + _buf = ''; _buf &lt;&lt; '&lt;ul&gt; + '; for item in @list + _buf &lt;&lt; ' &lt;li&gt;'; _buf &lt;&lt; ( item ).to_s; _buf &lt;&lt; ' + '; _buf &lt;&lt; ' '; _buf &lt;&lt; Erubis::XmlHelper.escape_xml( item ); _buf &lt;&lt; '&lt;/li&gt; + '; end + _buf &lt;&lt; '&lt;/ul&gt; + '; + _buf.to_s + --- result --- + &lt;ul&gt; + &lt;li&gt;&lt;aaa&gt; + &amp;lt;aaa&amp;gt;&lt;/li&gt; + &lt;li&gt;b&amp;b + b&amp;amp;b&lt;/li&gt; + &lt;li&gt;&quot;ccc&quot; + &amp;quot;ccc&amp;quot;&lt;/li&gt; + &lt;/ul&gt; +</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]+)/) &amp;&amp; $1</td> </tr> </table> </div> </div> \ No newline at end of file