lib/universa_tools/uniring.rb in universa_tools-0.1.5 vs lib/universa_tools/uniring.rb in universa_tools-0.1.6

- old
+ new

@@ -162,11 +162,11 @@ error("wrong keyring password or broken ring") else raise e end ensure - print "\r" + ' ' * 79 + "\r" + print "\r" + ' ' * 20 + "\r" end end def keyring_password @keyring_password @@ -177,10 +177,12 @@ psw1 = request_password prompt psw2 = request_password "please re-enter the password" return psw1 if psw1 == psw2 puts error_style("passwords do not much. try again") end + ensure + clearstring end def request_password(prompt) clearstring print prompt + ' ' @@ -188,11 +190,10 @@ ensure clearstring end private - private def delete_keys(keys) keys.each { |kr| show_record kr print warning_style { "Are you sure to delete this key? [Ny] " } @@ -238,10 +239,10 @@ end key end def clearstring() - print "\r" + ' ' * 80 + "\r" + print "\r" + ' ' * 120 + "\r" end def task(&block) @tasks << block end