sneakers 2.11.0 → 2.12.0.rc1

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
- SHA1:
3
- metadata.gz: b012bf95d1ffd483c544a1e58a11775dd1932726
4
- data.tar.gz: 5df9669b11a6870968f08483ae1d4bef08becbeb
2
+ SHA256:
3
+ metadata.gz: be9610cd155fbf2b5e2e74b1e287f61ac7183b7d164aa99b3402af44bfa08166
4
+ data.tar.gz: 3e9e7339d58ef8cc4ed2c638774d55dfc3ccd32e95583b0317acbdd6ec1bf83b
5
5
  SHA512:
6
- metadata.gz: 9875ccd366feeb446faaf1c7d9b2aceb8fd3712aaf67e989329eba05ee4c4dc45e0cc5df718a399eeb7302c924b2d131491db75ce9bb824162ae94a734872889
7
- data.tar.gz: 7e6e444e6801cc7ddf4bbbfcd197efe6633cda6f004bce71759414aef978669ae1b29136c9135621fffe4b40986546fe237c9b9dd4d6298862416ff5042f97e1
6
+ metadata.gz: 497640e283f35ec27da6f8b54a98c2decdf0dbdab9ccc8f73bef33ec04ac18794a6316cb2f586a4c6107e65efeec53a1711d53527d3b5a8dbd450f3ea93527f8
7
+ data.tar.gz: f78dfa2422ca9453c0b24b11b252f60aef2755429a8f296fd4636509fc4c686bd865062bcb964da6cffffba951df89fdcc4943cddd9b6528f523a533dac283e6
@@ -1,18 +1,25 @@
1
+ dist: xenial
2
+ sudo: true
3
+ language: ruby
4
+ cache: bundler
1
5
  services:
2
6
  - rabbitmq
3
7
  - redis-server
4
- sudo: false
5
- cache: bundler
6
- language: ruby
7
8
  before_install:
8
9
  - gem install bundler
10
+ before_script:
11
+ - "./bin/ci/install_on_debian.sh"
12
+ - until sudo lsof -i:5672; do echo "Waiting for RabbitMQ to start..."; sleep 1; done
9
13
  rvm:
10
14
  - ruby-head
11
- - "2.5.1"
12
- - "2.4.2"
13
- - "2.3.5"
14
- - "2.2.8"
15
+ - "2.6.1"
16
+ - "2.5.3"
17
+ - "2.4.5"
18
+ - "2.3.8"
15
19
  matrix:
16
20
  include:
17
- - rvm: 2.4.1
21
+ - rvm: "2.6.0"
18
22
  env: INTEGRATION_LOG=1 INTEGRATION=1
23
+ allow_failures:
24
+ rvm:
25
+ - ruby-head
data/Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM ruby:2.3-alpine
1
+ FROM ruby:2.3.7-alpine3.7
2
2
 
3
3
  RUN apk add --no-cache git
4
4
 
@@ -9,20 +9,16 @@ RUN apk --update add --virtual build_deps \
9
9
  linux-headers \
10
10
  openssl-dev
11
11
 
12
- RUN mkdir /myapp
13
-
14
12
  WORKDIR /sneakers
15
13
 
16
- COPY lib/sneakers/version.rb /sneakers/lib/sneakers/version.rb
17
-
18
- COPY sneakers.gemspec /sneakers/sneakers.gemspec
14
+ COPY lib/sneakers/version.rb lib/sneakers/version.rb
19
15
 
20
- COPY Gemfile /sneakers/Gemfile
16
+ COPY sneakers.gemspec .
21
17
 
22
- COPY Gemfile.lock /sneakers/Gemfile.lock
18
+ COPY Gemfile* ./
23
19
 
24
- RUN bundle --jobs=4 --retry=3
20
+ RUN bundle install --retry=3
25
21
 
26
- COPY . /sneakers
22
+ COPY . .
27
23
 
28
24
  CMD rake test
