# Erubis 2.2.0 release - a fast eRuby implementation

**URL:** <https://www.ruby-forum.com/t/erubis-2-2-0-release-a-fast-eruby-implementation/85289>\
**Category:** Ruby\
**Created:** [February 12, 2007, 12:09pm UTC](https://www.ruby-forum.com/t/erubis-2-2-0-release-a-fast-eruby-implementation/85289 "2007-02-12T12:09:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kwatch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/76d3ee/32.png) [@kwatch](https://www.ruby-forum.com/u/kwatch)\
**Post date:** [February 12, 2007, 12:09pm UTC](https://www.ruby-forum.com/t/erubis-2-2-0-release-a-fast-eruby-implementation/85289/1 "2007-02-12T12:09:46Z")

</div>

Hi all,

I have released Erubis 2.2.0.  
[http://www.kuwata-lab.com/erubis](http://www.kuwata-lab.com/erubis)  
[http://www.kuwata-lab.com/erubis/CHANGES](http://www.kuwata-lab.com/erubis/CHANGES)

Erubis is another implementation of eRuby.

Features:

- Very fast, almost three times faster than ERB and  
even ten percent faster than eruby (implemented in C)
- Support multi-language  
(Ruby,PHP,C,Java,Scheme,Perl,Javascript)
- Auto escaping support
- Auto trimming spaces around ‘\<% %\>’
- Embedded pattern changeable (default ‘\<% %\>’)
- Context object available and easy to combine eRuby  
template with YAML datafile or Ruby script
- Easy to extend in subclass
- Ruby on Rails support

See users’ guide (erubis\_2.2.0/doc/users-guide.html)  
for details.

$$ Enhancements

- Performance tuned up. Release 2.2.0 works about 8 percent faster  
than 2.1.0.  
As a result, Erubis works more than 10 percent faster than eruby.  
(eruby is the extension module of eRuby written in C.)

- Support of Ruby on Rails improved.  
If you want to use Erubis with Ruby on Rails, add the following  
code  
into your ‘config/environment.rb’ and restart web server.  
This will set Erubis as eRuby compiler in Ruby on Rails instead of  
ERB.

- Erubis::Engine.load\_file(filename) creates cache file (filename +  
‘.cache’) automatically if cache file is old or not exist.  
Caching makes Erubis about 40-50 percent faster.

- Command-line option ‘-f datafile’ can take Ruby script (‘_.rb’)  
as well as YAML file ('_.yaml’ or ‘\*.yml’).

- New command-line option ‘-c context’ support. It takes context  
string  
in YAML inline style or Ruby code style.

- New command-line option ‘-z’ (syntax checking) support. It is  
similar  
to ‘erubis -x file.rhtml | ruby -wc’, but it can take several  
filenames.

- New constant Erubis::VERSION added.

$$ Changes

- Class Erubis::Eruby changed to include  
Erubis::StringBufferEnhancer  
instead of Erubis::ArrayBufferEnhancer.  
This is for Ruby on Rails support.

- Erubis::StringBufferEnhancer#add\_postamble() prints “\_buf.to\_s”  
instead of “\_buf”.  
This is useful for ‘erubis -x file.rhtml | ruby -wc’.

- Command-line option ‘-T’ is removed. Use ‘–trim=false’ instead.

- License is changed to MIT License.

- Embedded pattern ‘\<%- -%\>’ can be handled.
