mandrill_batch_mailer 1.1.0 → 1.2.0

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
  SHA1:
3
- metadata.gz: 62eb5a8ab276e549611894a5e53967bc8ac6bf86
4
- data.tar.gz: 32d2bd5d65060185e34e078fbdd10a84a66ed57f
3
+ metadata.gz: 6bac2f4986ed43a2fb60b64ed86a252d06259272
4
+ data.tar.gz: de04ce3c0a9fa5e8d948c711cba4bc928162c51b
5
5
  SHA512:
6
- metadata.gz: 17f92ea6f9071ea26a2a4c23e3bc49d8fbc0364a29f0cc7e1208d67a00fb1ce2d26e4acf2c67c9b63ac48c5086aa0e9eb3166febc507bea639c71edc7cc226fb
7
- data.tar.gz: 8dfb5eb9852a1bbaa9d27f926ffe8d70c69f9158832d342067b9cb82861248f24f535048da73cb17494cb22fded20525d783e28ba45aa91ddb77564c8d746d2d
6
+ metadata.gz: a667d9c11af6eace318b242abce10936e28c8a25e4a9bc84e2f3da4adafd68ccea3368ae9ca9aa4c2762741444e0bc8cb230fcb22b76328d3f90fecd48c15f1c
7
+ data.tar.gz: fdc3623efb4bf7e56a37761fb402ed4bd41f4e6a46a7c7f5d76ff5a700404712dc3a128dcf8e7991b173a97036e465fbd9dbfc7dbc08f1c37c97d6366473c09d
@@ -8,6 +8,8 @@ module MandrillBatchMailer
8
8
  'send-template.json'
9
9
 
10
10
  config_accessor :perform_deliveries,
11
+ :open_timeout,
12
+ :read_timeout,
11
13
  :intercept_recipients,
12
14
  :interception_base_mail,
13
15
  :from_email,
@@ -15,6 +17,8 @@ module MandrillBatchMailer
15
17
  :api_key
16
18
 
17
19
  self.perform_deliveries = false
20
+ self.open_timeout = 30
21
+ self.read_timeout = 180
18
22
  self.intercept_recipients = false
19
23
  self.interception_base_mail = ''
20
24
 
@@ -196,7 +196,7 @@ module MandrillBatchMailer
196
196
 
197
197
  def send_template(params)
198
198
  if MandrillBatchMailer.perform_deliveries
199
- RestClient.post MandrillBatchMailer::ENDPOINT, params.to_json
199
+ rest_client_send params
200
200
  params
201
201
  else
202
202
  log_sending(params)
@@ -214,5 +214,14 @@ module MandrillBatchMailer
214
214
  MandrillBatchMailer.logger
215
215
  .info "Sending Mandrill Mail: #{params_inspect}"
216
216
  end
217
+
218
+ def rest_client_send(params)
219
+ RestClient::Request.execute(
220
+ method: :post,
221
+ url: MandrillBatchMailer::ENDPOINT,
222
+ payload: params.to_json,
223
+ read_timeout: MandrillBatchMailer.read_timeout,
224
+ open_timeout: MandrillBatchMailer.open_timeout)
225
+ end
217
226
  end
218
227
  end
@@ -1,3 +1,3 @@
1
1
  module MandrillBatchMailer
2
- VERSION = '1.1.0'
2
+ VERSION = '1.2.0'
3
3
  end
@@ -256,8 +256,12 @@ describe MandrillBatchMailer::BaseMailer do
256
256
  context 'when delivering', :deliver do
257
257
 
258
258
  it "calls mandrill's endoint, when performing deliveries" do
259
- expect(RestClient).to receive(:post)
260
- .with(MandrillBatchMailer::ENDPOINT, params.to_json)
259
+ expect(RestClient::Request).to receive(:execute).with(
260
+ method: :post,
261
+ url: MandrillBatchMailer::ENDPOINT,
262
+ payload: params.to_json,
263
+ read_timeout: 180,
264
+ open_timeout: 30)
261
265
  test_mailer.send :send_template, params
262
266
  end
263
267
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mandrill_batch_mailer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - schasse
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-10 00:00:00.000000000 Z
11
+ date: 2015-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport