6 @@config_path = File.expand_path(File.join(File.dirname(__FILE__), '..', 'etc'))
13 File.join(@@config_path, @config_name)
17 STDERR.puts "Reloading configuration"
18 @config_hash = indifferent_params(YAML::load(File.open(config_file)))
19 @config_time = File.stat(config_file).mtime
23 File.stat(config_file).mtime != @config_time
27 load_config if !@config_hash || stale?
31 def each(*args, &block)
32 config_hash.each(*args, &block)
40 Hash.new {|hash,key| hash[key.to_s] if Symbol === key }
43 def indifferent_params(object)
46 new_hash = indifferent_hash
47 object.each {|key, value| new_hash[key] = indifferent_params(value) }
50 object.map {|item| indifferent_params(item) }