Created
April 12, 2011 13:27
-
-
Save a2ikm/915496 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| # coding: utf-8 | |
| class String | |
| def color num | |
| "\e[#{num}m#{self}\e[0m" | |
| end | |
| def ask | |
| print "#{self}" | |
| gets.strip | |
| end | |
| def ask_password | |
| system("stty -echo") | |
| print "#{self}" | |
| gets.strip | |
| ensure | |
| system("stty echo") | |
| end | |
| end | |
| if __FILE__ == $0 | |
| login = "Login: ".color(36).ask | |
| pass = "Password: ".color(31).ask_password | |
| puts "" | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
inspired by jugyo's get-twitter-oauth-token