Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Erb rdoc wrong?

Thread Tools

Erb rdoc wrong?

Posts: n/a
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline


I am trying to use Erb to process a plain-text template. Following the RDo=
documentation at, I can't ge=
the first plain-text example to work. ruby 1.8.2 (2004-12-25)
[i686-linux]. Below[1] is the actual sample script which isn't working
(it's not finding the local variables when processing the template). Any
ideas what's going on here? Thanks.


require "erb"

# Create template.
template =3D %q{
From: James Edward Gray II <(E-Mail Removed)>
To: <%=3D to %>
Subject: Addressing Needs

<%=3D to[/\w+/] %>:

Just wanted to send a quick note assuring that your needs are being

I want you to know that my team will keep working on the issues,

<%# ignore numerous minor requests -- focus on priorities %>
% priorities.each do |priority|
* <%=3D priority %>
% end

Thanks for your patience.

James Edward Gray II
}.gsub(/^ /, '')

message =3D, 0, "%<>")

# Set up template data.
to =3D "Community Spokesman <>"
priorities =3D [ "Run Ruby Quiz",
"Document Modules",
"Answer Questions on Ruby Talk" ]

# Produce result.
email =3D message.result
puts email


Reply With Quote
James Edward Gray II
Posts: n/a
On Feb 18, 2006, at 11:53 AM, Belorion wrote:

> Any ideas what's going on here?

Hmm, has ERB stopped defaulting to a top-level binding?

> email = message.result

Change that to:

email = message.result(binding)

Can someone please patch the docs for me?

James Edward Gray II

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
link to .erb file, from .erb file Dan Thomas Ruby 4 01-26-2011 09:26 PM
Store erb block and alter scope of erb block eval? Steve V Ruby 6 04-20-2005 09:26 PM
[RDOC] Using a template causes rdoc not to document some classes Daniel Berger Ruby 1 11-02-2004 08:23 PM
rdoc bug (and rdoc bug tracker site is down) Brian Schröder Ruby 5 09-18-2004 02:08 PM
rdoc: how to generate rdoc & ri documentation of standard library? Andreas Schwarz Ruby 6 01-01-2004 03:09 AM