@@ -0,0 +1,17 @@
1
+ #!/bin/sh
2
+
3
+ sudo apt-get install -y wget
4
+ wget -O - "https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc" | sudo apt-key add -
5
+
6
+ sudo tee /etc/apt/sources.list.d/bintray.rabbitmq.list <<EOF
7
+ deb https://dl.bintray.com/rabbitmq-erlang/debian xenial erlang
8
+ deb https://dl.bintray.com/rabbitmq/debian xenial main
9
+ EOF
10
+
11
+ sudo apt-get update -y
12
+ sudo apt-get upgrade -y
13
+ sudo apt-get install -y rabbitmq-server
14
+
15
+ sudo service rabbitmq-server start
16
+
17
+ until sudo lsof -i:5672; do echo "Waiting for RabbitMQ to start..."; sleep 1; done
@@ -3,9 +3,13 @@ version: '3'
3
3
  services:
4
4
  sneakers:
5
5
  build: .
6
+ volumes:
7
+ - .:/sneakers
6
8
  depends_on:
7
9
  - rabbitmq
8
10
  - redis
11
+ environment:
12
+ - RABBITMQ_URL=amqp://guest:guest@rabbitmq:5672
9
13
 
10
14
  rabbitmq:
11
15
  image: rabbitmq:management-alpine
@@ -33,12 +33,7 @@ WORKER_OPTIONS = {
33
33
  #
34
34
  class MaxRetryWorker
35
35
  include Sneakers::Worker
36
- from_queue 'downloads',
37
- WORKER_OPTIONS.merge({
38
- :arguments => {
39
- :'x-dead-letter-exchange' => 'downloads-retry'
40
- },
41
- })
36
+ from_queue 'downloads', WORKER_OPTIONS
42
37
 
43
38
  def work(msg)
44
39
  logger.info("MaxRetryWorker rejecting msg: #{msg.inspect}")
@@ -52,12 +47,7 @@ end
52
47
  # see the message once.
53
48
  class SucceedingWorker
54
49
  include Sneakers::Worker
55
- from_queue 'uploads',
56
- WORKER_OPTIONS.merge({
57
- :arguments => {
58
- :'x-dead-letter-exchange' => 'uploads-retry'
59
- },
60
- })
50
+ from_queue 'uploads', WORKER_OPTIONS
61
51
 
62
52
  def work(msg)
63
53
  logger.info("SucceedingWorker succeeding on msg: #{msg.inspect}")
@@ -0,0 +1,34 @@
1
+ $: << File.expand_path('../lib', File.dirname(__FILE__))
2
+ require 'sneakers'
3
+ require 'sneakers/runner'
4
+
5
+ class MiddlewareWorker
6
+ include Sneakers::Worker
7
+
8
+ from_queue 'middleware-demo',
9
+ ack: false
10
+
11
+ def work(message)
12
+ puts "******** MiddlewareWorker -> #{message}"
13
+ end
14
+ end
15
+
16
+ class DemoMiddleware
17
+ def initialize(app, *args)
18
+ @app = app
19
+ @args = args
20
+ end
21
+
22
+ def call(deserialized_msg, delivery_info, metadata, handler)
23
+ puts "******** DemoMiddleware - before; args #{@args}"
24
+ @app.call(deserialized_msg, delivery_info, metadata, handler)
25
+ puts "******** DemoMiddleware - after"
26
+ end
27
+ end
28
+
29
+ Sneakers.configure
30
+ Sneakers.middleware.use(DemoMiddleware, foo: :bar)
31
+
32
+ Sneakers.publish("{}", :to_queue => 'middleware-demo')
33
+ r = Sneakers::Runner.new([MiddlewareWorker])
34
+ r.run
@@ -18,6 +18,7 @@ require 'sneakers/concerns/logging'
18
18
  require 'sneakers/concerns/metrics'
19
19
  require 'sneakers/handlers/oneshot'
20
20
  require 'sneakers/content_type'
21
+ require 'sneakers/middleware/config'
21
22
  require 'sneakers/worker'
22
23
  require 'sneakers/publisher'
23
24
 
@@ -87,6 +88,10 @@ module Sneakers
87
88
  CONFIG[:error_reporters]
88
89
  end
89
90
 
91
+ def middleware
92
+ @middleware ||= Sneakers::Middleware::Config
93
+ end
94
+
90
95
  private
91
96
 
92
97
  def setup_general_logger!
@@ -82,6 +82,11 @@ module Sneakers
82
82
 
83
83
  end
84
84
 
85
+ def self.configure_queue(name, opts)
86
+ retry_name = opts.fetch(:retry_exchange, "#{name}-retry")
87
+ opts.merge(arguments: { "x-dead-letter-exchange": retry_name })
88
+ end
89
+
85
90
  def acknowledge(hdr, props, msg)
86
91
  @channel.acknowledge(hdr.delivery_tag, false)
87
92
  end
@@ -134,18 +139,32 @@ module Sneakers
134
139
  error: reason.to_s,
135
140
  num_attempts: num_attempts,
136
141
  failed_at: Time.now.iso8601,
137
- payload: Base64.encode64(msg.to_s),
138
- properties: Base64.encode64(props.to_json)
142
+ properties: props.to_hash
139
143
  }.tap do |hash|
140
144
  if reason.is_a?(Exception)
141
145
  hash[:error_class] = reason.class.to_s
142
146
  hash[:error_message] = "#{reason}"
143
147
  if reason.backtrace
144
- hash[:backtrace] = reason.backtrace.take(10).join(', ')
148
+ hash[:backtrace] = reason.backtrace.take(10)
145
149
  end
146
150
  end
147
- end.to_json
148
- @error_exchange.publish(data, :routing_key => hdr.routing_key)
151
+ end
152
+
153
+ # Preserve retry log in a list
154
+ if retry_info = props[:headers]['retry_info']
155
+ old_retry0 = JSON.parse(retry_info) rescue {error: "Failed to parse retry info"}
156
+ old_retry = Array(old_retry0)
157
+ # Prevent old retry from nesting
158
+ data[:properties][:headers].delete('retry_info')
159
+ data = old_retry.unshift(data)
160
+ end
161
+
162
+ @error_exchange.publish(msg, {
163
+ routing_key: hdr.routing_key,
164
+ headers: {
165
+ retry_info: data.to_json
166
+ }
167
+ })
149
168
  @channel.acknowledge(hdr.delivery_tag, false)
150
169
  # TODO: metrics
151
170
  end
@@ -0,0 +1,23 @@
1
+ module Sneakers
2
+ module Middleware
3
+ class Config
4
+ def self.use(klass, args)
5
+ middlewares << { class: klass, args: args }
6
+ end
7
+
8
+ def self.delete(klass)
9
+ middlewares.reject! { |el| el[:class] == klass }
10
+ end
11
+
12
+ def self.to_a
13
+ middlewares
14
+ end
15
+
16
+ def self.middlewares
17
+ @middlewares ||= []
18
+ end
19
+
20
+ private_class_method :middlewares
21
+ end
22
+ end
23
+ end
@@ -31,9 +31,12 @@ class Sneakers::Queue
31
31
  routing_key = @opts[:routing_key] || @name
32
32
  routing_keys = [*routing_key]
33
33
 
34
- # TODO: get the arguments from the handler? Retry handler wants this so you
35
- # don't have to line up the queue's dead letter argument with the exchange
36
- # you'll create for retry.
34
+ handler_klass = worker.opts[:handler] || Sneakers::CONFIG.fetch(:handler)
35
+ # Configure options if needed
36
+ if handler_klass.respond_to?(:configure_queue)
37
+ @opts[:queue_options] = handler_klass.configure_queue(@name, @opts[:queue_options])
38
+ end
39
+
37
40
  queue = @channel.queue(@name, @opts[:queue_options])
38
41
 
39
42
  if exchange_name.length > 0
@@ -50,7 +53,6 @@ class Sneakers::Queue
50
53
  # has the same configuration as the worker. Also pass along the exchange and
51
54
  # queue in case the handler requires access to them (for things like binding
52
55
  # retry queues, etc).
53
- handler_klass = worker.opts[:handler] || Sneakers::CONFIG.fetch(:handler)
54
56
  handler = handler_klass.new(@channel, queue, worker.opts)
55
57
 
56
58
  @consumer = queue.subscribe(block: false, manual_ack: @opts[:ack]) do | delivery_info, metadata, msg |
@@ -1,3 +1,3 @@
1
1
  module Sneakers
2
- VERSION = "2.11.0"
2
+ VERSION = "2.12.0.rc1"
3
3
  end
@@ -57,11 +57,20 @@ module Sneakers
57
57
  metrics.increment("work.#{self.class.name}.started")
58
58
  metrics.timing("work.#{self.class.name}.time") do
59
59
  deserialized_msg = ContentType.deserialize(msg, @content_type || metadata && metadata[:content_type])
60
- if @call_with_params
61
- res = work_with_params(deserialized_msg, delivery_info, metadata)
62
- else
63
- res = work(deserialized_msg)
60
+
61
+ app = -> (deserialized_msg, delivery_info, metadata, handler) do
62
+ if @call_with_params
63
+ work_with_params(deserialized_msg, delivery_info, metadata)
64
+ else
65
+ work(deserialized_msg)
66
+ end
67
+ end
68
+
69
+ middlewares = Sneakers.middleware.to_a
70
+ block_to_call = middlewares.reverse.reduce(app) do |mem, h|
71
+ h[:class].new(mem, *h[:args])
64
72
  end
73
+ res = block_to_call.call(deserialized_msg, delivery_info, metadata, handler)
65
74
  end
66
75
  rescue StandardError, ScriptError => ex
67
76
  res = :error
@@ -1,3 +1,6 @@
1
+ #!/usr/bin/env gem build
2
+ # encoding: utf-8
3
+
1
4
  lib = File.expand_path('../lib', __FILE__)
2
5
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
6
  require 'sneakers/version'
@@ -14,27 +17,30 @@ Gem::Specification.new do |gem|
14
17
  gem.required_ruby_version = Gem::Requirement.new(">= 2.2")
15
18
 
16
19
  gem.files = `git ls-files`.split($/).reject { |f| f == 'Gemfile.lock' }
