Sha256: 0c4f363a885fb9be7648be7d81b2d281f21c5bbbeb195d5fa5304859f3a66c84
Contents?: true
Size: 766 Bytes
Versions: 4
Compression:
Stored size: 766 Bytes
Contents
require 'singleton' require 'hash_deep_merge' require 'digest/md5' module Docman class Config < Hash attr_reader :unmutable_config def initialize(file) super @config = YAML::load_file(file) assign_to_self end def assign_to_self @config.each_pair do |k, v| self[k] = v end @unmutable_config = Marshal::load(Marshal.dump(@config)) end def merge_config_from_file(file) config = YAML::load_file(file) @config.deep_merge(config) @config['version'] = config['version'].nil? ? 1 : config['version'] assign_to_self end def config_hash Digest::MD5.hexdigest(Marshal::dump(@unmutable_config)) end def version @config['version'] end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
docman-0.0.80 | lib/docman/config.rb |
docman-0.0.79 | lib/docman/config.rb |
docman-0.0.78 | lib/docman/config.rb |
docman-0.0.77 | lib/docman/config.rb |