嵌入式 Ruby Erubis

openkk 13年前
     <p>Erubis 是一个快速、安全和具备高可扩展性的 eRuby 的实现,主要特征如下:</p>    <ul class="ul1">     <li>快速,几乎是 ERB 的三倍,比用C开发的eRuby还要快10% </li>     <li>File caching of converted Ruby script support. </li>     <li>Auto escaping (sanitizing) support, it means that '<%= %>' can be escaped in default. It is desirable for web application. </li>     <li>Spaces around '<% %>' are trimmed automatically only when '<%' is at the beginning of line and '%>' is at the end of line. </li>     <li>Embedded pattern changeable (default '<% %>'), for example '[% %]' or '      <!--? ?-->' are available. </li>     <li>Enable to handle Processing Instructions (PI) as embedded pattern (ex. '      <!--?rb ... ?-->'). This is desirable for XML/HTML than '<% .. %>' because the latter breaks HTML design but the former doesn't. </li>     <li>Multi-language support (Ruby/PHP/C/Java/Scheme/Perl/Javascript). </li>     <li>Context object available and easy to combine eRuby template with YAML datafile (see the below example). </li>     <li>Print statement available. </li>     <li>Easy to expand and customize in subclass      <ul class="ul2">       <li>Print statement support </li>       <li>Lines starting with percent character ('%') support </li>       <li>Another embedded pattern support </li>       <li>etc... </li>      </ul> </li>     <li>Ruby on Rails support. </li>     <li>Mod_ruby support. </li>    </ul>    <p>下图是几个嵌入式 Ruby 的性能比较:</p>    <p><img alt="嵌入式 Ruby Erubis" src="https://simg.open-open.com/show/191bf7b24d64af260cbfce1ee19a9b79.png" width="351" height="262" /><br /> </p>    <p><strong>项目主页:</strong><a href="http://www.open-open.com/lib/view/home/1322991807749" target="_blank">http://www.open-open.com/lib/view/home/1322991807749</a></p>