[ANN] Erubis 2.4.1 released - a fast and extensible eRuby implementation

K

kwatch

Hi all,

I have released Erubis 2.4.1.
http://www.kuwata-lab.com/erubis/
Erubis is another eRuby implementation which is very fast and
extensible than ERB and eruby.

This is a bugfix release.

enhancements:

- |
Add new section 'evaluate(context) v.s. result(binding)' to
user's guide.
This section describes why Erubis::Eruby#evaluate(context) is
recommended
rather than Erubis::Eruby#result(binding).
User's Guide > Other Topics > evaluate(context) v.s.
result(binding)
http://www.kuwata-lab.com/erubis/users-guide.06.html#topics-context-vs-binding

- |
Add new command-line property '--docwrite={true|false}' to
Erubis::Ejavascript.
If this property is true then 'document.write(_buf.join(""));'
is used
as postamble and if it is false then '_buf.join("")' is used.
Default is true for compatibility reason but it will be false in
the
future release.
(This feature was proposed by D.Dribin. Thank you.)

bugfix:

- |
When using Erubis::Eruby#evaluate(), changing local variables in
templates have affected to variables accessible with
TOPLEVEL_BINDING.
It means that if you change variables in templates, it is
possible to
change variables in main program.
This was a bug and is now fixed not to affect to variables in
main
program.

ex. template.rhtml
--------------------
<% for x in @items %>
item = <%= x %>
<% end %>
--------------------

ex. main-program.rb
--------------------
require 'erubis'
x = 10
items = ['foo', 'bar', 'baz']
eruby = Erubis::Eruby.new(File.read('template.rhtml'))
s = eruby.evaluate:)items=>items)
print s
$stderr.puts "*** debug: x=#{x.inspect}" #=> x="baz" (2.4.0)
#=> x=10 (2.4.1)
 
G

Gaspard Bucher

I saw the benchmarks on the web page. They are impressive !

It seems that Erubis can be used with rails. I have a few questions:
1. What is the current state of this support ?
2. How do we replace standard ERB processing with Erubis ?
3. Why is the code executed with Erubis so much faster the ERB ? Is it
that ERB compilation was not cached in the tests (it certainly is
cached in Ror) ?

Thanks for the answers,

Gaspard
 
T

Tom M

Great news! I have been able to get my apps running with erubis if
they are using actionpack <= 1.13.2, but not with actionpack 1.13.3.
Is erubis known to work w/ this version of actionpack? My problem
seems to be related to a deprecation that occured in actionpack
1.13.3.

Thanks,

Tom
 

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,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top