postmortem 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/layout/layout.css +1 -0
- data/lib/postmortem/adapters/action_mailer.rb +6 -41
- data/lib/postmortem/adapters/base.rb +29 -0
- data/lib/postmortem/adapters/mail.rb +1 -1
- data/lib/postmortem/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd3c7e0205b1225caa909fe3940cb87ab5080bc7bf1ee398cb77547f01791ed9
|
4
|
+
data.tar.gz: 577921e6e73fc4fbcca72478708b4537e576f081364a502ad80c6f1327cab742
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9356b29967072434c6e5579c9520697dd02085fd61b6b23e2ff1f0bbb7f755908075d9a172281c58e0366092cbe3129eed23b1b5793f833a1a70b4bcf4d721a
|
7
|
+
data.tar.gz: a32461cce8da22998b86c30f01b5dbff8b443c5b90e1b26252b74d4818642628de570b68471f82ef082d2b0314e89c0bb011071b28354e1eb7718c141e8466dc
|
data/README.md
CHANGED
data/layout/layout.css
CHANGED
@@ -7,53 +7,18 @@ module Postmortem
|
|
7
7
|
private
|
8
8
|
|
9
9
|
def adapted
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
cc: mail.cc,
|
15
|
-
bcc: normalized_bcc,
|
16
|
-
subject: mail.subject,
|
17
|
-
text_body: text_part,
|
18
|
-
html_body: html_part
|
19
|
-
}
|
20
|
-
end
|
21
|
-
|
22
|
-
def text_part
|
23
|
-
return nil unless text?
|
24
|
-
return mail.body.decoded unless mail.text_part
|
25
|
-
|
26
|
-
mail.text_part.decoded
|
27
|
-
end
|
28
|
-
|
29
|
-
def html_part
|
30
|
-
return nil unless html?
|
31
|
-
return mail.body.decoded unless mail.html_part
|
32
|
-
|
33
|
-
mail.html_part.decoded
|
34
|
-
end
|
35
|
-
|
36
|
-
def mail
|
37
|
-
@mail ||= ::Mail.new(@data[:mail])
|
10
|
+
%i[from reply_to to cc subject message_id]
|
11
|
+
.map { |field| [field, mail.public_send(field)] }
|
12
|
+
.to_h
|
13
|
+
.merge({ text_body: text_part, html_body: html_part, bcc: normalized_bcc })
|
38
14
|
end
|
39
15
|
|
40
16
|
def normalized_bcc
|
41
17
|
::Mail.new(to: @data[:bcc]).to
|
42
18
|
end
|
43
19
|
|
44
|
-
def
|
45
|
-
|
46
|
-
return true if mail.content_type.include?('text/plain')
|
47
|
-
return true if mail.multipart? && mail.text_part
|
48
|
-
|
49
|
-
false
|
50
|
-
end
|
51
|
-
|
52
|
-
def html?
|
53
|
-
return true if mail.has_content_type? && mail.content_type.include?('text/html')
|
54
|
-
return true if mail.multipart? && mail.html_part
|
55
|
-
|
56
|
-
false
|
20
|
+
def mail
|
21
|
+
@mail ||= ::Mail.new(@data[:mail])
|
57
22
|
end
|
58
23
|
end
|
59
24
|
end
|
@@ -50,6 +50,35 @@ module Postmortem
|
|
50
50
|
.map { |substring, index| index.zero? ? substring : substring.capitalize }
|
51
51
|
.join
|
52
52
|
end
|
53
|
+
|
54
|
+
def text_part
|
55
|
+
return nil unless text?
|
56
|
+
return mail.body.decoded unless mail.text_part
|
57
|
+
|
58
|
+
mail.text_part.decoded
|
59
|
+
end
|
60
|
+
|
61
|
+
def html_part
|
62
|
+
return nil unless html?
|
63
|
+
return mail.body.decoded unless mail.html_part
|
64
|
+
|
65
|
+
mail.html_part.decoded
|
66
|
+
end
|
67
|
+
|
68
|
+
def text?
|
69
|
+
return true unless mail.has_content_type?
|
70
|
+
return true if mail.content_type.include?('text/plain')
|
71
|
+
return true if mail.multipart? && mail.text_part
|
72
|
+
|
73
|
+
false
|
74
|
+
end
|
75
|
+
|
76
|
+
def html?
|
77
|
+
return true if mail.has_content_type? && mail.content_type.include?('text/html')
|
78
|
+
return true if mail.multipart? && mail.html_part
|
79
|
+
|
80
|
+
false
|
81
|
+
end
|
53
82
|
end
|
54
83
|
end
|
55
84
|
end
|
@@ -10,7 +10,7 @@ module Postmortem
|
|
10
10
|
%i[from reply_to to cc bcc subject message_id]
|
11
11
|
.map { |field| [field, mail.public_send(field)] }
|
12
12
|
.to_h
|
13
|
-
.merge({ text_body:
|
13
|
+
.merge({ text_body: text_part, html_body: html_part })
|
14
14
|
end
|
15
15
|
|
16
16
|
def mail
|
data/lib/postmortem/version.rb
CHANGED