class Login

Public Instance Methods

run(options) click to toggle source
# File src/commands/login.rb, line 11
def run (options)
    print "Username: "
    userName = gets.chomp
    print "Password (You won't see any typing):"
    password = STDIN.noecho(&:gets).chomp
    puts ""
    begin
        resp = @api.login(userName, password)
        @info['token'] = resp["token"]
        puts "Login successful!".green
    rescue NotFound
        $stderr.puts "username or password is incorrect".red
    end
end