Sha256: 177b0a16e28abbb5f932b1a8a430ca2215e62820037741bbaaaaa47823f4fcbf
Contents?: true
Size: 505 Bytes
Versions: 46
Compression:
Stored size: 505 Bytes
Contents
module Lookbook class ConfigLoader < Service attr_reader :file, :env def initialize(path, env: Rails.env) @file = Engine.root.join(path) @env = env.to_sym end def call if file.exist? config = YAML.load_file(file).deep_symbolize_keys env_config = config[:shared].to_h.deep_merge(config[env].to_h) Store.new(env_config) else raise ConfigError.new("Could not load configuration. No such file - #{file}") end end end end
Version data entries
46 entries across 46 versions & 1 rubygems