From: Belorion Date: 2006-02-19T02:53:16+09:00 Subject: Erb rdoc wrong? ------=_Part_8007_16432951.1140285180549 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Greetings. I am trying to use Erb to process a plain-text template. Following the RDo= c documentation at http://www.ruby-doc.org/stdlib/libdoc/erb/rdoc/classes/ERB.html, I can't ge= t 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. -Matt [1] require "erb" # Create template. template =3D %q{ From: James Edward Gray II To: <%=3D to %> Subject: Addressing Needs <%=3D to[/\w+/] %>: Just wanted to send a quick note assuring that your needs are being addressed. I want you to know that my team will keep working on the issues, especially: <%# 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 ERB.new(template, 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 ------=_Part_8007_16432951.1140285180549--