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

11 lines
313 B
Ruby

require 'erubis'
input = File.read('fasteruby.rhtml')
eruby = Erubis::FastEruby.new(input) # create Eruby object
puts "---------- script source ---"
puts eruby.src
puts "---------- result ----------"
context = { :title=>'Example', :list=>['aaa', 'bbb', 'ccc'] }
output = eruby.evaluate(context)
print output