Sha256: 9bb5c4195b7abb5d3bd659ca6266c850a2404da2cedec20822542eda0199bf7a
Contents?: true
Size: 635 Bytes
Versions: 13
Compression:
Stored size: 635 Bytes
Contents
require 'yaml' require 'wrapbox/configuration' module Wrapbox class ConfigRepository def initialize @configs = {} end def load_yaml(yaml_file) configs = YAML.load(ERB.new(File.read(yaml_file)).result) configs.each do |name, configuration| load_config(name, configuration.merge("name" => name)) end end def load_config(name, configuration) @configs[name.to_sym] = Configuration.load_config(configuration) end def default @configs[:default] end def get(name) name ? @configs[name.to_sym] : default end alias_method(:[], :get) end end
Version data entries
13 entries across 13 versions & 1 rubygems