Erubis Users' Guide
release: 2.7.0
Preface
Erubis is an implementation of eRuby. It has the following features.
- Very fast, almost three times faster than ERB and about ten percent faster than eruby (implemented in C)
- File caching of converted Ruby script support
- Auto escaping support
- Auto trimming spaces around '<% %>'
- Embedded pattern changeable (default '<% %>')
- Enable to handle Processing Instructions (PI) as embedded pattern (ex. '<?rb ... ?>')
- Multi-language support (Ruby/PHP/C/Java/Scheme/Perl/Javascript)
- Context object available and easy to combine eRuby template with YAML datafile
- Print statement available
- Easy to expand and customize in subclass
- Ruby on Rails support
- mod_ruby support|#topcs-modruby
Erubis is implemented in pure Ruby. It requires Ruby 1.8 or higher. Erubis now supports Ruby 1.9.
Table of Contents
- Preface
- Chapter 1 Installation
- Chapter 2 Tutorial
- Chapter 3 Enhancer
- 3-1 EscapeEnhancer
- 3-2 StdoutEnhancer
- 3-3 PrintOutEnhancer
- 3-4 PrintEnabledEnhancer
- 3-5 ArrayEnhancer
- 3-6 ArrayBufferEnhancer
- 3-7 StringBufferEnhancer
- 3-8 ErboutEnhancer
- 3-9 NoTextEnhancer
- 3-10 NoCodeEnhancer
- 3-11 SimplifyEnhancer
- 3-12 BiPatternEnhancer
- 3-13 PercentLineEnhancer
- 3-14 PrefixedLineEnhancer
- 3-15 HeaderFooterEnhancer
- 3-16 InterpolationEnhancer
- 3-17 DeleteIndentEnhancer
- Chapter 4 Multi-Language Support
- Chapter 5 Ruby on Rails Support
- Chapter 6 Other Topics
- 6-1
Erubis::FastErubyClass - 6-2
:bufvarOption - 6-3 '<%= =%>' and '<%= -%>'
- 6-4 '<%% %>' and '<%%= %>'
- 6-5 evaluate(context) v.s. result(binding)
- 6-6 Class Erubis::FastEruby
- 6-7 Syntax Checking
- 6-8 File Caching
- 6-9 Erubis::TinyEruby class
- 6-10 NoTextEnhancer and NoCodeEnhancer in PHP
- 6-11 Helper Class for mod_ruby
- 6-12 Helper CGI Script for Apache
- 6-13 Define method
- 6-14 Benchmark
- 6-1
- Chapter 7 Command Reference