instiki/vendor/plugins/erubis/test/data/users-guide/main_program2.rb
2010-07-04 08:51:53 -05:00

9 lines
265 B
Ruby

require 'erubis'
eruby = Erubis::Eruby.new(File.read('template2.rhtml'))
items = ['foo', 'bar', 'baz']
x = 1
## only 'items' are passed to template
print eruby.evaluate(:items=>items)
## local variable 'x' is not changed!
puts "** debug: x=#{x.inspect}" #=> 1