Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'rubygems'
- require 'highline/import'
- def get_password(prompt="Enter Password")
- ask(prompt) {|q| q.echo = false}
- end
- thePassword = get_password()
- system "stty -echo"
- # read password
- system "stty echo"
- #!/usr/local/bin/ruby
- require 'rubygems'
- require 'highline/import'
- username = ask("Enter your username: ") { |q| q.echo = true }
- password = ask("Enter your password: ") { |q| q.echo = "*" }
- $ ruby highline.rb
- Enter your username: doug
- Enter your password: ******
Add Comment
Please, Sign In to add comment