[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[ANN] Erubis 2.0.1 release - a fast eRuby implementation

Makoto Kuwata

5/22/2006 4:05:00 PM

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

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/project... )

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.


--
regards,
kwatch

3 Answers

anne001

5/23/2006 6:29:00 AM

0

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

Makoto Kuwata

5/23/2006 8:54:00 PM

0

anne001 wrote:
>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)

--
regards,
kwatch

Daniel Kaminski

5/26/2006 12:42:00 PM

0

Hi!
How can I use erubis [or, eRuby;-)] in rails?:)