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

12 lines
313 B
Ruby
Raw Normal View History

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