Erubis
News
- [2008-06-13] erubis-2.6.2 released.
- [2008-06-06] erubis-2.6.1 released.
- [2008-05-05] erubis-2.6.0 released.
- [2008-01-30] erubis-2.5.0 released.
- [2007-09-25] erubis_2.4.1 released.
- [2007-07-19] erubis_2.4.0 released.
- [2007-05-26] erubis_2.3.1 released. This is a bugfix release. You should update immediately.
- [2007-05-23] erubis_2.3.0 released.
- [2007-02-12] erubis_2.2.0 released.
- [2006-09-28] erubis-j_1.0.0 (porting to Java) released.
- [2006-09-24] erubis_2.1.0 released.
Introduction
| Fig: Erubis is the fastest eRuby implementation. |
|
Erubis is a fast, secure, and very extensible 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 (sanitizing) support, it means that '<%= %>' can be escaped in default. It is desirable for web application.
- Spaces around '<% %>' are trimmed automatically only when '<%' is at the beginning of line and '%>' is at the end of line.
- Embedded pattern changeable (default '<% %>'), for example '[% %]' or '<? ?>' are available.
- 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.
- Multi-language support (Ruby/PHP/C/Java/Scheme/Perl/Javascript).
- Context object available and easy to combine eRuby template with YAML datafile (see the below example).
- Print statement available.
- Easy to expand and customize in subclass
- Print statement support
- Lines starting with percent character ('%') support
- Another embedded pattern support
- etc...
- Ruby on Rails support.
- Mod_ruby support.
eRuby means "embedded Ruby" in documents.
Embedded patterns are '<% statement %>' and '<%= expression %>'.
The following is an example of eRuby. '<% ... %>' means Ruby statement and '<%= ... %>' means Ruby expression.
Erubis is implemented in Ruby and is now ported into Java. You can use Erubis in Java with Rhino.
Download
- Erubis 2.6.2 (implemented in Ruby)
- Erubis-J 1.0.0 (implemented in Java)
Documents
- Erubis 2.6.2 (implemented in Ruby)
- Erubis-J 1.0.0 (implemented in Java)
License
- Erubis is released under the MIT License.
- Erubis-J is released under the LGPL License.