Sha256: 1c88b26c4ed411597d5af3831dbea30ab5b5661e40ced280b43eb984789dd373

Contents?: true

Size: 426 Bytes

Versions: 14

Compression:

Stored size: 426 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
      self
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
ufo-6.3.13 lib/ufo/param.rb
ufo-6.3.12 lib/ufo/param.rb
ufo-6.3.11 lib/ufo/param.rb
ufo-6.3.10 lib/ufo/param.rb
ufo-6.3.9 lib/ufo/param.rb
ufo-6.3.8 lib/ufo/param.rb
ufo-6.3.7 lib/ufo/param.rb
ufo-6.3.6 lib/ufo/param.rb
ufo-6.3.5 lib/ufo/param.rb
ufo-6.3.4 lib/ufo/param.rb
ufo-6.3.3 lib/ufo/param.rb
ufo-6.3.2 lib/ufo/param.rb
ufo-6.3.1 lib/ufo/param.rb
ufo-6.3.0 lib/ufo/param.rb