# coding: utf-8 require 'yaml' require 'erb' require 'pp' def main raw_yaml = ARGF.read() obj = YAML.load(raw_yaml) pp obj template = <<TEMPLATE hoge = <%= obj[:hoge] %> fuga = <%= obj[:fuga] %> piyo = <%= obj[:piyo] %> TEMPLATE ERB.new(template).run(binding) end if __FILE__ == $0 main end