postmail_ruby 0.1.3 → 0.1.4

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: ea81ee4f6f9e98735ba4b27011efdf339809244c4ac98a341327af73a35945fb
4
- data.tar.gz: 22269f2f1443c18229c29c23dd63b349ef3c0f19f853724ec8a03a85e2a219c3
3
+ metadata.gz: 7c5fa264c1d733166a1db09939c27525d767dc296503fb832d75791a968af57e
4
+ data.tar.gz: 01ac234e3745cfc52f728247ea6bfca7c5379a2ff80894a23db8a6d405fd28ad
5
5
  SHA512:
6
- metadata.gz: 0b9d55cf98c40f000259bdd1cf7994c902e9b4ee9d0b1d6baff7e5b63fa647ba98060d911f76538428774cc93181b2ee0aeafbfcc75a01505b80a5f8d0fa1204
7
- data.tar.gz: af2882bbb9a491a07f4aed9f47212acf50c2098d003e2d28c0006cc4b6661981b93f067bc184884e36c9785c36c512c466260fc8fe555fa9e7c105b784f6e56c
6
+ metadata.gz: 62f90ef2298e2d2d16869299d5ee6adc03b5557482eced9626fd4b7e41cba5cf95621070bc5dddf9312af4996c500ee947237ba6a47ea46e83e8f38db2711ba8
7
+ data.tar.gz: f4831553a8df684a43346026b565cf1e3cb63e33be7533c68a773f88a83fc8747812684abe71314415495172e796e8e80f70d1793f8d043cc6071980924242fc
@@ -98,12 +98,12 @@ module PostmailRuby
98
98
  # multipart messages, the first matching part "../../postmail_ruby/delivery_method""."is returned.
99
99
  # For non-multipart, the body is returned if the MIME type
100
100
  # matches. Returns nil if no matching part "../../postmail_ruby/delivery_method""."exists.
101
- def extract_part(mail, mime_type)
101
+ def extract_part(mail, mime_type_prefix)
102
102
  if mail.multipart?
103
- mail.parts.find { |p| p.mime_type&.start_with?(mime_type) }
104
- part "../../postmail_ruby/delivery_method#{'.'.decoded}"
103
+ part = mail.parts.find { |p| p.mime_type&.start_with?(mime_type_prefix) }
104
+ part&.body&.decoded
105
105
  else
106
- mail.mime_type&.start_with?(mime_type) ? mail.body.decoded : nil
106
+ mail.mime_type&.start_with?(mime_type_prefix) ? mail.body&.decoded : nil
107
107
  end
108
108
  end
109
109
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  module PostmailRuby
4
4
  # Gem version constant
5
- VERSION = '0.1.3'
5
+ VERSION = '0.1.4'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postmail_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - DAKIN Judicaël