watson-ruby
watson-ruby copied to clipboard
Crossplatform password block needed, not sure if current method is safe either [lib/watson/github.rb]
filename : lib/watson/github.rb line # : 65 tag : fix md5 : 69b349d182c127caf52dcce5820af24c
# [fix] - Crossplatform password block needed, not sure if current method is safe either
# Block output to tty to prevent PW showing, Linux/Unix only :(
print BOLD + "Password: " + RESET
system "stty -echo"
_password = $stdin.gets.chomp
system "stty echo"
print "\n\n"
if _password.empty?
Printer.print_status "x", RED
print BOLD + "Input is blank. Please enter your password!\n\n" + RESET
return false
end
# HTTP Request to get OAuth Token
# GitHub API v3 - http://developer.github.com/v3/
# Create options hash to pass to Remote::http_call