1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[rubygems/rubygems] Make error code a constant and remove TODO comment

https://github.com/rubygems/rubygems/commit/3d6c7c92e4
This commit is contained in:
bronzdoc 2019-07-25 22:11:37 -06:00 committed by Hiroshi SHIBATA
parent a3b784b3a0
commit 33025d9768
No known key found for this signature in database
GPG key ID: F9CF13417264FAC2

View file

@ -7,6 +7,8 @@ require 'rubygems/text'
module Gem::GemcutterUtilities
ERROR_CODE = 1
include Gem::Text
attr_writer :host
@ -76,7 +78,7 @@ module Gem::GemcutterUtilities
self.host = host if host
unless self.host
alert_error "You must specify a gem server"
terminate_interaction 1 # TODO: question this
terminate_interaction(ERROR_CODE)
end
if allowed_push_host
@ -153,7 +155,7 @@ module Gem::GemcutterUtilities
Gem.configuration.api_keys[key]
else
alert_error "No such API key. Please add it to your configuration (done automatically on initial `gem push`)."
terminate_interaction 1 # TODO: question this
terminate_interaction(ERROR_CODE)
end
end
@ -177,7 +179,7 @@ module Gem::GemcutterUtilities
message = "#{error_prefix}: #{message}" if error_prefix
say clean_text(message)
terminate_interaction 1 # TODO: question this
terminate_interaction(ERROR_CODE)
end
end