class Bundler::Settings

def set_key(key, value, hash, file)

def set_key(key, value, hash, file)
  key = key_for(key)
  unless hash[key] == value
    hash[key] = value
    hash.delete(key) if value.nil?
    FileUtils.mkdir_p(file.dirname)
    require 'bundler/psyched_yaml'
    File.open(file, "w") { |f| f.puts YAML.dump(hash) }
  end
  value
end