Module Erubis
In: erubis/context.rb
erubis/converter.rb
erubis/engine/ec.rb
erubis/engine/ecpp.rb
erubis/engine/ejava.rb
erubis/engine/ejavascript.rb
erubis/engine/enhanced.rb
erubis/engine/eperl.rb
erubis/engine/ephp.rb
erubis/engine/eruby.rb
erubis/engine/escheme.rb
erubis/engine/optimized.rb
erubis/engine.rb
erubis/enhancer.rb
erubis/error.rb
erubis/evaluator.rb
erubis/generator.rb
erubis/helper.rb
erubis/helpers/rails_form_helper.rb
erubis/helpers/rails_helper.rb
erubis/main.rb
erubis/preprocessing.rb
erubis/tiny.rb
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]