L
Lyndon Samson
------=_Part_3645_22730402.1124349688656
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
There seems to be some issue with the binding in ERB, any ideas?
(erb):16: undefined local variable or method `priority' for main:Object=20
(NameError)
from d:/utils/ruby/lib/ruby/1.8/erb.rb:739:in `value'
from d:/utils/ruby/lib/ruby/1.8/erb.rb:739:in `result'
from testerb.rb:36
is what I get when I try to run the following, taken from=20
http://www.ruby-doc.org/stdlib/libdoc/erb/rdoc/=20
require "erb"
# Create template.
template =3D %q{
From: James Edward Gray II <[email protected]>
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 <spokesman@ruby_community.org>"
priorities =3D [ "Run Ruby Quiz",
"Document Modules",
"Answer Questions on Ruby Talk" ]
# Produce result.
email =3D message.result
puts email
------=_Part_3645_22730402.1124349688656--
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
There seems to be some issue with the binding in ERB, any ideas?
(erb):16: undefined local variable or method `priority' for main:Object=20
(NameError)
from d:/utils/ruby/lib/ruby/1.8/erb.rb:739:in `value'
from d:/utils/ruby/lib/ruby/1.8/erb.rb:739:in `result'
from testerb.rb:36
is what I get when I try to run the following, taken from=20
http://www.ruby-doc.org/stdlib/libdoc/erb/rdoc/=20
require "erb"
# Create template.
template =3D %q{
From: James Edward Gray II <[email protected]>
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 <spokesman@ruby_community.org>"
priorities =3D [ "Run Ruby Quiz",
"Document Modules",
"Answer Questions on Ruby Talk" ]
# Produce result.
email =3D message.result
puts email
------=_Part_3645_22730402.1124349688656--