vmail 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,7 @@ module Vmail
10
10
  @mail = Mail.new(mail)
11
11
  end
12
12
 
13
- def reply_headers
13
+ def reply_headers(try_again = true)
14
14
  formatter = Vmail::MessageFormatter.new(@mail)
15
15
  headers = formatter.extract_headers
16
16
  subject = headers['subject']
@@ -21,6 +21,15 @@ module Vmail
21
21
  quote_header = "On #{date.strftime('%a, %b %d, %Y at %I:%M %p')}, #{sender} wrote:\n\n"
22
22
  body = quote_header + formatter.process_body.gsub(/^(?=>)/, ">").gsub(/^(?!>)/, "> ")
23
23
  {'from' => "#@name <#@username>", 'to' => primary_recipient, 'cc' => cc, 'subject' => subject, :body => body}
24
+ rescue NoMethodError
25
+ # a total hack TODO but stopgap
26
+ if try_again
27
+ log "reply_headers trying again STOPGAP"
28
+ sleep 0.3
29
+ return reply_headers(false) # try one more time
30
+ else
31
+ raise
32
+ end
24
33
  end
25
34
 
26
35
  def primary_recipient
@@ -1,3 +1,3 @@
1
1
  module Vmail
2
- VERSION = "1.0.4"
2
+ VERSION = "1.0.5"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 4
9
- version: 1.0.4
8
+ - 5
9
+ version: 1.0.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Daniel Choi