silent_bob 0.2.3 → 0.2.9

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: 80240cd3062a40fabd16dbdda7ed291db63b11dfb89972dfb236aa629904aa53
4
- data.tar.gz: ddc063c94ff73458afed7d164ea5864b2130d1073c2ae05d6b32eb314ccd19a2
3
+ metadata.gz: 002f2463f5cb15d79dd382111f5cb8d91b86cea2bccd3014a19a48de566c4f2b
4
+ data.tar.gz: 9bba86f2243bd276bdaf15a3a2fd42325395bc72aba5f905bac16c4980c9cfdf
5
5
  SHA512:
6
- metadata.gz: 726b2b32521e0c31a7ecea22b7384ece0af29a21ac57dce1beed9b3b5f1abc39633279488a7a91ce814b0f8aebb23e265e5d25b1511f30f40a5d15c60d917b7b
7
- data.tar.gz: 9bed5c1856eb96ad3210f0e612e152b2cf310cb995a5f28fb8781c6dab929153f157e24e6c871ebfe56b69456a93baaf86b4b8a4fb124518b6d159acc767942f
6
+ metadata.gz: e1b6b90687b1cf4a7ac57f3fda9203aefd86edd11d534ec6625c636fe9b5f3f53d3a890ec2fdbdcdd5f828e589feee7d656eedca7ee7bf460819b1d22b6fa0d6
7
+ data.tar.gz: a98f80aabea845d84fdb4db02a17282101bcaedc36d9e921d30bef170adaec8733e4a3f7206cfb06a4acdee4079b4868e8a15024543c13bb5b074299a2d748cc
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- silent_bob (0.2.3)
4
+ silent_bob (0.2.9)
5
5
  http (~> 4.3)
6
6
  mail (~> 2.5)
7
7
 
@@ -2,6 +2,7 @@ require 'silent_bob/version'
2
2
  require 'openssl'
3
3
  require 'http'
4
4
  require 'base64'
5
+ require 'mail'
5
6
  require 'silent_bob/configuration'
6
7
  require 'silent_bob/configuration_keeper'
7
8
  require 'silent_bob/delivery'
@@ -44,8 +44,16 @@ module SilentBob
44
44
 
45
45
  def handle_attachments(attachments)
46
46
  attachments&.map do |attachment|
47
- { name: attachment[:name], body: attachment[:body]&.to_s }
47
+ {
48
+ name: attachment[:name],
49
+ body: Base64.strict_encode64(attachment_body(attachment))
50
+ }
48
51
  end
49
52
  end
53
+
54
+ def attachment_body(attachment)
55
+ body = attachment[:body]
56
+ body.respond_to?(:decoded) ? body.decoded&.to_s : body.to_s
57
+ end
50
58
  end
51
59
  end
@@ -1,3 +1,3 @@
1
1
  module SilentBob
2
- VERSION = '0.2.3'.freeze
2
+ VERSION = '0.2.9'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: silent_bob
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Lobanov