ears 0.14.1 → 0.16.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
  SHA256:
3
- metadata.gz: 076c414b4a4d481063324314d0b25408c63eb65c7257487941ae887ecdcaf39d
4
- data.tar.gz: e10d6b0695cc02844f848c3a83c628b1ac1a06cacf34d426d21709cb4ea98039
3
+ metadata.gz: 97a4067927280d2a5367f6599a7eeb1cae8992caacdf79a08851d5fd21e16412
4
+ data.tar.gz: ebf13af8ab7b40d5ac0b74cc6d806859bcae47b46f2ef4c6a100de5608285b69
5
5
  SHA512:
6
- metadata.gz: 7639a6815f7ecedbf9ffcb359d4a531fabe7375e53c9e64cd036c898dabd99ed91d3458bb663e60b6164d8a5277e8fe9768ff8644f1f6b1a1f6200c3f59848fe
7
- data.tar.gz: d97d703e7b6a644256652a9757c5ddc89f8fa70959842dc71a526ef5e3574611101a2bd49567a0c5817e44db3951627b2a3370e0788942b76da0846b82b16160
6
+ metadata.gz: fc4784e787545424493f33826ddf84741411333f58a4281e49d942323916ca5db6878ed0ca317e085fab00c7c291be249e0996fb2706e12ed4face0420a74bb0
7
+ data.tar.gz: 0b7a0c22d72fd7873579e4706f02013f8e471247083d238f47abe7defd1b03d078e77f9d0d14550c33812a4552a85c66f7d8c8fbc4630fc034d85ec90f707b77
@@ -12,7 +12,7 @@ jobs:
12
12
  runs-on: ubuntu-latest
13
13
  strategy:
14
14
  matrix:
15
- ruby-version: ['2.7', '3.0', '3.1', '3.2', '3.3']
15
+ ruby-version: ['3.0', '3.1', '3.2', '3.3', '3.4']
16
16
 
17
17
  steps:
18
18
  - uses: actions/checkout@v4
@@ -23,7 +23,7 @@ jobs:
23
23
  bundler-cache: true
24
24
  - uses: actions/setup-node@v4
25
25
  with:
26
- node-version: '22'
26
+ node-version: '23'
27
27
  - name: Run prettier
28
28
  run: npm ci && npm run lint
29
29
  - name: Run Rubocop
data/.rubocop.yml CHANGED
@@ -11,7 +11,7 @@ AllCops:
11
11
  - Guardfile
12
12
  - bin/*
13
13
  - tmp/**/*
14
- TargetRubyVersion: 2.7
14
+ TargetRubyVersion: 3.0
15
15
  NewCops: enable
16
16
 
17
17
  Style:
data/.tool-versions CHANGED
@@ -1,2 +1,2 @@
1
- ruby 2.7.8
2
- nodejs 22.5.1
1
+ ruby 3.0.7
2
+ nodejs 23.6.0
data/CHANGELOG.md CHANGED
@@ -1,13 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.16.0 (2025-01-08)
4
+
5
+ - Enhance Consumer#configure method to accept threads option, which will be passed to Ears::Setup.
6
+
7
+ ## 0.15.0 (2025-01-14)
8
+
9
+ - Drop support for ruby 2.7
10
+ - Add support for ruby 3.4
11
+
3
12
  ## 0.14.1 (2024-07-31)
4
13
 
5
14
  - Add instrumentation around block in Appsignal middleware
6
15
 
7
16
  ## 0.14.0 (2024-07-29)
8
17
 
9
- - **[Breaking]** Adjust Appsignal middleware to use `Appsignal.monitor`.
10
- To use the middleware the `appsignal` gem in version `>= 3.11.0` is required.
18
+ - **[Breaking]** Adjust Appsignal middleware to use `Appsignal.monitor`.
19
+ To use the middleware the `appsignal` gem in version `>= 3.11.0` is required.
11
20
  The configuration of the middleware changed and now only requires one option `class_name` and an optional `namespace`.
12
21
 
13
22
  ## 0.13.0 (2023-11-07)
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ears (0.14.1)
5
- bunny (~> 2.22.0)
4
+ ears (0.16.0)
5
+ bunny (>= 2.22.0)
6
6
  multi_json
7
7
 
8
8
  GEM
@@ -10,7 +10,7 @@ GEM
10
10
  specs:
11
11
  amq-protocol (2.3.2)
12
12
  ast (2.4.2)
13
- bunny (2.22.0)
13
+ bunny (2.23.0)
14
14
  amq-protocol (~> 2.3, >= 2.3.1)
15
15
  sorted_set (~> 1, >= 1.0.2)
16
16
  diff-lcs (1.5.1)
@@ -19,11 +19,12 @@ GEM
19
19
  temple (>= 0.8.2)
20
20
  thor
21
21
  tilt
22
- json (2.7.2)
22
+ json (2.9.1)
23
23
  language_server-protocol (3.17.0.3)
24
+ logger (1.6.5)
24
25
  multi_json (1.15.0)
25
- parallel (1.25.1)
26
- parser (3.3.4.0)
26
+ parallel (1.26.3)
27
+ parser (3.3.6.0)
27
28
  ast (~> 2.4.1)
28
29
  racc
29
30
  prettier (4.0.4)
@@ -31,56 +32,53 @@ GEM
31
32
  syntax_tree-haml (>= 2.0.0)
32
33
  syntax_tree-rbs (>= 0.2.0)
33
34
  prettier_print (1.2.1)
34
- racc (1.8.0)
35
+ racc (1.8.1)
35
36
  rainbow (3.1.1)
36
37
  rake (13.2.1)
37
- rbs (3.1.3)
38
+ rbs (3.6.1)
39
+ logger
38
40
  rbtree (0.4.6)
39
- regexp_parser (2.9.2)
40
- rexml (3.3.2)
41
- strscan
41
+ regexp_parser (2.10.0)
42
42
  rspec (3.13.0)
43
43
  rspec-core (~> 3.13.0)
44
44
  rspec-expectations (~> 3.13.0)
45
45
  rspec-mocks (~> 3.13.0)
46
- rspec-core (3.13.0)
46
+ rspec-core (3.13.2)
47
47
  rspec-support (~> 3.13.0)
48
- rspec-expectations (3.13.1)
48
+ rspec-expectations (3.13.3)
49
49
  diff-lcs (>= 1.2.0, < 2.0)
50
50
  rspec-support (~> 3.13.0)
51
- rspec-mocks (3.13.1)
51
+ rspec-mocks (3.13.2)
52
52
  diff-lcs (>= 1.2.0, < 2.0)
53
53
  rspec-support (~> 3.13.0)
54
- rspec-support (3.13.1)
55
- rubocop (1.65.0)
54
+ rspec-support (3.13.2)
55
+ rubocop (1.70.0)
56
56
  json (~> 2.3)
57
57
  language_server-protocol (>= 3.17.0)
58
58
  parallel (~> 1.10)
59
59
  parser (>= 3.3.0.2)
60
60
  rainbow (>= 2.2.2, < 4.0)
61
- regexp_parser (>= 2.4, < 3.0)
62
- rexml (>= 3.2.5, < 4.0)
63
- rubocop-ast (>= 1.31.1, < 2.0)
61
+ regexp_parser (>= 2.9.3, < 3.0)
62
+ rubocop-ast (>= 1.36.2, < 2.0)
64
63
  ruby-progressbar (~> 1.7)
65
- unicode-display_width (>= 2.4.0, < 3.0)
66
- rubocop-ast (1.31.3)
64
+ unicode-display_width (>= 2.4.0, < 4.0)
65
+ rubocop-ast (1.37.0)
67
66
  parser (>= 3.3.1.0)
68
67
  rubocop-rake (0.6.0)
69
68
  rubocop (~> 1.0)
70
- rubocop-rspec (3.0.3)
69
+ rubocop-rspec (3.3.0)
71
70
  rubocop (~> 1.61)
72
71
  ruby-progressbar (1.13.0)
73
- set (1.0.4)
72
+ set (1.1.1)
74
73
  simplecov (0.22.0)
75
74
  docile (~> 1.1)
76
75
  simplecov-html (~> 0.11)
77
76
  simplecov_json_formatter (~> 0.1)
78
- simplecov-html (0.12.3)
77
+ simplecov-html (0.13.1)
79
78
  simplecov_json_formatter (0.1.4)
80
79
  sorted_set (1.0.3)
81
80
  rbtree
82
81
  set (~> 1.0)
83
- strscan (3.1.0)
84
82
  syntax_tree (6.2.0)
85
83
  prettier_print (>= 1.2.0)
86
84
  syntax_tree-haml (4.0.3)
@@ -92,10 +90,12 @@ GEM
92
90
  rbs
93
91
  syntax_tree (>= 2.0.1)
94
92
  temple (0.10.3)
95
- thor (1.3.1)
96
- tilt (2.4.0)
97
- unicode-display_width (2.5.0)
98
- yard (0.9.36)
93
+ thor (1.3.2)
94
+ tilt (2.6.0)
95
+ unicode-display_width (3.1.4)
96
+ unicode-emoji (~> 4.0, >= 4.0.4)
97
+ unicode-emoji (4.0.4)
98
+ yard (0.9.37)
99
99
 
100
100
  PLATFORMS
101
101
  arm64-darwin-20
@@ -119,4 +119,4 @@ DEPENDENCIES
119
119
  yard
120
120
 
121
121
  BUNDLED WITH
122
- 2.4.22
122
+ 2.5.23
data/ears.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.description = 'A gem for building RabbitMQ consumers.'
11
11
  spec.homepage = 'https://github.com/ivx/ears'
12
12
  spec.license = 'MIT'
13
- spec.required_ruby_version = Gem::Requirement.new('>= 2.7.7')
13
+ spec.required_ruby_version = Gem::Requirement.new('>= 3.0.7')
14
14
 
15
15
  spec.metadata['allowed_push_host'] = 'https://rubygems.org'
16
16
 
@@ -32,6 +32,6 @@ Gem::Specification.new do |spec|
32
32
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
33
33
  spec.require_paths = ['lib']
34
34
 
