require "ostruct"
require "erb"
$thing = "weird thing"
class Context < OpenStruct
def render(template)
ERB.new(template, 4).result(binding().taint())
end
end
context = Context.new({:symbol => "sweet symbol", "string" => "splendid string"})
puts(context.render("I'm rendering a <%= symbol %> and a <%= string %>. There's also a <%= $thing %> I shouldn't be able to access."))
cmVxdWlyZSAib3N0cnVjdCIKcmVxdWlyZSAiZXJiIgoKJHRoaW5nID0gIndlaXJkIHRoaW5nIgoKY2xhc3MgQ29udGV4dCA8IE9wZW5TdHJ1Y3QKICBkZWYgcmVuZGVyKHRlbXBsYXRlKQogICAgRVJCLm5ldyh0ZW1wbGF0ZSwgNCkucmVzdWx0KGJpbmRpbmcoKS50YWludCgpKQogIGVuZAplbmQKCmNvbnRleHQgPSBDb250ZXh0Lm5ldyh7OnN5bWJvbCA9PiAic3dlZXQgc3ltYm9sIiwgInN0cmluZyIgPT4gInNwbGVuZGlkIHN0cmluZyJ9KQpwdXRzKGNvbnRleHQucmVuZGVyKCJJJ20gcmVuZGVyaW5nIGEgPCU9IHN5bWJvbCAlPiBhbmQgYSA8JT0gc3RyaW5nICU+LiBUaGVyZSdzIGFsc28gYSA8JT0gJHRoaW5nICU+IEkgc2hvdWxkbid0IGJlIGFibGUgdG8gYWNjZXNzLiIpKQo=