Checks the permissions of the credentials file. If they are not 0600 an
error message is displayed and RubyGems aborts.
# File lib/rubygems/config_file.rb, line 242
def check_credentials_permissions
return if Gem.win_platform? # windows doesn't write 0600 as 0600
return unless File.exist? credentials_path
existing_permissions = File.stat(credentials_path).mode & 0777
return if existing_permissions == 0600
alert_error Your gem push credentials file located at:\t#{credentials_path}has file permissions of 0#{existing_permissions.to_s 8} but 0600 is required.To fix this error run:\tchmod 0600 #{credentials_path}You should reset your credentials at:\thttps://rubygems.org/profile/editif you believe they were disclosed to a third party.
terminate_interaction 1
end