hide password

master
Andrew Coleman 2009-03-21 21:32:06 -05:00
parent c8c36d2848
commit 017a178cde
1 changed files with 6 additions and 3 deletions

View File

@ -28,9 +28,6 @@
# --username <username>
# The username in TuxBliki to use as the owner.
#
# --password <password>
# The username's password in TuxBliki. Check your shell logs...
#
# --server <server address>
# The server running TuxBliki, optional; defaults to http://penguincoder.org
#
@ -103,6 +100,12 @@ host_prefix = "#{server.gsub(/\/$/, '')}:#{port}"
page = agent.get("#{host_prefix}/sessions/new")
login_form = page.forms.first
login_form.username = username
print "Password: "
STDOUT.flush
system "stty -echo"
password = STDIN.readline.chomp
system "stty echo"
puts ''
login_form.password = password
page = agent.submit(login_form, login_form.buttons.first)