Sha256: 14c582d68f56ee77ae06bae42b7cca37a3b5974e990d0bebea929b947ae1374f
Contents?: true
Size: 545 Bytes
Versions: 9
Compression:
Stored size: 545 Bytes
Contents
require 'yaml' require 'render_me_pretty' module Forger class Config < Base include Forger::Template def initialize(options={}) super @path = options[:path] || "#{Forger.root}/config/#{Forger.env}.yml" end @@data = nil def data return @@data if @@data text = RenderMePretty.result(@path, context: context) @@data = YAML.load(text) rescue Errno::ENOENT => e puts e.message puts "The #{@path} does not exist. Please double check that it exists." exit end end end
Version data entries
9 entries across 9 versions & 1 rubygems