Sha256: ca693d151e092bd8069edaa88337ff7dcda7f81eb51d1f984dc4122788a89a99

Contents?: true

Size: 554 Bytes

Versions: 32

Compression:

Stored size: 554 Bytes

Contents

require 'ostruct'
require 'base64'
require 'shellwords'
require 'json'

require 'stacco/template'

class Stacco::Template::Old
  class RenderContext < OpenStruct
    def j(o)
      o.to_json
    end
  end

  def initialize
  end

  def to_json(opts = {})
    stack = opts.delete(:stack)

    vars = stack.config.dup
    vars['stack'] = stack
    vars['layers'] = stack.enabled_layers

    var_binding = RenderContext.new(vars).instance_eval{ binding }

    JSON.pretty_generate(JSON.parse(Stacco::Resources::StackTemplate.result(var_binding)))
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
stacco-0.1.41 ./lib/stacco/template/old.rb
stacco-0.1.40 ./lib/stacco/template/old.rb
stacco-0.1.39 ./lib/stacco/template/old.rb
stacco-0.1.38 ./lib/stacco/template/old.rb
stacco-0.1.37 ./lib/stacco/template/old.rb
stacco-0.1.36 ./lib/stacco/template/old.rb
stacco-0.1.35 ./lib/stacco/template/old.rb
stacco-0.1.33 ./lib/stacco/template/old.rb
stacco-0.1.32 ./lib/stacco/template/old.rb
stacco-0.1.30 ./lib/stacco/template/old.rb
stacco-0.1.29 ./lib/stacco/template/old.rb
stacco-0.1.28 ./lib/stacco/template/old.rb