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:
parent
a3b784b3a0
commit
33025d9768
1 changed files with 5 additions and 3 deletions
|
@ -7,6 +7,8 @@ require 'rubygems/text'
|
||||||
|
|
||||||
module Gem::GemcutterUtilities
|
module Gem::GemcutterUtilities
|
||||||
|
|
||||||
|
ERROR_CODE = 1
|
||||||
|
|
||||||
include Gem::Text
|
include Gem::Text
|
||||||
|
|
||||||
attr_writer :host
|
attr_writer :host
|
||||||
|
@ -76,7 +78,7 @@ module Gem::GemcutterUtilities
|
||||||
self.host = host if host
|
self.host = host if host
|
||||||
unless self.host
|
unless self.host
|
||||||
alert_error "You must specify a gem server"
|
alert_error "You must specify a gem server"
|
||||||
terminate_interaction 1 # TODO: question this
|
terminate_interaction(ERROR_CODE)
|
||||||
end
|
end
|
||||||
|
|
||||||
if allowed_push_host
|
if allowed_push_host
|
||||||
|
@ -153,7 +155,7 @@ module Gem::GemcutterUtilities
|
||||||
Gem.configuration.api_keys[key]
|
Gem.configuration.api_keys[key]
|
||||||
else
|
else
|
||||||
alert_error "No such API key. Please add it to your configuration (done automatically on initial `gem push`)."
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -177,7 +179,7 @@ module Gem::GemcutterUtilities
|
||||||
message = "#{error_prefix}: #{message}" if error_prefix
|
message = "#{error_prefix}: #{message}" if error_prefix
|
||||||
|
|
||||||
say clean_text(message)
|
say clean_text(message)
|
||||||
terminate_interaction 1 # TODO: question this
|
terminate_interaction(ERROR_CODE)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue