instiki/vendor/plugins/erubis-2.6.5/test/data/users-guide/main_program2.rb

9 lines
265 B
Ruby
Raw Normal View History

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