Class: RubePost
- Inherits:
-
Object
- Object
- RubePost
- Defined in:
- lib/rube_post.rb
Defined Under Namespace
Constant Summary collapse
- VERSION =
File.read( File.join(File.dirname(__FILE__),'..','VERSION') ).strip
Instance Method Summary collapse
- #emails_in_inbox ⇒ Object
-
#initialize(username, password) ⇒ RubePost
constructor
A new instance of RubePost.
- #move_to_gmail(username, password) ⇒ Object
Constructor Details
Instance Method Details
#emails_in_inbox ⇒ Object
11 12 13 |
# File 'lib/rube_post.rb', line 11 def emails_in_inbox @grabber.emails_in_inbox.map{|d| Email.new(d, @grabber) } end |
#move_to_gmail(username, password) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/rube_post.rb', line 15 def move_to_gmail(username, password) require 'gmail' my_email = (username.include?('@') ? username : "#{username}@gmail.com") Gmail.connect(username, password) do |gmail| emails_in_inbox.each do |email| gmail.deliver do to my_email subject email.subject text_part do body "#{email.sender}:\nepost-id:#{email.id}\n\n#{email.content}" end end email.move_to_trash end end end |