Module: Erubis

Module | Erubis
In: | lib/erubis/evaluator.rb lib/erubis/main.rb lib/erubis/helper.rb lib/erubis/preprocessing.rb lib/erubis/context.rb lib/erubis/engine.rb lib/erubis/generator.rb lib/erubis/enhancer.rb lib/erubis/converter.rb lib/erubis/error.rb lib/erubis/engine/ejavascript.rb lib/erubis/engine/eperl.rb lib/erubis/engine/optimized.rb lib/erubis/engine/ecpp.rb lib/erubis/engine/eruby.rb lib/erubis/engine/enhanced.rb lib/erubis/engine/ejava.rb lib/erubis/engine/escheme.rb lib/erubis/engine/ephp.rb lib/erubis/engine/ec.rb lib/erubis/tiny.rb lib/erubis/helpers/rails_form_helper.rb lib/erubis/helpers/rails_helper.rb lib/erubis.rb

an implementation of eRuby

ex.

      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)

result:

      --- 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>

### Classes and Modules

Module Erubis::ArrayBufferEnhancer
Module Erubis::ArrayEnhancer
Module Erubis::Basic
Module Erubis::BiPatternEnhancer
Module Erubis::CGenerator
Module Erubis::Converter
Module Erubis::CppGenerator
Module Erubis::DeleteIndentEnhancer
Module Erubis::ErboutEnhancer
Module Erubis::EscapeEnhancer
Module Erubis::Evaluator
Module Erubis::Generator
Module Erubis::HeaderFooterEnhancer
Module Erubis::Helpers
Module Erubis::InterpolationEnhancer
Module Erubis::JavaGenerator
Module Erubis::JavascriptGenerator
Module Erubis::NoCodeEnhancer
Module Erubis::NoTextEnhancer
Module Erubis::OptimizedGenerator
Module Erubis::PI
Module Erubis::PercentLineEnhancer
Module Erubis::PerlGenerator
Module Erubis::PhpGenerator
Module Erubis::PrefixedLineEnhancer
Module Erubis::PreprocessingHelper
Module Erubis::PrintEnabledEnhancer
Module Erubis::PrintOutEnhancer
Module Erubis::RubyEvaluator
Module Erubis::RubyGenerator
Module Erubis::SchemeGenerator
Module Erubis::SimplifyEnhancer
Module Erubis::StdoutEnhancer
Module Erubis::StringBufferEnhancer
Module Erubis::XmlHelper
Class Erubis::ArrayBufferEruby
Class Erubis::ArrayEruby
Class Erubis::BiPatternEruby
Class Erubis::CommandOptionError
Class Erubis::Context
Class Erubis::DeleteIndentEruby
Class Erubis::Ec
Class Erubis::Ecpp
Class Erubis::Ejava
Class Erubis::Ejavascript
Class Erubis::Engine
Class Erubis::Eperl
Class Erubis::Ephp
Class Erubis::ErboutEruby
Class Erubis::ErubisError
Class Erubis::Eruby
Class Erubis::EscapedEc
Class Erubis::EscapedEcpp
Class Erubis::EscapedEjava
Class Erubis::EscapedEjavascript
Class Erubis::EscapedEperl
Class Erubis::EscapedEphp
Class Erubis::EscapedEruby
Class Erubis::EscapedEscheme
Class Erubis::Escheme
Class Erubis::FastEruby
Class Erubis::HeaderFooterEruby
Class Erubis::InterpolationEruby
Class Erubis::Main
Class Erubis::NoCodeEruby
Class Erubis::NoTextEruby
Class Erubis::NotSupportedError
Class Erubis::OptimizedEruby
Class Erubis::OptimizedXmlEruby
Class Erubis::PercentLineEruby
Class Erubis::PrefixedLineEruby
Class Erubis::PreprocessingEruby
Class Erubis::PrintEnabledEruby
Class Erubis::PrintOutEruby
Class Erubis::PrintOutSimplifiedEruby
Class Erubis::SimplifiedEruby
Class Erubis::StdoutEruby
Class Erubis::StdoutSimplifiedEruby
Class Erubis::StringBufferEruby
Class Erubis::StringIOEruby
Class Erubis::TinyEruby
Class Erubis::XmlEruby

### Constants

EMPTY_BINDING | = | binding()
Ejs | = | Ejavascript
EscapedEjs | = | EscapedEjavascript
VERSION | = | ('$Release: 2.7.0 $' =~ /([.\d]+)/) && $1

[Validate]