Sha256: 9c63d2299cedd330a2ed8888561360ae98ed0acfda0d171da595eb6cbda66920

Contents?: true

Size: 491 Bytes

Versions: 24

Compression:

Stored size: 491 Bytes

Contents

require 'yaml'

module Ufo
  class Param
    extend Memoist

    def initialize
      @params_path = "#{Ufo.root}/.ufo/params.yml"
    end

    def data
      return {} unless File.exist?(@params_path)

      result = RenderMePretty.result(@params_path, context: template_scope)
      data = YAML.load(result) || {}
      data.deep_symbolize_keys
    end
    memoize :data

    def template_scope
      @template_scope ||= Ufo::TemplateScope.new(Ufo::DSL::Helper.new, nil)
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
ufo-4.5.3 lib/ufo/param.rb
ufo-4.5.2 lib/ufo/param.rb
ufo-4.5.1 lib/ufo/param.rb
ufo-4.5.0 lib/ufo/param.rb