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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 86fa2cbd66cd2b674fc60d64b7f357924a398da46e3173d1a676b1738162692b
4
- data.tar.gz: e2f9a4c6068f887976d9829a559e2e82e5297b122574423fb009bc51e22afb3a
3
+ metadata.gz: 6c4339fd772c1bead6c12dbb69aa44c4271c1080a6bc15b8f0d6939609e052b2
4
+ data.tar.gz: 66ff4d243f7c392a25b8c11803d4133ef1ab2eaf2b3658df9165e5589a7c2790
5
5
  SHA512:
6
- metadata.gz: 97ba1d5662b8233af2c239e5e499a9ba5f288f31de768815f7a010d0b650ca8b4b5191a72cd90b4d18ebbdbf8eaeaaf38137f130cc77201031f548217def5bf1
7
- data.tar.gz: 579a729a89976eef5c1a8f2852bcd1562442592b536e5999c721316b6fa643747e0c023c4d5b71b7565ca4e94f765c472e0b8524c0ff60f77ee3f2fdfed87674
6
+ metadata.gz: 87f258c54ba3f6a7ca957b52abc8ba088454365518d8120858e373247787617c2900f387254377f829e4aad7e8622e087b39f12f04244d11b87ad873c73b3b45
7
+ data.tar.gz: f2cb19518101926daca43e79493dd0b560b98eddb40d7e8577ce4b8237d2ae5817975969bc4e30515466f9463d94f4454bc108b5fe506b90e33485718fc293db
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.2] - 2026-05-08
4
+
5
+ - fix mailer view
6
+
3
7
  ## [0.1.1] - 2026-05-07
4
8
 
5
9
  - fix Rails 7.x does't work.
@@ -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" == content_type
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" == content_type
15
+ "text/html" == mime_type
16
16
  end
17
17
 
18
18
  def text_body
19
19
  if multipart?
20
- part = text_part
21
- body = part.body
22
- body.to_s.force_encoding(part.charset)
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
- part = html_part
31
- body = part.body
32
- body.to_s.force_encoding(part.charset)
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 :content_type, :multipart?, :html_part, :text_part, to: :mail_message, private: true
40
+ delegate :mime_type, :multipart?, :html_part, :text_part, to: :mail_message, private: true
45
41
 
46
- def content_type
47
- mail_message.content_type.to_s.chomp.downcase
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
@@ -7,6 +7,6 @@ class Sunabamail::Message < Sunabamail::Record
7
7
  autosave: true
8
8
 
9
9
  def mail
10
- Mail::Message.new(raw.encoded)
10
+ Sunabamail::Mail.new(raw)
11
11
  end
12
12
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sunabamail
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
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.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - hamajyotan
8
- bindir: exe
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: 4.0.5
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.