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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ba1b63c74d80acb294e4bf377084882db2dd7f3c5d6422079923830b43405de2
4
- data.tar.gz: 7b359315a60e5c44d1ea0efbf1f049c04d7cf3258b7db5bcb53636ceacbfbe13
3
+ metadata.gz: fd3c7e0205b1225caa909fe3940cb87ab5080bc7bf1ee398cb77547f01791ed9
4
+ data.tar.gz: 577921e6e73fc4fbcca72478708b4537e576f081364a502ad80c6f1327cab742
5
5
  SHA512:
6
- metadata.gz: 57b6d1d1c02fe3f4445dfc038ef3d0762d700fca755d63a20827000d5805484a2f293f4b164bac0e22d341f24648129aa55e80f318db56243cdd32dd79dc2286
7
- data.tar.gz: '02768d56a8cf860d2328af1922354edaf7a7caff7d481a080b27cfd3102f215084692d376f260c725a15cbdbbe0e5ec4bce2c20c0517091ad5c59495645bab75'
6
+ metadata.gz: a9356b29967072434c6e5579c9520697dd02085fd61b6b23e2ff1f0bbb7f755908075d9a172281c58e0366092cbe3129eed23b1b5793f833a1a70b4bcf4d721a
7
+ data.tar.gz: a32461cce8da22998b86c30f01b5dbff8b443c5b90e1b26252b74d4818642628de570b68471f82ef082d2b0314e89c0bb011071b28354e1eb7718c141e8466dc
data/README.md CHANGED
@@ -26,7 +26,7 @@ Add the gem to your application's Gemfile:
26
26
 
27
27
  ```ruby
28
28
  group :development, :test do
29
- gem 'postmortem', '~> 0.2.4'
29
+ gem 'postmortem', '~> 0.2.5'
30
30
  end
31
31
  ```
32
32
 
data/layout/layout.css CHANGED
@@ -103,6 +103,7 @@
103
103
 
104
104
  #inbox ul {
105
105
  list-style-type: none;
106
+ width: 32rem;
106
107
  }
107
108
 
108
109
  .list-group-item {
@@ -7,53 +7,18 @@ module Postmortem
7
7
  private
8
8
 
9
9
  def adapted
10
- {
11
- from: mail.from,
12
- reply_to: mail.reply_to,
13
- to: mail.to,
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 text?
45
- return true unless mail.has_content_type?
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: mail.text_part&.decoded, html_body: mail.html_part&.decoded })
13
+ .merge({ text_body: text_part, html_body: html_part })
14
14
  end
15
15
 
16
16
  def mail
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Postmortem
4
- VERSION = '0.2.4'
4
+ VERSION = '0.2.5'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postmortem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Farrell