17
- gem.executables = gem.files.grep(/^bin/).map { |f| File.basename(f) }
20
+ gem.executables = gem.files.grep(/^bin/).
21
+ reject { |f| f =~ /^bin\/ci/ }.
22
+ map { |f| File.basename(f) }
18
23
  gem.test_files = gem.files.grep(/^(test|spec|features)\//)
19
24
  gem.require_paths = ['lib']
20
25
 
21
- gem.add_dependency 'serverengine', '~> 2.0.5'
22
- gem.add_dependency 'bunny', '~> 2.12'
26
+ gem.add_dependency 'serverengine', '~> 2.1.0'
27
+ gem.add_dependency 'bunny', '~> 2.14'
23
28
  gem.add_dependency 'concurrent-ruby', '~> 1.0'
24
29
  gem.add_dependency 'thor'
25
- gem.add_dependency 'rake'
30
+ gem.add_dependency 'rake', '~> 12.3'
26
31
 
27
32
  # for integration environment (see .travis.yml and integration_spec)
28
33
  gem.add_development_dependency 'rabbitmq_http_api_client'
29
34
  gem.add_development_dependency 'redis'
30
35
 
31
- gem.add_development_dependency 'rake'
32
- gem.add_development_dependency 'minitest'
33
- gem.add_development_dependency 'rr'
36
+ gem.add_development_dependency 'rake', '~> 12.3'
37
+ gem.add_development_dependency 'minitest', '~> 5.11'
38
+ gem.add_development_dependency 'rr', '~> 1.2.1'
34
39
  gem.add_development_dependency 'unparser', '0.2.2' # keep below 0.2.5 for ruby 2.0 compat.
35
- gem.add_development_dependency 'metric_fu'
36
- gem.add_development_dependency 'simplecov'
40
+ gem.add_development_dependency 'metric_fu', '~> 4.12'
41
+ gem.add_development_dependency 'simplecov', '~> 0.16'
37
42
  gem.add_development_dependency 'simplecov-rcov-text'
38
- gem.add_development_dependency 'guard'
39
- gem.add_development_dependency 'guard-minitest'
43
+ gem.add_development_dependency 'guard', '~> 2.15'
44
+ gem.add_development_dependency 'guard-minitest', '~> 2.4'
45
+ gem.add_development_dependency 'pry-byebug', '~> 3.7'
40
46
  end
@@ -234,12 +234,13 @@ describe 'Handlers' do
234
234
  @error_exchange.extend MockPublish
235
235
  worker.do_work(@header, @props_with_x_death, :reject, @handler)
236
236
  @error_exchange.called.must_equal(true)
237
- @error_exchange.opts.must_equal({ :routing_key => '#' })
238
- data = JSON.parse(@error_exchange.data)
237
+ @error_exchange.opts[:routing_key].must_equal('#')
238
+ data = JSON.parse(@error_exchange.opts[:headers][:retry_info]) rescue nil
239
+ data.wont_be_nil
239
240
  data['error'].must_equal('reject')
240
241
  data['num_attempts'].must_equal(2)
241
- data['payload'].must_equal(Base64.encode64(:reject.to_s))
242
- data['properties'].must_equal(Base64.encode64(@props_with_x_death.to_json))
242
+ @error_exchange.data.must_equal(:reject)
243
+ data['properties'].to_json.must_equal(@props_with_x_death.to_json)
243
244
  Time.parse(data['failed_at']).wont_be_nil
244
245
  end
245
246
 
@@ -250,12 +251,13 @@ describe 'Handlers' do
250
251
  @error_exchange.extend MockPublish
251
252
  worker.do_work(@header, props_with_x_death_count, :reject, @handler)
252
253
  @error_exchange.called.must_equal(true)
253
- @error_exchange.opts.must_equal({ :routing_key => '#' })
254
- data = JSON.parse(@error_exchange.data)
254
+ @error_exchange.opts[:routing_key].must_equal('#')
255
+ data = JSON.parse(@error_exchange.opts[:headers][:retry_info]) rescue nil
256
+ data.wont_be_nil
255
257
  data['error'].must_equal('reject')
256
258
  data['num_attempts'].must_equal(4)
257
- data['payload'].must_equal(Base64.encode64(:reject.to_s))
258
- data['properties'].must_equal(Base64.encode64(props_with_x_death_count.to_json))
259
+ @error_exchange.data.must_equal(:reject)
260
+ data['properties'].to_json.must_equal(props_with_x_death_count.to_json)
259
261
  Time.parse(data['failed_at']).wont_be_nil
260
262
  end
261
263
 
@@ -300,14 +302,15 @@ describe 'Handlers' do
300
302
 
301
303
  worker.do_work(@header, @props_with_x_death, StandardError.new('boom!'), @handler)
302
304
  @error_exchange.called.must_equal(true)
303
- @error_exchange.opts.must_equal({ :routing_key => '#' })
304
- data = JSON.parse(@error_exchange.data)
305
+ @error_exchange.opts[:routing_key].must_equal('#')
306
+ data = JSON.parse(@error_exchange.opts[:headers][:retry_info]) rescue nil
307
+ data.wont_be_nil
305
308
  data['error'].must_equal('boom!')
306
309
  data['error_class'].must_equal(StandardError.to_s)
307
310
  data['backtrace'].wont_be_nil
308
311
  data['num_attempts'].must_equal(2)
309
- data['payload'].must_equal(Base64.encode64('boom!'))
310
- data['properties'].must_equal(Base64.encode64(@props_with_x_death.to_json))
312
+ @error_exchange.data.to_s.must_equal('boom!')
313
+ data['properties'].to_json.must_equal(@props_with_x_death.to_json)
311
314
  Time.parse(data['failed_at']).wont_be_nil
312
315
  end
313
316
  end
@@ -392,6 +392,61 @@ describe Sneakers::Worker do
392
392
  w.do_work(header, nil, "msg", handler)
393
393
  end
394
394
 
395
+ describe 'middleware' do
396
+ let(:middleware) do
397
+ Class.new do
398
+ def initialize(app, *args)
399
+ @app = app
400
+ end
401
+
402
+ def call(deserialized_msg, delivery_info, metadata, handler)
403
+ @app.call(deserialized_msg, delivery_info, metadata, handler)
404
+ end
405
+ end
406
+ end
407
+
408
+ let(:worker) do
409
+ Class.new do
410
+ include Sneakers::Worker
411
+ from_queue 'defaults', ack: false
412
+
413
+ def work_with_params(msg, delivery_info, metadata)
414
+ msg
415
+ end
416
+ end
417
+ end
418
+
419
+ before do
420
+ Sneakers.middleware.use(middleware, 'args')
421
+
422
+ @delivery_info = Object.new
423
+ @metadata = Object.new
424
+ stub(@metadata).[](:content_type) { 'some/fake' }
425
+ @message = Object.new
426
+ @handler = Object.new
427
+ end
428
+
429
+ after do
430
+ Sneakers.middleware.delete(middleware)
431
+ end
432
+
433
+ it 'should process job and call #work_with_params/#work' do
434
+ w = worker.new(@queue, TestPool.new)
435
+ mock(w).work_with_params(@message, @delivery_info, @metadata).once
436
+
437
+ w.do_work(@delivery_info, @metadata, @message, @handler)
438
+ end
439
+
440
+ it "should call registered middleware" do
441
+ mock.proxy(middleware).new(instance_of(Proc), 'args').once do |res|
442
+ mock.proxy(res).call(@message, @delivery_info, @metadata, @handler).once
443
+ end
444
+
445
+ w = worker.new(@queue, TestPool.new)
446
+ w.do_work(@delivery_info, @metadata, @message, @handler)
447
+ end
448
+ end
449
+
395
450
  describe "with ack" do
396
451
  before do
397
452
  @delivery_info = Object.new
@@ -1,6 +1,7 @@
1
1
  require 'bundler/setup'
2
2
  require 'simplecov'
3
3
  require 'resolv'
4
+ require 'pry-byebug'
4
5
 
5
6
  SimpleCov.start do
6
7
  add_filter "/spec/"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sneakers
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.11.0
4
+ version: 2.12.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dotan Nahum
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-19 00:00:00.000000000 Z
11
+ date: 2019-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: serverengine
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.0.5
19
+ version: 2.1.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.0.5
26
+ version: 2.1.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bunny
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '2.12'
33
+ version: '2.14'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '2.12'
40
+ version: '2.14'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: concurrent-ruby
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -70,16 +70,16 @@ dependencies:
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: '12.3'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: '12.3'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rabbitmq_http_api_client
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -112,44 +112,44 @@ dependencies:
112
112
  name: rake
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ">="
115
+ - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '0'
117
+ version: '12.3'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ">="
122
+ - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '0'
124
+ version: '12.3'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: minitest
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ">="
129
+ - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: '0'
131
+ version: '5.11'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ">="
136
+ - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: '0'
138
+ version: '5.11'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: rr
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - ">="
143
+ - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: '0'
145
+ version: 1.2.1
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - ">="
150
+ - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: '0'
152
+ version: 1.2.1
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: unparser
155
155
  requirement: !ruby/object:Gem::Requirement
@@ -168,30 +168,30 @@ dependencies:
168
168
  name: metric_fu
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - ">="
171
+ - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: '0'
173
+ version: '4.12'
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
- - - ">="
178
+ - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: '0'
180
+ version: '4.12'
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: simplecov
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
- - - ">="
185
+ - - "~>"
186
186
  - !ruby/object:Gem::Version
187
- version: '0'
187
+ version: '0.16'
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
- - - ">="
192
+ - - "~>"
193
193
  - !ruby/object:Gem::Version
194
- version: '0'
194
+ version: '0.16'
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: simplecov-rcov-text
197
197
  requirement: !ruby/object:Gem::Requirement
@@ -210,30 +210,44 @@ dependencies:
210
210
  name: guard
211
211
  requirement: !ruby/object:Gem::Requirement
212
212
  requirements:
213
- - - ">="
213
+ - - "~>"
214
214
  - !ruby/object:Gem::Version
215
- version: '0'
215
+ version: '2.15'
216
216
  type: :development
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
- - - ">="
220
+ - - "~>"
221
221
  - !ruby/object:Gem::Version
222
- version: '0'
222
+ version: '2.15'
223
223
  - !ruby/object:Gem::Dependency
224
224
  name: guard-minitest
225
225
  requirement: !ruby/object:Gem::Requirement
226
226
  requirements:
227
- - - ">="
227
+ - - "~>"
228
228
  - !ruby/object:Gem::Version
229
- version: '0'
229
+ version: '2.4'
230
230
  type: :development
231
231
  prerelease: false
232
232
  version_requirements: !ruby/object:Gem::Requirement
233
233
  requirements:
234
- - - ">="
234
+ - - "~>"
235
235
  - !ruby/object:Gem::Version
236
- version: '0'
236
+ version: '2.4'
237
+ - !ruby/object:Gem::Dependency
238
+ name: pry-byebug
239
+ requirement: !ruby/object:Gem::Requirement
240
+ requirements:
241
+ - - "~>"
242
+ - !ruby/object:Gem::Version
243
+ version: '3.7'
244
+ type: :development
245
+ prerelease: false
246
+ version_requirements: !ruby/object:Gem::Requirement
247
+ requirements:
248
+ - - "~>"
249
+ - !ruby/object:Gem::Version
250
+ version: '3.7'
237
251
  description: " Fast background processing framework for Ruby and RabbitMQ "
238
252
  email:
239
253
  - jondotan@gmail.com
@@ -252,11 +266,13 @@ files:
252
266
  - LICENSE.txt
253
267
  - README.md
254
268
  - Rakefile
269
+ - bin/ci/install_on_debian.sh
255
270
  - bin/sneakers
256
271
  - docker-compose.yml
257
272
  - examples/benchmark_worker.rb
258
273
  - examples/max_retry_handler.rb
259
274
  - examples/metrics_worker.rb
275
+ - examples/middleware_worker.rb
260
276
  - examples/newrelic_metrics_worker.rb
261
277
  - examples/profiling_worker.rb
262
278
  - examples/sneakers.conf.rb.example
@@ -276,6 +292,7 @@ files:
276
292
  - lib/sneakers/metrics/newrelic_metrics.rb
277
293
  - lib/sneakers/metrics/null_metrics.rb
278
294
  - lib/sneakers/metrics/statsd_metrics.rb
295
+ - lib/sneakers/middleware/config.rb
279
296
  - lib/sneakers/publisher.rb
280
297
  - lib/sneakers/queue.rb
281
298
  - lib/sneakers/runner.rb
@@ -322,12 +339,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
322
339
  version: '2.2'
323
340
  required_rubygems_version: !ruby/object:Gem::Requirement
324
341
  requirements:
325
- - - ">="
342
+ - - ">"
326
343
  - !ruby/object:Gem::Version
327
- version: '0'
344
+ version: 1.3.1
328
345
  requirements: []
329
- rubyforge_project:
330
- rubygems_version: 2.6.8
346
+ rubygems_version: 3.0.2
331
347
  signing_key:
332
348
  specification_version: 4
333
349
  summary: Fast background processing framework for Ruby and RabbitMQ