Skip to content

Instantly share code, notes, and snippets.

@brockgr
Forked from gimite/gist:728823
Created December 21, 2010 09:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brockgr/749712 to your computer and use it in GitHub Desktop.
Save brockgr/749712 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# coding: utf-8
require "rubygems"
require "tilt"
require "tempfile"
f = Tempfile.open("template")
f.puts('<%# coding: UTF-8 %>')
f.puts('ふが <%= @hoge %>')
f.close()
@hoge = "ほげ"
erb = Tilt['erb'].new(f.path)
puts(erb.render(self))
puts(erb.render(self))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment