Skip to content

Instantly share code, notes, and snippets.

@jugyo
Created February 2, 2009 13:54
Show Gist options
  • Save jugyo/56917 to your computer and use it in GitHub Desktop.
Save jugyo/56917 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'highline'
if $stdin.respond_to?(:getbyte) # for ruby1.9
require 'delegate'
stdin_for_highline = SimpleDelegator.new($stdin)
def stdin_for_highline.getc
getbyte
end
else
stdin_for_highline = $stdin
end
ui = HighLine.new(stdin_for_highline)
username = ui.ask('Username: ')
password = ui.ask('Password: ') { |q| q.echo = false }
puts username
puts password
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment