From 9a621ff9c0326bf1e181cc46864db773e763b5ff Mon Sep 17 00:00:00 2001 From: nownabe Date: Thu, 9 Apr 2015 10:18:24 +0900 Subject: [PATCH 1/5] Bump thread gem to 0.1.7 Resolve #112 --- sneakers.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sneakers.gemspec b/sneakers.gemspec index 9b4c5aea..6a98e8d5 100644 --- a/sneakers.gemspec +++ b/sneakers.gemspec @@ -18,7 +18,7 @@ Gem::Specification.new do |gem| gem.require_paths = ['lib'] gem.add_dependency 'serverengine', '~> 1.5.5' gem.add_dependency 'bunny', '~> 1.7.0' - gem.add_dependency 'thread', '0.1.5' + gem.add_dependency 'thread', '~> 0.1.7' gem.add_dependency 'thor' gem.add_development_dependency 'rr' From 8ee580b2ace5754e826b7732ec60ea0b652da3ba Mon Sep 17 00:00:00 2001 From: Laust Rud Jacobsen Date: Thu, 9 Apr 2015 10:35:18 +0200 Subject: [PATCH 2/5] CI: run on latest 2.2.x and 2.1.x ruby --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index efa98ff6..3c9cb286 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: ruby rvm: -- 2.2.0 -- 2.1.0 +- 2.2.1 +- 2.1.5 - 2.0.0 - 1.9.3 From ad99c531f228158e9dbc7180586d813af5ea39b7 Mon Sep 17 00:00:00 2001 From: Laust Rud Jacobsen Date: Thu, 9 Apr 2015 10:36:47 +0200 Subject: [PATCH 3/5] CI: let Travis pick minor version --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3c9cb286..be114345 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: ruby rvm: -- 2.2.1 -- 2.1.5 +- 2.2 +- 2.1 - 2.0.0 - 1.9.3 From 8e48ff3b1773c594511d9ebbb6aa6dc3f698711f Mon Sep 17 00:00:00 2001 From: Laust Rud Jacobsen Date: Thu, 9 Apr 2015 10:45:46 +0200 Subject: [PATCH 4/5] Queue#subscribe: use .fetch to avoid getting a useless nil This is part of stabilizing the specs, currently fails when run like this: `SEED=19690 rake` --- lib/sneakers/queue.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sneakers/queue.rb b/lib/sneakers/queue.rb index 88329e0f..863570c9 100644 --- a/lib/sneakers/queue.rb +++ b/lib/sneakers/queue.rb @@ -46,7 +46,7 @@ def subscribe(worker) # has the same configuration as the worker. Also pass along the exchange and # queue in case the handler requires access to them (for things like binding # retry queues, etc). - handler_klass = worker.opts[:handler] || Sneakers::CONFIG[:handler] + handler_klass = worker.opts[:handler] || Sneakers::CONFIG.fetch(:handler) handler = handler_klass.new(@channel, queue, worker.opts) @consumer = queue.subscribe(:block => false, :manual_ack => @opts[:ack]) do | delivery_info, metadata, msg | From 247f1c7f586237f412a55a54b2da6b69898dd14c Mon Sep 17 00:00:00 2001 From: Laust Rud Jacobsen Date: Thu, 9 Apr 2015 11:00:20 +0200 Subject: [PATCH 5/5] Minitest: only the last before-block is kept This should stabilize the test as configuration is now run before each test. --- spec/sneakers/queue_spec.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/spec/sneakers/queue_spec.rb b/spec/sneakers/queue_spec.rb index bc268117..dc22c397 100644 --- a/spec/sneakers/queue_spec.rb +++ b/spec/sneakers/queue_spec.rb @@ -4,10 +4,6 @@ describe Sneakers::Queue do - before do - Sneakers.configure - end - let :queue_vars do { :prefetch => 25, @@ -21,6 +17,8 @@ end before do + Sneakers.configure + @mkbunny = Object.new @mkchan = Object.new @mkex = Object.new