class Bundler::EnvironmentPreserver

def replace_with_backup

Replaces `ENV` with the bundler environment variables backed up
def replace_with_backup
  unless Gem.win_platform?
    ENV.replace(backup)
    return
  end
  # Fallback logic for Windows below to workaround
  # https://bugs.ruby-lang.org/issues/16798. Can be dropped once all
  # supported rubies include the fix for that.
  ENV.clear
  backup.each {|k, v| ENV[k] = v }
end