Sha256: f3682159d36962db697d7b4a5c525fdd2520c7c2cb29c3160c0231b74ebdb779
Contents?: true
Size: 603 Bytes
Versions: 1
Compression:
Stored size: 603 Bytes
Contents
require 'yaml' 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
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
wrapbox-0.1.0 | lib/wrapbox/config_repository.rb |