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.91 lib/template-runner.rb
canzea-0.1.90 lib/template-runner.rb
canzea-0.1.89 lib/template-runner.rb
canzea-0.1.88 lib/template-runner.rb
canzea-0.1.87 lib/template-runner.rb
canzea-0.1.86 lib/template-runner.rb
canzea-0.1.85 lib/template-runner.rb
canzea-0.1.84 lib/template-runner.rb
canzea-0.1.83 lib/template-runner.rb
canzea-0.1.82 lib/template-runner.rb
canzea-0.1.81 lib/template-runner.rb
canzea-0.1.80 lib/template-runner.rb
canzea-0.1.78 lib/template-runner.rb
canzea-0.1.77 lib/template-runner.rb
canzea-0.1.76 lib/template-runner.rb
canzea-0.1.74 lib/template-runner.rb
canzea-0.1.73 lib/template-runner.rb
canzea-0.1.72 lib/template-runner.rb
canzea-0.1.71 lib/template-runner.rb
canzea-0.1.70 lib/template-runner.rb