Sha256: dcd327ae87387312fa032a3a349b9d2512941c4d2ddb8732197c161084d98b6e
Contents?: true
Size: 654 Bytes
Versions: 146
Compression:
Stored size: 654 Bytes
Contents
require 'json' require 'mustache' class Template < Mustache def processAndWriteToFile (template, output, parameters) contents = process template, parameters File.write(output, contents) end def process (template, parameters) self.template_file = template ENV.each_pair do |k, v| self[k] = v end parameters.each_pair do |k, v| self[k] = v end return self.render end def processString (string, parameters) self.template = string ENV.each_pair do |k, v| self[k] = v end parameters.each_pair do |k, v| self[k] = v end return self.render end end
Version data entries
146 entries across 146 versions & 1 rubygems