silent_bob 0.2.1 → 0.2.8

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: 3daacb7203798bb0e82e6c0222b1cd4566c4b8feba192ea71fa6f6f1fe336cc8
4
- data.tar.gz: fb1c1f16c12e401b38641563761745819b4aabd2fc6b1d1e27d6e62ab6a94a83
3
+ metadata.gz: dbff286a926498c65e51dd7850212bc7700e537a755ee421de7d4d3b61055275
4
+ data.tar.gz: 52abe043b5b4c75c2088669b545f36bae64f7d0e3e8ed56aca96e07d40f4e847
5
5
  SHA512:
6
- metadata.gz: 21b4c6c334939eb23bef67bb390832b498ffc17e54cde689c8ba0068dd33de3c509d6103e059bdd2a124989579c5aaa857aab52c88d2c5064e6c297609e2da07
7
- data.tar.gz: c59096985c09d856367f2f4f9bb11c70ca4ac055bb6c777c83dc89b8b0b17e4cd4bb68d76e6360acfd68bca7473e6462f0c869fd809cd82fb86ba4fc3484ae65
6
+ metadata.gz: f229df5cfb50764205dc76de55596a48f3d39d2bd3b3cca0fb9ef5fd68953da6e84e8da90b1f9246d102f6d340d2aefb86dbababc8af1705b66ab5bc1c217750
7
+ data.tar.gz: d87ce48ff7475cc0f434c815a6839eea5680ec112fbfaa6ab411aace0b0c4f09d8e27bf624ca10f96c442bb4b9ea3fe1f067bf27440f2685e72738e0f0957a93
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- silent_bob (0.2.1)
4
+ silent_bob (0.2.8)
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: Base64.encode64(attachment[:body]&.to_s) }
47
+ {
48
+ name: attachment[:name],
49
+ body: Base64.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.1'.freeze
2
+ VERSION = '0.2.8'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: silent_bob
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Lobanov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-12-11 00:00:00.000000000 Z
11
+ date: 2020-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http