35
- spec.add_dependency 'bunny', '~> 2.22.0'
35
+ spec.add_dependency 'bunny', '>= 2.22.0'
36
36
  spec.add_dependency 'multi_json'
37
37
  end
data/lib/ears/consumer.rb CHANGED
@@ -40,6 +40,7 @@ module Ears
40
40
  # @option opts [Boolean] :error_queue (false) Whether an error queue should be provided.
41
41
  # @option opts [Boolean] :durable_exchange (true) Whether the exchange should be durable.
42
42
  # @option opts [Symbol] :exchange_type (:topic) The type of exchange to use.
43
+ # @option opts [Integer] :threads (1) The number of threads to use for this consumer.
43
44
  def self.configure(opts = {})
44
45
  self.queue = opts.fetch(:queue)
45
46
  self.exchange = opts.fetch(:exchange)
@@ -47,6 +48,7 @@ module Ears
47
48
  self.queue_options = queue_options_from(opts: opts)
48
49
  self.durable_exchange = opts.fetch(:durable_exchange, true)
49
50
  self.exchange_type = opts.fetch(:exchange_type, :topic)
51
+ self.threads = opts.fetch(:threads, 1)
50
52
  end
51
53
 
52
54
  # The method that is called when a message from the queue is received.
@@ -130,7 +132,8 @@ module Ears
130
132
  :routing_keys,
131
133
  :queue_options,
132
134
  :durable_exchange,
133
- :exchange_type
135
+ :exchange_type,
136
+ :threads
134
137
 
135
138
  private
136
139
 
@@ -148,7 +151,8 @@ module Ears
148
151
  :routing_keys,
149
152
  :queue_options,
150
153
  :durable_exchange,
151
- :exchange_type
154
+ :exchange_type,
155
+ :threads
152
156
  end
153
157
  end
154
158
  end
data/lib/ears/setup.rb CHANGED
@@ -77,7 +77,7 @@ module Ears
77
77
  configured_queue =
78
78
  queue(consumer_class.queue, consumer_class.queue_options)
79
79
  bind_queue_to_routing_keys(consumer_class, exchange, configured_queue)
80
- consumer(configured_queue, consumer_class)
80
+ consumer(configured_queue, consumer_class, consumer_class.threads)
81
81
  end
82
82
 
83
83
  def bind_queue_to_routing_keys(consumer_class, exchange, configured_queue)
data/lib/ears/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ears
2
- VERSION = '0.14.1'
2
+ VERSION = '0.16.0'
3
3
  end
data/package-lock.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "devDependencies": {
9
9
  "@invisionag/prettier-config": "^2.1.3",
10
10
  "@prettier/plugin-ruby": "^4.0.4",
11
- "prettier": "^3.3.3"
11
+ "prettier": "^3.4.2"
12
12
  }
13
13
  },
14
14
  "node_modules/@invisionag/prettier-config": {
@@ -30,9 +30,9 @@
30
30
  }
31
31
  },
32
32
  "node_modules/prettier": {
33
- "version": "3.3.3",
34
- "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz",
35
- "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==",
33
+ "version": "3.4.2",
34
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz",
35
+ "integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==",
36
36
  "dev": true,
37
37
  "license": "MIT",
38
38
  "bin": {
@@ -62,9 +62,9 @@
62
62
  "requires": {}
63
63
  },
64
64
  "prettier": {
65
- "version": "3.3.3",
66
- "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz",
67
- "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==",
65
+ "version": "3.4.2",
66
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz",
67
+ "integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==",
68
68
  "dev": true
69
69
  }
70
70
  }
data/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "devDependencies": {
10
10
  "@invisionag/prettier-config": "^2.1.3",
11
11
  "@prettier/plugin-ruby": "^4.0.4",
12
- "prettier": "^3.3.3"
12
+ "prettier": "^3.4.2"
13
13
  },
14
14
  "prettier": "@invisionag/prettier-config/ruby"
15
15
  }
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ears
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.1
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - InVision AG
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-01 00:00:00.000000000 Z
11
+ date: 2025-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 2.22.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
26
  version: 2.22.0
27
27
  - !ruby/object:Gem::Dependency
@@ -85,7 +85,7 @@ metadata:
85
85
  homepage_uri: https://github.com/ivx/ears
86
86
  source_code_uri: https://github.com/ivx/ears
87
87
  changelog_uri: https://github.com/ivx/ears/blob/main/CHANGELOG.md
88
- post_install_message:
88
+ post_install_message:
89
89
  rdoc_options: []
90
90
  require_paths:
91
91
  - lib
@@ -93,15 +93,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: 2.7.7
96
+ version: 3.0.7
97
97
  required_rubygems_version: !ruby/object:Gem::Requirement
98
98
  requirements:
99
99
  - - ">="
100
100
  - !ruby/object:Gem::Version
101
101
  version: '0'
102
102
  requirements: []
103
- rubygems_version: 3.1.6
104
- signing_key:
103
+ rubygems_version: 3.2.33
104
+ signing_key:
105
105
  specification_version: 4
106
106
  summary: A gem for building RabbitMQ consumers.
107
107
  test_files: []