Awesome Rubygem for Gmail

A small selection of what you can do:

require "gmail"

Gmail.connect(username, password) do |gmail|
  gmail.logged_in?

  gmail.inbox.count
  gmail.inbox.count(:unread)
  gmail.inbox.count(:read)

  gmail.inbox.find(:unread) do |email|
    email.read!
    email.attachments[0].save_to_file("/path/to/location")
  end
end

(thx @bbergher)

A mix of code and design by Mark Dodwell, Rails developer and designer.