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

Version Path
canzea-0.1.158 lib/template-runner.rb
canzea-0.1.157 lib/template-runner.rb
canzea-0.1.156 lib/template-runner.rb
canzea-0.1.155 lib/template-runner.rb
canzea-0.1.154 lib/template-runner.rb
canzea-0.1.153 lib/template-runner.rb
canzea-0.1.152 lib/template-runner.rb
canzea-0.1.151 lib/template-runner.rb
canzea-0.1.149 lib/template-runner.rb
canzea-0.1.148 lib/template-runner.rb
canzea-0.1.147 lib/template-runner.rb
canzea-0.1.144 lib/template-runner.rb
canzea-0.1.143 lib/template-runner.rb
canzea-0.1.142 lib/template-runner.rb
canzea-0.1.141 lib/template-runner.rb
canzea-0.1.140 lib/template-runner.rb
canzea-0.1.139 lib/template-runner.rb
canzea-0.1.138 lib/template-runner.rb
canzea-0.1.137 lib/template-runner.rb
canzea-0.1.136 lib/template-runner.rb