[ANN] Erubis 2.0.1 release - a fast eRuby implementation

K

kwatch

Hi,
I have released Erubis 2.0.1.
http://rubyforge.org/projects/erubis/

Erubis is a pure ruby implementation of eRuby.

Features:
* Very fast, almost three times faster than ERB and
even as fast as 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
* Print statement available
* Easy to extend in subclass

See users' guide (erubis_2.0.1/doc/users-guide.html)
for details.

To install Erubis, just type 'gem install -r erubis',
or download from rubyforge.org.
(Erubis requires 'abstrac.rb'. You must install it at first.
See http://rubyforge.org/projects/abstract )

Changes from 1.1:
* module 'PrintEnhancer' is renamed to 'PrintEnabledEnahncer'
* module 'FastEnhancer' and class 'FastEruby' is obsolete
(these are integrated with Eruby class)
* Eruby#evaluate() calls instance_eval() instead of eval()
* XmlEruby.escape_xml() is moved to XmlHelper.escape_xml()
* and so on

Enhancements from 1.1:
* multi programming language support
(Ruby,PHP,C,Java,Scheme,Perl,Javascript)
* many enhancer modules are added (see users' guide for details)
* class Eruby runs very fast because FastEnhancer module is
integrated into Eruby by default
* TinyEruby class (tiny.rb) is added
* and so on


If you are interested in Erubis internal, see the following classes
at first.
* Erubis::TinyEruby (erubis/tiny.rb) --
the most simple eRuby implementation.
* Erubis::Engine (erubis/engine.rb) --
base class of Eruby, Ephp, Ejava, and so on.
* Erubis::Eruby (erubis/engine/eruby.rb) --
engine class for eRuby.
 
A

anne001

if it is the same speed as eruby, and I have eruby installed and
running, should I bother with erubis?
 
K

kwatch

anne001 said:
if it is the same speed as eruby, and I have eruby installed and
running, should I bother with erubis?

No, Erubis doesn't conflict with eruby nor ERB.

Erubis is not only faster but also more flexible and extensible
than eruby and ERB.

Here is an example result of benchmark.
Benchmark program is included in Erubis archive.

Env: Linux FedoraCore4, Celeron 667MHz, Mem512MB, Ruby1.8.4
user system total real
ERuby 138.280000 1.900000 140.180000 (141.470426)
ERB 402.220000 3.190000 405.410000 (408.886894)
Erubis::Eruby 147.080000 2.400000 149.480000 (150.752255)
Erubis::StdoutEruby 106.010000 2.130000 108.140000 (108.999193)


Env: MacOS X 10.4, PowerPC 1.42GHz, Mem1.5GB, Ruby1.8.4
user system total real
ERuby 55.040000 2.120000 57.160000 ( 89.311397)
ERB 103.960000 3.480000 107.440000 (159.231792)
Erubis::Eruby 36.130000 1.570000 37.700000 ( 52.188574)
Erubis::StdoutEruby 26.240000 1.490000 27.730000 ( 41.840430)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,525
Members
44,997
Latest member
mileyka

Latest Threads

Top