sunabamail 0.1.1 → 0.1.2
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/app/models/sunabamail/mail.rb +14 -15
- data/app/models/sunabamail/message.rb +1 -1
- data/lib/sunabamail/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6c4339fd772c1bead6c12dbb69aa44c4271c1080a6bc15b8f0d6939609e052b2
|
|
4
|
+
data.tar.gz: 66ff4d243f7c392a25b8c11803d4133ef1ab2eaf2b3658df9165e5589a7c2790
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 87f258c54ba3f6a7ca957b52abc8ba088454365518d8120858e373247787617c2900f387254377f829e4aad7e8622e087b39f12f04244d11b87ad873c73b3b45
|
|
7
|
+
data.tar.gz: f2cb19518101926daca43e79493dd0b560b98eddb40d7e8577ce4b8237d2ae5817975969bc4e30515466f9463d94f4454bc108b5fe506b90e33485718fc293db
|
data/CHANGELOG.md
CHANGED
|
@@ -6,32 +6,28 @@ class Sunabamail::Mail
|
|
|
6
6
|
def has_text?
|
|
7
7
|
return true if text_part.present?
|
|
8
8
|
|
|
9
|
-
"text/plain" ==
|
|
9
|
+
"text/plain" == mime_type
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
def has_html?
|
|
13
13
|
return true if html_part.present?
|
|
14
14
|
|
|
15
|
-
"text/html" ==
|
|
15
|
+
"text/html" == mime_type
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
def text_body
|
|
19
19
|
if multipart?
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
elsif "text/plain" == content_type
|
|
24
|
-
body.to_s.force_encoding(mail_message.charset)
|
|
20
|
+
decoded_body(text_part)
|
|
21
|
+
elsif "text/plain" == mime_type
|
|
22
|
+
decoded_body(mail_message)
|
|
25
23
|
end
|
|
26
24
|
end
|
|
27
25
|
|
|
28
26
|
def html_body
|
|
29
27
|
if multipart?
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
elsif "text/html" == content_type
|
|
34
|
-
body.to_s.force_encoding(mail_message.charset)
|
|
28
|
+
decoded_body(html_part)
|
|
29
|
+
elsif "text/html" == mime_type
|
|
30
|
+
decoded_body(mail_message)
|
|
35
31
|
end
|
|
36
32
|
end
|
|
37
33
|
|
|
@@ -41,9 +37,12 @@ class Sunabamail::Mail
|
|
|
41
37
|
|
|
42
38
|
attr_reader :mail_message
|
|
43
39
|
|
|
44
|
-
delegate :
|
|
40
|
+
delegate :mime_type, :multipart?, :html_part, :text_part, to: :mail_message, private: true
|
|
45
41
|
|
|
46
|
-
def
|
|
47
|
-
|
|
42
|
+
def decoded_body(part)
|
|
43
|
+
return nil unless part
|
|
44
|
+
|
|
45
|
+
body = part.body.to_s.dup
|
|
46
|
+
part.charset ? body.force_encoding(part.charset) : body
|
|
48
47
|
end
|
|
49
48
|
end
|
data/lib/sunabamail/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sunabamail
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- hamajyotan
|
|
8
|
-
bindir:
|
|
8
|
+
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
@@ -101,6 +101,8 @@ licenses:
|
|
|
101
101
|
metadata:
|
|
102
102
|
homepage_uri: https://github.com/hamajyotan/sunabamail
|
|
103
103
|
source_code_uri: https://github.com/hamajyotan/sunabamail
|
|
104
|
+
changelog_uri: https://github.com/hamajyotan/sunabamail/blob/main/CHANGELOG.md
|
|
105
|
+
rubygems_mfa_required: 'true'
|
|
104
106
|
rdoc_options: []
|
|
105
107
|
require_paths:
|
|
106
108
|
- lib
|
|
@@ -115,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
115
117
|
- !ruby/object:Gem::Version
|
|
116
118
|
version: '0'
|
|
117
119
|
requirements: []
|
|
118
|
-
rubygems_version:
|
|
120
|
+
rubygems_version: 3.6.7
|
|
119
121
|
specification_version: 4
|
|
120
122
|
summary: A drop-in Action Mailer delivery method that stores emails in the database
|
|
121
123
|
instead of sending them.
|