Sha256: cb0e4ae2fe491f128602c9d48f45bdd69dd997bbf6b4c136809ca432f3bcc01b
Contents?: true
Size: 643 Bytes
Versions: 6
Compression:
Stored size: 643 Bytes
Contents
# frozen_string_literal: true require 'erb' require 'yaml' require 'active_support/hash_with_indifferent_access' module BlueprintConfig module Backend class YAML < Base def initialize(path = 'config/app.yml') @path = path end def load_keys if File.exist?(path) parsed = ::YAML.load(File.read(path), aliases: true).deep_symbolize_keys parsed.fetch(:default, {}).deep_merge(parsed.fetch(BlueprintConfig.env&.to_sym, {})) else {} end end private def path File.expand_path(@path, BlueprintConfig.root) end end end end
Version data entries
6 entries across 6 versions & 1 rubygems