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.70 ./lib/stacco/template/old.rb
stacco-0.1.68 ./lib/stacco/template/old.rb
stacco-0.1.66 ./lib/stacco/template/old.rb
stacco-0.1.64 ./lib/stacco/template/old.rb
stacco-0.1.63 ./lib/stacco/template/old.rb
stacco-0.1.62 ./lib/stacco/template/old.rb
stacco-0.1.61 ./lib/stacco/template/old.rb
stacco-0.1.60 ./lib/stacco/template/old.rb
stacco-0.1.59 ./lib/stacco/template/old.rb
stacco-0.1.57 ./lib/stacco/template/old.rb
stacco-0.1.53 ./lib/stacco/template/old.rb
stacco-0.1.52 ./lib/stacco/template/old.rb
stacco-0.1.50 ./lib/stacco/template/old.rb
stacco-0.1.49 ./lib/stacco/template/old.rb
stacco-0.1.48 ./lib/stacco/template/old.rb
stacco-0.1.47 ./lib/stacco/template/old.rb
stacco-0.1.46 ./lib/stacco/template/old.rb
stacco-0.1.44 ./lib/stacco/template/old.rb
stacco-0.1.43 ./lib/stacco/template/old.rb
stacco-0.1.42 ./lib/stacco/template/old.rb