shoryuken 4.0.1 → 4.0.2

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
  SHA1:
3
- metadata.gz: 1f28614380213b13c17dea0f85aae332f8e335f6
4
- data.tar.gz: 34e084982c8aa8ec9b0306f04f548cc1321eec13
3
+ metadata.gz: 020543c4df213954780e2db9436ab1ff93d481c5
4
+ data.tar.gz: fe7346621ec5e094ff5d13fcfb12591595ab678e
5
5
  SHA512:
6
- metadata.gz: 40a160284600447798e3e1ebc61ec1e8bf596b0aa9d5558301d7f647e1ab1af285b845a9ec052eb52e157714d4066d3888f6f2192762898d9fc52decf1503a3b
7
- data.tar.gz: 7f3d7584167804ad724dc3ca3a661cef8a4a60cadccebe333ceacb10333c0eb1bc7db9247439ddce875a1b7cb771769e9516afcda0ae5703991db780acd165d3
6
+ metadata.gz: f902d276c0255c23c2103375aac35f545fd8a3ad477e940a0f2628ed6d00874aa5dab09731f8c1554ebf1a9426b858075f16b20921c08536e54c26424f34de16
7
+ data.tar.gz: b95c4a300b3df721c5a11a7871870b08d77068bdabb46773d276dc98d040f56a66407e5dc6a6cda08d843d5f69ccc1d953ce6e718e593a0950c8da344bc45ec7
@@ -1,3 +1,14 @@
1
+ ## [v4.0.2] - 2018-11-26
2
+
3
+ - Fix the delegated methods to public warning
4
+ - [#536](https://github.com/phstc/shoryuken/pull/536)
5
+
6
+ - Specify exception class to `raise_error` matcher warning
7
+ - [#537](https://github.com/phstc/shoryuken/pull/537)
8
+
9
+ - Fix spelling of "visibility"
10
+ - [#538](https://github.com/phstc/shoryuken/pull/538)
11
+
1
12
  ## [v4.0.1] - 2018-11-21
2
13
 
3
14
  - Allow caching visibility_timeout lookups
@@ -78,8 +78,8 @@ module Shoryuken
78
78
  :on_start,
79
79
  :on_stop,
80
80
  :on,
81
- :cache_visiblity_timeout?,
82
- :cache_visiblity_timeout=
81
+ :cache_visibility_timeout?,
82
+ :cache_visibility_timeout=
83
83
  )
84
84
  end
85
85
 
@@ -23,7 +23,7 @@ module Shoryuken
23
23
  @@stop_callback = nil
24
24
  @@worker_executor = Worker::DefaultExecutor
25
25
  @@launcher_executor = nil
26
- @@cache_visiblity_timeout = false
26
+ @@cache_visibility_timeout = false
27
27
 
28
28
  class << self
29
29
  def active_job?
@@ -199,6 +199,18 @@ module Shoryuken
199
199
  options[:lifecycle_events][event] << block
200
200
  end
201
201
 
202
+ def server?
203
+ defined?(Shoryuken::CLI)
204
+ end
205
+
206
+ def cache_visibility_timeout?
207
+ @@cache_visibility_timeout
208
+ end
209
+
210
+ def cache_visibility_timeout=(cache_visibility_timeout)
211
+ @@cache_visibility_timeout = cache_visibility_timeout
212
+ end
213
+
202
214
  private
203
215
 
204
216
  def default_server_middleware
@@ -217,18 +229,6 @@ module Shoryuken
217
229
  def default_client_middleware
218
230
  Middleware::Chain.new
219
231
  end
220
-
221
- def server?
222
- defined?(Shoryuken::CLI)
223
- end
224
-
225
- def cache_visiblity_timeout?
226
- @@cache_visiblity_timeout
227
- end
228
-
229
- def cache_visiblity_timeout=(cache_visiblity_timeout)
230
- @@cache_visiblity_timeout = cache_visiblity_timeout
231
- end
232
232
  end
233
233
  end
234
234
  end
@@ -14,9 +14,9 @@ module Shoryuken
14
14
  end
15
15
 
16
16
  def visibility_timeout
17
- # Always lookup for the latest visiblity when cache is disabled
17
+ # Always lookup for the latest visibility when cache is disabled
18
18
  # setting it to nil, forces re-lookup
19
- @_visibility_timeout = nil unless Shoryuken.cache_visiblity_timeout?
19
+ @_visibility_timeout = nil unless Shoryuken.cache_visibility_timeout?
20
20
  @_visibility_timeout ||= queue_attributes.attributes[VISIBILITY_TIMEOUT_ATTR].to_i
21
21
  end
22
22
 
@@ -1,3 +1,3 @@
1
1
  module Shoryuken
2
- VERSION = '4.0.1'.freeze
2
+ VERSION = '4.0.2'.freeze
3
3
  end
@@ -53,7 +53,7 @@ RSpec.describe Shoryuken::Middleware::Server::AutoExtendVisibility do
53
53
  allow(sqs_msg).to receive(:queue) { sqs_queue }
54
54
  expect(sqs_msg).to_not receive(:change_visibility)
55
55
 
56
- expect { Runner.new.run_and_raise(TestWorker.new, queue, sqs_msg) }.to raise_error
56
+ expect { Runner.new.run_and_raise(TestWorker.new, queue, sqs_msg) }.to raise_error(RuntimeError)
57
57
  end
58
58
 
59
59
  it 'does not extend message visibility if auto_visibility_timeout is not true' do
@@ -235,7 +235,7 @@ RSpec.describe Shoryuken::Queue do
235
235
  end
236
236
  end
237
237
 
238
- describe '#visiblity_timeout' do
238
+ describe '#visibility_timeout' do
239
239
  let(:attribute_response) { double 'Aws::SQS::Types::GetQueueAttributesResponse' }
240
240
 
241
241
  before do
@@ -247,7 +247,7 @@ RSpec.describe Shoryuken::Queue do
247
247
 
248
248
  context 'when cache is disabled' do
249
249
  specify do
250
- Shoryuken.cache_visiblity_timeout = false
250
+ Shoryuken.cache_visibility_timeout = false
251
251
 
252
252
  expect(sqs).to(
253
253
  receive(:get_queue_attributes).with(queue_url: queue_url, attribute_names: ['All']).and_return(attribute_response).exactly(3).times
@@ -260,7 +260,7 @@ RSpec.describe Shoryuken::Queue do
260
260
 
261
261
  context 'when cache is enabled' do
262
262
  it 'memoizes response' do
263
- Shoryuken.cache_visiblity_timeout = true
263
+ Shoryuken.cache_visibility_timeout = true
264
264
 
265
265
  expect(sqs).to(
266
266
  receive(:get_queue_attributes).with(queue_url: queue_url, attribute_names: ['All']).and_return(attribute_response).once
@@ -61,7 +61,7 @@ RSpec.configure do |config|
61
61
 
62
62
  Shoryuken.sqs_client_receive_message_opts.clear
63
63
 
64
- Shoryuken.cache_visiblity_timeout = false
64
+ Shoryuken.cache_visibility_timeout = false
65
65
 
66
66
  allow(Concurrent).to receive(:global_io_executor).and_return(Concurrent::ImmediateExecutor.new)
67
67
  allow(Shoryuken).to receive(:active_job?).and_return(false)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shoryuken
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.1
4
+ version: 4.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pablo Cantero
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-21 00:00:00.000000000 Z
11
+ date: 2018-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler