[why] when define a constant, the constant may already defined in required files, when execute the script, my throw warnings:
./answerback-email.rb:32: warning: already initialized constant SEND_MAIL_HOST ~/compass-ci/lib/constants.rb:11: warning: previous definition of SEND_MAIL_HOST was here ./answerback-email.rb:33: warning: already initialized constant SEND_MAIL_PORT ~/compass-ci/lib/constants.rb:12: warning: previous definition of SEND_MAIL_PORT was here
Signed-off-by: Luan Shengde shdluan@163.com --- container/assign-account/answerback-email.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/container/assign-account/answerback-email.rb b/container/assign-account/answerback-email.rb index a99306b..8dceee1 100755 --- a/container/assign-account/answerback-email.rb +++ b/container/assign-account/answerback-email.rb @@ -27,11 +27,11 @@ names = Set.new %w[
defaults = relevant_defaults(names)
-JUMPER_HOST = defaults['JUMPER_HOST'] -JUMPER_PORT = defaults['JUMPER_PORT'] || 29999 -SEND_MAIL_HOST = defaults['SEND_MAIL_HOST'] || 'localhost' -SEND_MAIL_PORT = defaults['SEND_MAIL_PORT'] || 49000 -LAB = defaults['lab'] +JUMPER_HOST ||= defaults['JUMPER_HOST'] +JUMPER_PORT ||= defaults['JUMPER_PORT'] || 29999 +SEND_MAIL_HOST ||= defaults['SEND_MAIL_HOST'] || 'localhost' +SEND_MAIL_PORT ||= defaults['SEND_MAIL_PORT'] || 49000 +LAB ||= defaults['lab'] TOOL_SERVER = 'z9'
my_info = {