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

11 lines
312 B
Ruby
Raw Normal View History

require 'erubis'
input = File.read('example2.eruby')
eruby = Erubis::Eruby.new(input, :trim=>false)
puts "----- script source ---"
puts eruby.src # print script source
puts "----- result ----------"
list = ['aaa', 'bbb', 'ccc']
puts eruby.result(binding()) # get result