module PowerTools::Config def self.load(file=:application) path = File.join(RAILS_ROOT, 'config', "#{file.to_s}.yml") config = YAML.load_file(path) defaults = config['defaults'] || {} env = config[RAILS_ENV] || {} HashWithIndifferentAccess.new(defaults.merge(env)) rescue RAILS_DEFAULT_LOGGER.error("Configuration file #{path} missing or corrupted.") end end