Erubis 2.5.0 released - a fast and extensible eRuby

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

Enhancements from 2.4.1:

  • Ruby on Rails 2.0 support
    If you are using preprocessing, notice that _?(‘foo.id’) will be NG
    because it contains period (‘.’) character.


    [%= link_to ‘Edit’, edit_user_path(_?(‘@user.id’)) %]
    [%= link_to ‘Show’, @user %]
    [%= link_to ‘Delete’, @user, :confirm=>‘OK?’, :method=>:delete %]

    <%= user_id = @user.id %>
    [%= link_to ‘Edit’, edit_user_path(?(‘user_id’)) %]
    [%= link_to ‘Show’, :action=>‘show’, :id=>
    ?(‘user_id’) %]
    [%= link_to ‘Delete’, {:action=>‘destroy’, :id=>_?(‘user_id’)},
    {:confirm=>‘OK?’, :method=>:delete} %]

  • (experimental)
    Rails form helper methods for preprocessing are provided.
    These helper methos are available with preprocessing.

    ex. _form.rhtml

    Name: <%= text_field :user, :name %>
    Name: [%= pp_text_field :user, :name %]

    preprocessed:

    Name: <%= text_field :user, :name %>
    Name:

    Ruby code:

    _buf << ’
    Name: '; _buf << ( text_field :stock, :name ).to_s; _buf << ’
    Name:
    ';

    This shows that text_filed() is called every time when rendering,
    but pp_text_filed() is called only once when loading template,
    so pp_text_field() with prepocessing is much faster than
    text_field().

    See User’s guide for details.
    http://www.kuwata-lab.com/erubis/users-guide.05.html#rails-formhelpers

Nice :smiley: