This code snippet should explain it:
require 'gmail'
username = ARGV[0]
password = ARGV[1]
gmail = Gmail.new(username, password)
puts "success!" if gmail.logged_in? == true
is there no other way to check? I've tried a few different methods, but I get IMAP errors and the script crashes instead of just giving me a "false" back.