From e71936ab4df04cc522ea2e2f2fed9bc3ab26d031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=8D=9A=E4=BA=9E?= Date: Sat, 20 Nov 2021 23:06:16 +0800 Subject: [PATCH] fix error --- announcement.gemspec | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/announcement.gemspec b/announcement.gemspec index c0114e0..4051c3b 100644 --- a/announcement.gemspec +++ b/announcement.gemspec @@ -245,25 +245,25 @@ if bundle_update_flag r.each do |mode,v1| v1.each do |clients,d| d.each do |k,v| - if v["username"].present? - if !v["options"].present? + if !v["username"].nil? + if v["options"].nil? v["options"] = {} end v["options"]["user"] = v["username"] v.delete "username" end - if v["password"].present? - if !v["options"].present? + if !v["password"].nil? + if !v["options"].nil? v["options"] = {} end v["options"]["password"] = v["password"] v.delete "password" end - if v["options"].present? && v["options"]["pool_size"].present? + if !v["options"].nil? && !v["options"]["pool_size"].nil? v["options"]["max_pool_size"] = v["options"]["pool_size"] v["options"].delete "pool_size" end - if v["options"].present? && v["options"]["read"].class == String + if !v["options"].nil? && v["options"]["read"].class == String v["options"]["read"] = {mode: v["options"]["read"]} end end