Sha256: 25566e82b107a33aa1a7136f6a0f6ef220d471838daa97bf9d625a218c9cb0fa
Contents?: true
Size: 395 Bytes
Versions: 27
Compression:
Stored size: 395 Bytes
Contents
module ErbMacros def self.included(base) base.send :extend, ClassMethods base.send :include, InstanceMethods end module ClassMethods end module InstanceMethods def render_template(template) erb = ERB.new(template.read) tmp_file = Tempfile.new("erb") File.open(tmp_file.path, "wb") { |f| f.write(erb.result(binding)) } tmp_file end end end
Version data entries
27 entries across 27 versions & 1 rubygems