ears 0.25.0 → 0.26.1

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: 59823fbd0edc6c85f74dc66ae84216cd1e3bc8d91e41034aba5728f2c582041f
4
- data.tar.gz: d3aa13f09d292a9212067f93f302256ee6134b709ce4ebebceead6a9966e805e
3
+ metadata.gz: f9e9b4b2d55a35f5821e0e3705c1f5abd4abd7892a87e02be3c7801a495efc0b
4
+ data.tar.gz: '068098705d954d0e09db4b1b9c1a55dcfdfea37dafa4dc108c1768ff80feb2d9'
5
5
  SHA512:
6
- metadata.gz: a6de639c5a12de8ea1b7684fa6c1f1f40cb4cc04cc3d4d603c3b0e8bad7f884d5ae299f48d969c130041a8f9e9e69fc75e47d8cd795a29eb400e7629f7890c81
7
- data.tar.gz: 26917d17a1a86205875676a15144ff08310a9e7e49e34d820fb98f0c7bc0a312bf2d472e760149d70106ac0475da7f0b79b4a6c3ff7c47f2f6297b64d5171757
6
+ metadata.gz: '092f3727deec0b61539b05b45ebd9aef8c3f89d57a63ba336f0b3d6b7e5b918a4bd921227eb7b87ddd73c4973cbbd1632693a8e72e3e056e430d825529aa1e3d'
7
+ data.tar.gz: ff092243b3e7e90f9067bd0c39776cb61d25570caa3be9da4baa6b8c31e2b9d32d0d1f1d12eb9e123424fec00c226d55b987291dc0bfc870557e74440049a870
@@ -1,10 +1,32 @@
1
- # Specify a different separator for branch names
2
-
3
1
  version: 2
2
+
4
3
  updates:
4
+ - package-ecosystem: 'bundler'
5
+ directory: '/'
6
+ schedule:
7
+ interval: 'daily'
8
+ open-pull-requests-limit: 0
9
+ groups:
10
+ security:
11
+ applies-to: security-updates
12
+ patterns: ['*']
13
+
14
+ - package-ecosystem: 'npm'
15
+ directory: '/'
16
+ schedule:
17
+ interval: 'daily'
18
+ open-pull-requests-limit: 0
19
+ groups:
20
+ security:
21
+ applies-to: security-updates
22
+ patterns: ['*']
23
+
5
24
  - package-ecosystem: 'github-actions'
6
25
  directory: '/'
7
26
  schedule:
8
- interval: 'weekly'
9
- pull-request-branch-name:
10
- separator: '-'
27
+ interval: 'daily'
28
+ open-pull-requests-limit: 0
29
+ groups:
30
+ security:
31
+ applies-to: security-updates
32
+ patterns: ['*']
@@ -12,20 +12,24 @@ jobs:
12
12
  runs-on: ubuntu-latest
13
13
  strategy:
14
14
  matrix:
15
- ruby-version: ['3.2', '3.3', '3.4', '4.0']
15
+ ruby-version: ['3.3', '3.4', '4.0']
16
16
 
17
17
  steps:
18
- - uses: actions/checkout@v6
18
+ - uses: actions/checkout@v7
19
19
  - name: Set up Ruby
20
20
  uses: ruby/setup-ruby@v1
21
21
  with:
22
22
  ruby-version: ${{ matrix.ruby-version }}
23
23
  bundler-cache: true
24
- - uses: actions/setup-node@v6
24
+ - uses: pnpm/action-setup@v6
25
25
  with:
26
- node-version: '24'
26
+ run_install: false
27
+ - uses: actions/setup-node@v7
28
+ with:
29
+ node-version: '26'
30
+ cache: pnpm
27
31
  - name: Run prettier
28
- run: npm ci && npm run lint
32
+ run: pnpm install --frozen-lockfile && pnpm run lint
29
33
  - name: Run Rubocop
30
34
  run: bundle exec rubocop
31
35
  - name: Run tests
@@ -37,7 +41,7 @@ jobs:
37
41
  runs-on: ubuntu-latest
38
42
 
39
43
  steps:
40
- - uses: actions/checkout@v6
44
+ - uses: actions/checkout@v7
41
45
  - name: Set up Ruby
42
46
  uses: ruby/setup-ruby@v1
43
47
  with:
@@ -41,7 +41,7 @@ jobs:
41
41
 
42
42
  steps:
43
43
  - name: Checkout repository
44
- uses: actions/checkout@v6
44
+ uses: actions/checkout@v7
45
45
 
46
46
  # Initializes the CodeQL tools for scanning.
47
47
  - name: Initialize CodeQL
@@ -15,6 +15,6 @@ jobs:
15
15
  runs-on: ubuntu-latest
16
16
  steps:
17
17
  - name: 'Checkout Repository'
18
- uses: actions/checkout@v6
18
+ uses: actions/checkout@v7
19
19
  - name: 'Dependency Review'
20
- uses: actions/dependency-review-action@v4
20
+ uses: actions/dependency-review-action@v5
data/.prettierignore ADDED
@@ -0,0 +1 @@
1
+ pnpm-lock.yaml
data/.rubocop.yml CHANGED
@@ -13,7 +13,7 @@ AllCops:
13
13
  - Guardfile
14
14
  - bin/*
15
15
  - tmp/**/*
16
- TargetRubyVersion: 3.2
16
+ TargetRubyVersion: 3.3
17
17
  NewCops: enable
18
18
 
19
19
  Style:
@@ -93,3 +93,9 @@ RSpec/MultipleMemoizedHelpers:
93
93
 
94
94
  RSpec/StubbedMock:
95
95
  Enabled: false
96
+
97
+ # `have_been_published` takes the search criteria as its subject rather than a
98
+ # value under test, so `expect(routing_key: '…')` is the matcher's intended API.
99
+ RSpec/ExpectActual:
100
+ Exclude:
101
+ - 'spec/ears/testing/matchers_spec.rb'
data/.tool-versions CHANGED
@@ -1,2 +1,2 @@
1
- ruby 4.0.2
2
- nodejs 24.14.1
1
+ ruby 4.0.7
2
+ nodejs 26.8.2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.26.1 (2026-10-01)
4
+
5
+ ### Fixed
6
+
7
+ - Resetting a publisher channel pool while a closed channel is checked out no longer raises `Bunny::ChannelAlreadyClosed` on checkin. Previously this masked the original error (e.g. `PublishConfirmationTimeout`) and caused it to be retried as a connection error, which could duplicate a message.
8
+
9
+ ## 0.26.0 (2026-06-01)
10
+
11
+ - Upgrade `connection_pool` dependency to `~> 3.0`
12
+ - Drop support for Ruby 3.2 (end-of-life); require Ruby `>= 3.3.0`
13
+
3
14
  ## 0.25.0 (2026-04-08)
4
15
 
5
16
  - Drop support for bunny versions below 3.0.0
data/CLAUDE.md ADDED
@@ -0,0 +1,82 @@
1
+ # ears
2
+
3
+ Ruby gem for building RabbitMQ consumers using Bunny.
4
+
5
+ ## Stack
6
+
7
+ - **Ruby** 4.0.x (see `.tool-versions`)
8
+ - **Bunny** >= 3.0.0 — AMQP client
9
+ - **connection_pool** ~> 3.0 — thread-safe channel pools for publishers
10
+ - **json** >= 2.9.0 — JSON serialization in middleware
11
+ - Dev tools: RSpec, RuboCop (rubocop-rspec, rubocop-rake), SimpleCov, YARD, Prettier (via Node)
12
+ - **Node tooling**: pnpm v11+ (pinned in `package.json#packageManager`). The JS toolchain is dev-only (Prettier on Ruby files); nothing JS ships at runtime.
13
+
14
+ ## Common Commands
15
+
16
+ ```bash
17
+ # Install deps
18
+ bundle install
19
+ pnpm install --frozen-lockfile
20
+
21
+ # Tests
22
+ bundle exec rspec
23
+
24
+ # Lint / format
25
+ bundle exec rubocop
26
+ pnpm run lint # Prettier on Ruby files
27
+ pnpm run format # Prettier --write
28
+
29
+ # Autofix rubocop
30
+ bundle exec rubocop -A
31
+
32
+ # Docs
33
+ bundle exec yard doc
34
+ ```
35
+
36
+ ## Directory Layout
37
+
38
+ ```
39
+ lib/
40
+ ears.rb # Top-level module: configure, connection, channel, setup, run!
41
+ ears/
42
+ configuration.rb # Ears::Configuration — all tunable constants
43
+ errors.rb # Custom error classes (required by configuration.rb)
44
+ consumer.rb # Abstract base class; subclass and override #work
45
+ consumer_wrapper.rb # Wraps a Consumer for Bunny delivery callbacks
46
+ setup.rb # Ears::Setup — DSL for exchange/queue/consumer wiring
47
+ publisher.rb # Ears::Publisher — publish and publish_with_confirmation
48
+ publisher_channel_pool.rb # Thread-safe ConnectionPool for publisher channels
49
+ publisher_confirmation_handler.rb
50
+ publisher_retry_handler.rb
51
+ middleware.rb # Middleware base
52
+ middlewares/
53
+ appsignal.rb
54
+ json.rb # Deserializes JSON payload before #work
55
+ max_retries.rb
56
+ testing.rb # Ears::Testing module entry-point
57
+ testing/
58
+ matchers.rb
59
+ message_capture.rb
60
+ publisher_mock.rb
61
+ test_helper.rb
62
+ spec/ # RSpec specs (mirrors lib/ structure)
63
+ ```
64
+
65
+ ## Architecture
66
+
67
+ **Consumer pattern:** Subclass `Ears::Consumer`, call `.configure(queue:, exchange:, routing_keys:, ...)` in the class body, override `#work(delivery_info, metadata, payload)` returning `:ack`, `:reject`, or `:requeue`. Middleware chain is applied in reverse order around `#work`.
68
+
69
+ **Publisher pattern:** Instantiate `Ears::Publisher.new(exchange_name)`, call `#publish(data, routing_key:)` or `#publish_with_confirmation(data, routing_key:)`. Internally uses `PublisherChannelPool` (two `ConnectionPool` instances — one standard, one with confirms). Pool is lazy-initialised with a mutex for thread safety and is fork-safe (resets on PID change).
70
+
71
+ **Setup DSL:** `Ears.setup { exchange(...); queue(...); consumer(...) }` or `Ears.setup_consumers(*classes)` which auto-wires from each class's `.configure` metadata.
72
+
73
+ **Configuration knobs** (set via `Ears.configure { |c| c.foo = ... }`): `rabbitmq_url`, `connection_name` (required), `publisher_pool_size` (32), `publisher_pool_timeout` (2s), `publisher_confirms_pool_size` (32), `publisher_confirms_timeout` (5s), plus retry/backoff params.
74
+
75
+ ## Testing Support
76
+
77
+ `require 'ears/testing'` — provides `Ears::Testing::TestHelper` (RSpec include), `PublisherMock`, `MessageCapture`, and custom matchers (`have_been_published`).
78
+
79
+ ## Known Tech Debt
80
+
81
+ - `Metrics/MethodLength` is suppressed for `Configuration#initialize` (initialises ~15 instance variables from constants; an options-hash refactor would be the real fix).
82
+ - `.rubocop_todo.yml` may have lingering entries — check before adding new inline disables.
data/Gemfile CHANGED
@@ -3,6 +3,10 @@ source 'https://rubygems.org'
3
3
  gemspec
4
4
 
5
5
  group :test do
6
+ # @prettier/plugin-ruby's vendored server.rb still calls JSON.fast_generate,
7
+ # removed in json 3.0 (https://github.com/ruby/json/releases/tag/v3.0.0).
8
+ # Remove this pin once https://github.com/prettier/plugin-ruby/pull/1468 merges and ships.
9
+ gem 'json', '< 3'
6
10
  gem 'rake'
7
11
  gem 'rspec'
8
12
  gem 'rubocop', require: false
data/Gemfile.lock CHANGED
@@ -1,37 +1,36 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ears (0.25.0)
4
+ ears (0.26.1)
5
5
  bunny (>= 3.0.0)
6
- connection_pool (~> 2.4)
6
+ connection_pool (~> 3.0)
7
7
  json (>= 2.9.0)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- amq-protocol (2.7.0)
12
+ amq-protocol (2.9.0)
13
13
  ast (2.4.3)
14
- bunny (3.1.0)
15
- amq-protocol (~> 2.7)
14
+ bunny (3.3.0)
15
+ amq-protocol (~> 2.9)
16
16
  logger (~> 1, >= 1.7)
17
17
  sorted_set (~> 1, >= 1.0.2)
18
- connection_pool (2.5.5)
18
+ connection_pool (3.0.2)
19
19
  diff-lcs (1.6.2)
20
- docile (1.4.1)
21
- json (2.19.3)
22
- language_server-protocol (3.17.0.5)
20
+ json (2.21.2)
21
+ language_server-protocol (3.17.0.6)
23
22
  lint_roller (1.1.0)
24
23
  logger (1.7.0)
25
- parallel (1.28.0)
26
- parser (3.3.11.1)
24
+ parallel (2.2.0)
25
+ parser (3.3.12.0)
27
26
  ast (~> 2.4.1)
28
27
  racc
29
28
  prettier_print (1.2.1)
30
29
  prism (1.9.0)
31
30
  racc (1.8.1)
32
31
  rainbow (3.1.1)
33
- rake (13.3.1)
34
- rbtree (0.4.6)
32
+ rake (13.4.2)
33
+ rbtree (0.4.7)
35
34
  regexp_parser (2.12.0)
36
35
  rspec (3.13.2)
37
36
  rspec-core (~> 3.13.0)
@@ -46,33 +45,29 @@ GEM
46
45
  diff-lcs (>= 1.2.0, < 2.0)
47
46
  rspec-support (~> 3.13.0)
48
47
  rspec-support (3.13.7)
49
- rubocop (1.86.0)
50
- json (~> 2.3)
48
+ rubocop (1.91.0)
49
+ json (>= 2.3)
51
50
  language_server-protocol (~> 3.17.0.2)
52
51
  lint_roller (~> 1.1.0)
53
- parallel (~> 1.10)
52
+ parallel (>= 1.10)
54
53
  parser (>= 3.3.0.2)
55
54
  rainbow (>= 2.2.2, < 4.0)
56
55
  regexp_parser (>= 2.9.3, < 3.0)
57
56
  rubocop-ast (>= 1.49.0, < 2.0)
58
57
  ruby-progressbar (~> 1.7)
59
58
  unicode-display_width (>= 2.4.0, < 4.0)
60
- rubocop-ast (1.49.1)
59
+ rubocop-ast (1.50.0)
61
60
  parser (>= 3.3.7.2)
62
61
  prism (~> 1.7)
63
62
  rubocop-rake (0.7.1)
64
63
  lint_roller (~> 1.1)
65
64
  rubocop (>= 1.72.1)
66
- rubocop-rspec (3.9.0)
65
+ rubocop-rspec (3.10.2)
67
66
  lint_roller (~> 1.1)
68
- rubocop (~> 1.81)
67
+ regexp_parser (>= 2.0)
68
+ rubocop (~> 1.86, >= 1.86.2)
69
69
  ruby-progressbar (1.13.0)
70
- simplecov (0.22.0)
71
- docile (~> 1.1)
72
- simplecov-html (~> 0.11)
73
- simplecov_json_formatter (~> 0.1)
74
- simplecov-html (0.13.2)
75
- simplecov_json_formatter (0.1.4)
70
+ simplecov (1.3.0)
76
71
  sorted_set (1.1.0)
77
72
  rbtree
78
73
  syntax_tree (6.3.0)
@@ -80,7 +75,7 @@ GEM
80
75
  unicode-display_width (3.2.0)
81
76
  unicode-emoji (~> 4.1)
82
77
  unicode-emoji (4.2.0)
83
- yard (0.9.38)
78
+ yard (0.9.45)
84
79
 
85
80
  PLATFORMS
86
81
  arm64-darwin
@@ -90,6 +85,7 @@ PLATFORMS
90
85
 
91
86
  DEPENDENCIES
92
87
  ears!
88
+ json (< 3)
93
89
  rake
94
90
  rspec
95
91
  rubocop
@@ -100,44 +96,42 @@ DEPENDENCIES
100
96
  yard
101
97
 
102
98
  CHECKSUMS
103
- amq-protocol (2.7.0) sha256=a798da91f076cf8225193739d09785201f72acbc5293282a3592ad3eda5b3afc
99
+ amq-protocol (2.9.0) sha256=6812dc5c1d7dea12b445854ad0000239e59009760079084310bd39f76397168e
104
100
  ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383
105
- bunny (3.1.0) sha256=fd09ea8be3fbb7fe4b1063f874094b444f762f2da1692b3341751af7c6d62f3c
106
- connection_pool (2.5.5) sha256=e54ff92855753df1fd7c59fa04a398833355f27dd14c074f8c83a05f72a716ad
101
+ bundler (4.0.21) sha256=7cbf5499b426076aa16c8d28a59e4c2c3aad5a438402abcd961f0119f29f1dd0
102
+ bunny (3.3.0) sha256=85ef5562ec2b24f542e8fad69c4302d30d966fb79ff803dc9d0c398a4054672a
103
+ connection_pool (3.0.2) sha256=33fff5ba71a12d2aa26cb72b1db8bba2a1a01823559fb01d29eb74c286e62e0a
107
104
  diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
108
- docile (1.4.1) sha256=96159be799bfa73cdb721b840e9802126e4e03dfc26863db73647204c727f21e
109
- ears (0.25.0)
110
- json (2.19.3) sha256=289b0bb53052a1fa8c34ab33cc750b659ba14a5c45f3fcf4b18762dc67c78646
111
- language_server-protocol (3.17.0.5) sha256=fd1e39a51a28bf3eec959379985a72e296e9f9acfce46f6a79d31ca8760803cc
105
+ ears (0.26.1)
106
+ json (2.21.2) sha256=1f1d3b7cf2b3ba1a69beca0bb6db13d5438b80bff3cd54cdaaa620b9b07c1c6a
107
+ language_server-protocol (3.17.0.6) sha256=5ef2c0c138f8267e1bc631d3328347d354f96724b0af22f2c79516120443b7f0
112
108
  lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
113
109
  logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
114
- parallel (1.28.0) sha256=33e6de1484baf2524792d178b0913fc8eb94c628d6cfe45599ad4458c638c970
115
- parser (3.3.11.1) sha256=d17ace7aabe3e72c3cc94043714be27cc6f852f104d81aa284c2281aecc65d54
110
+ parallel (2.2.0) sha256=e1059c5fd7b649558a0aec38a769f06a42942bdb40503d005a59c352fe011cd8
111
+ parser (3.3.12.0) sha256=21a6d7f755d5a24dfbdc6e6b772e4e879a52e7631a88bc5a3a134606052c9828
116
112
  prettier_print (1.2.1) sha256=a72838b5f23facff21f90a5423cdcdda19e4271092b41f4ea7f50b83929e6ff9
117
113
  prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85
118
114
  racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
119
115
  rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a
120
- rake (13.3.1) sha256=8c9e89d09f66a26a01264e7e3480ec0607f0c497a861ef16063604b1b08eb19c
121
- rbtree (0.4.6) sha256=14eea4469b24fd2472542e5f3eb105d6344c8ccf36f0b56d55fdcfeb4e0f10fc
116
+ rake (13.4.2) sha256=cb825b2bd5f1f8e91ca37bddb4b9aaf345551b4731da62949be002fa89283701
117
+ rbtree (0.4.7) sha256=1efabbcb3fd5f12249c9c8a610a765074868164eed0c50c9db2531c00ed161cb
122
118
  regexp_parser (2.12.0) sha256=35a916a1d63190ab5c9009457136ae5f3c0c7512d60291d0d1378ba18ce08ebb
123
119
  rspec (3.13.2) sha256=206284a08ad798e61f86d7ca3e376718d52c0bc944626b2349266f239f820587
124
120
  rspec-core (3.13.6) sha256=a8823c6411667b60a8bca135364351dda34cd55e44ff94c4be4633b37d828b2d
125
121
  rspec-expectations (3.13.5) sha256=33a4d3a1d95060aea4c94e9f237030a8f9eae5615e9bd85718fe3a09e4b58836
126
122
  rspec-mocks (3.13.8) sha256=086ad3d3d17533f4237643de0b5c42f04b66348c28bf6b9c2d3f4a3b01af1d47
127
123
  rspec-support (3.13.7) sha256=0640e5570872aafefd79867901deeeeb40b0c9875a36b983d85f54fb7381c47c
128
- rubocop (1.86.0) sha256=4ff1186fe16ebe9baff5e7aad66bb0ad4cabf5cdcd419f773146dbba2565d186
129
- rubocop-ast (1.49.1) sha256=4412f3ee70f6fe4546cc489548e0f6fcf76cafcfa80fa03af67098ffed755035
124
+ rubocop (1.91.0) sha256=9c82b7bf391c5d7e3798c5b9996e22a1fe3bd7468e351dfdeb96140c058296d0
125
+ rubocop-ast (1.50.0) sha256=b9ca88300da0803ee222ad20cdb30494c0a784eed06fdc35d254b06d662788db
130
126
  rubocop-rake (0.7.1) sha256=3797f2b6810c3e9df7376c26d5f44f3475eda59eb1adc38e6f62ecf027cbae4d
131
- rubocop-rspec (3.9.0) sha256=8fa70a3619408237d789aeecfb9beef40576acc855173e60939d63332fdb55e2
127
+ rubocop-rspec (3.10.2) sha256=0b3e2ecc592cd10ecbf0095bb58d1e357905276e069643523cc19eb7495f65e2
132
128
  ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
133
- simplecov (0.22.0) sha256=fe2622c7834ff23b98066bb0a854284b2729a569ac659f82621fc22ef36213a5
134
- simplecov-html (0.13.2) sha256=bd0b8e54e7c2d7685927e8d6286466359b6f16b18cb0df47b508e8d73c777246
135
- simplecov_json_formatter (0.1.4) sha256=529418fbe8de1713ac2b2d612aa3daa56d316975d307244399fa4838c601b428
129
+ simplecov (1.3.0) sha256=d9886307863c1ead47657dcbed869bfffd82318808b09014d8f0ff77dcfe7492
136
130
  sorted_set (1.1.0) sha256=bac01eb16b6bcfcdb7d732a28e87422be8b5c9fdcfeadbe9072682407524ee83
137
131
  syntax_tree (6.3.0) sha256=56e25a9692c798ec94c5442fe94c5e94af76bef91edc8bb02052cbdecf35f13d
138
132
  unicode-display_width (3.2.0) sha256=0cdd96b5681a5949cdbc2c55e7b420facae74c4aaf9a9815eee1087cb1853c42
139
133
  unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f
140
- yard (0.9.38) sha256=721fb82afb10532aa49860655f6cc2eaa7130889df291b052e1e6b268283010f
134
+ yard (0.9.45) sha256=52e211493f7cb8a3ebf7e104a25a1e73937a3103092545d34cb88fafebb3dc51
141
135
 
142
136
  BUNDLED WITH
143
- 4.0.10
137
+ 4.0.21
data/Rakefile CHANGED
@@ -19,6 +19,6 @@ RuboCop::RakeTask.new(:rubocop) do |task|
19
19
  end
20
20
 
21
21
  desc 'Run Prettier'
22
- task(:prettier) { sh 'npm run lint' }
22
+ task(:prettier) { sh 'pnpm run lint' }
23
23
 
24
24
  task default: %i[spec rubocop prettier]
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('>= 3.2.9')
13
+ spec.required_ruby_version = Gem::Requirement.new('>= 3.3.0')
14
14
 
15
15
  spec.metadata['allowed_push_host'] = 'https://rubygems.org'
16
16
 
@@ -33,6 +33,6 @@ Gem::Specification.new do |spec|
33
33
  spec.require_paths = ['lib']
34
34
 
35
35
  spec.add_dependency 'bunny', '>= 3.0.0'
36
- spec.add_dependency 'connection_pool', '~> 2.4'
36
+ spec.add_dependency 'connection_pool', '~> 3.0'
37
37
  spec.add_dependency 'json', '>= 2.9.0'
38
38
  end
@@ -34,8 +34,8 @@ module Ears
34
34
  @confirms_pool = nil
35
35
  @creator_pid = nil
36
36
 
37
- std_pool&.shutdown(&:close)
38
- cnf_pool&.shutdown(&:close)
37
+ std_pool&.shutdown { |channel| close_channel(channel) }
38
+ cnf_pool&.shutdown { |channel| close_channel(channel) }
39
39
  nil
40
40
  end
41
41
 
@@ -47,7 +47,7 @@ module Ears
47
47
  cnf_pool = @confirms_pool
48
48
  @confirms_pool = nil
49
49
 
50
- cnf_pool&.shutdown(&:close)
50
+ cnf_pool&.shutdown { |channel| close_channel(channel) }
51
51
  nil
52
52
  end
53
53
 
@@ -112,6 +112,12 @@ module Ears
112
112
  'Channel is closed'
113
113
  end
114
114
 
115
+ def close_channel(channel)
116
+ channel.close
117
+ rescue Bunny::ChannelAlreadyClosed
118
+ nil
119
+ end
120
+
115
121
  def cleanup_closed_channel(channel)
116
122
  return unless channel.respond_to?(:close)
117
123
 
data/lib/ears/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ears
2
- VERSION = '0.25.0'
2
+ VERSION = '0.26.1'
3
3
  end
data/package.json CHANGED
@@ -1,15 +1,16 @@
1
1
  {
2
2
  "name": "ears",
3
3
  "private": true,
4
+ "packageManager": "pnpm@11.18.0",
4
5
  "scripts": {
5
- "prettify": "prettier \"**/*.{ru,rb,yml,yaml,md,gemspec,json}\" --ignore-path=\".gitignore\"",
6
- "lint": "npm run prettify -- --check",
7
- "format": "npm run prettify -- --write"
6
+ "prettify": "prettier \"**/*.{ru,rb,yml,yaml,md,gemspec,json}\"",
7
+ "lint": "pnpm run prettify --check",
8
+ "format": "pnpm run prettify --write"
8
9
  },
9
10
  "devDependencies": {
10
11
  "@invisionag/prettier-config": "^2.1.3",
11
12
  "@prettier/plugin-ruby": "^4.0.4",
12
- "prettier": "^3.8.1"
13
+ "prettier": "^3.9.6"
13
14
  },
14
15
  "prettier": "@invisionag/prettier-config/ruby"
15
16
  }
data/pnpm-lock.yaml ADDED
@@ -0,0 +1,48 @@
1
+ lockfileVersion: '9.0'
2
+
3
+ settings:
4
+ autoInstallPeers: true
5
+ excludeLinksFromLockfile: false
6
+
7
+ importers:
8
+
9
+ .:
10
+ devDependencies:
11
+ '@invisionag/prettier-config':
12
+ specifier: ^2.1.3
13
+ version: 2.1.3(prettier@3.9.6)
14
+ '@prettier/plugin-ruby':
15
+ specifier: ^4.0.4
16
+ version: 4.0.4(prettier@3.9.6)
17
+ prettier:
18
+ specifier: ^3.9.6
19
+ version: 3.9.6
20
+
21
+ packages:
22
+
23
+ '@invisionag/prettier-config@2.1.3':
24
+ resolution: {integrity: sha512-/BRe7iCWtsn43hhYrD2ANla2Qf332EusDjcuuB9xOK/z3lEghp59pkuxNFIvlQ/Y9AFMaT1zOFhvxzYax+fj3g==}
25
+ peerDependencies:
26
+ prettier: '>=2.0.0'
27
+
28
+ '@prettier/plugin-ruby@4.0.4':
29
+ resolution: {integrity: sha512-lCpvfS/dQU5WrwN3AQ5vR8qrvj2h5gE41X08NNzAAXvHdM4zwwGRcP2sHSxfu6n6No+ljWCVx95NvJPFTTjCTg==}
30
+ peerDependencies:
31
+ prettier: ^3.0.0
32
+
33
+ prettier@3.9.6:
34
+ resolution: {integrity: sha512-OpN0zzVdiaiAhxpuuj5efpIS4sY9j7bY6uR5mnj5yPzGkdkjNKSJeUThPb60Jw29QuAZgA4o+/iB49kFiaBX6g==}
35
+ engines: {node: '>=14'}
36
+ hasBin: true
37
+
38
+ snapshots:
39
+
40
+ '@invisionag/prettier-config@2.1.3(prettier@3.9.6)':
41
+ dependencies:
42
+ prettier: 3.9.6
43
+
44
+ '@prettier/plugin-ruby@4.0.4(prettier@3.9.6)':
45
+ dependencies:
46
+ prettier: 3.9.6
47
+
48
+ prettier@3.9.6: {}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ears
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.25.0
4
+ version: 0.26.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - InVision AG
@@ -29,14 +29,14 @@ dependencies:
29
29
  requirements:
30
30
  - - "~>"
31
31
  - !ruby/object:Gem::Version
32
- version: '2.4'
32
+ version: '3.0'
33
33
  type: :runtime
34
34
  prerelease: false
35
35
  version_requirements: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '2.4'
39
+ version: '3.0'
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: json
42
42
  requirement: !ruby/object:Gem::Requirement
@@ -63,12 +63,14 @@ files:
63
63
  - ".github/workflows/codeql.yml"
64
64
  - ".github/workflows/dependency-review.yml"
65
65
  - ".gitignore"
66
+ - ".prettierignore"
66
67
  - ".rspec"
67
68
  - ".rubocop.yml"
68
69
  - ".rubocop_todo.yml"
69
70
  - ".tool-versions"
70
71
  - ".yardopts"
71
72
  - CHANGELOG.md
73
+ - CLAUDE.md
72
74
  - CODEOWNERS
73
75
  - CODE_OF_CONDUCT.md
74
76
  - Gemfile
@@ -97,8 +99,8 @@ files:
97
99
  - lib/ears/testing/publisher_mock.rb
98
100
  - lib/ears/testing/test_helper.rb
99
101
  - lib/ears/version.rb
100
- - package-lock.json
101
102
  - package.json
103
+ - pnpm-lock.yaml
102
104
  homepage: https://github.com/ivx/ears
103
105
  licenses:
104
106
  - MIT
@@ -115,14 +117,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
115
117
  requirements:
116
118
  - - ">="
117
119
  - !ruby/object:Gem::Version
118
- version: 3.2.9
120
+ version: 3.3.0
119
121
  required_rubygems_version: !ruby/object:Gem::Requirement
120
122
  requirements:
121
123
  - - ">="
122
124
  - !ruby/object:Gem::Version
123
125
  version: '0'
124
126
  requirements: []
125
- rubygems_version: 4.0.6
127
+ rubygems_version: 4.0.20
126
128
  specification_version: 4
127
129
  summary: A gem for building RabbitMQ consumers.
128
130
  test_files: []
data/package-lock.json DELETED
@@ -1,71 +0,0 @@
1
- {
2
- "name": "ears",
3
- "lockfileVersion": 2,
4
- "requires": true,
5
- "packages": {
6
- "": {
7
- "name": "ears",
8
- "devDependencies": {
9
- "@invisionag/prettier-config": "^2.1.3",
10
- "@prettier/plugin-ruby": "^4.0.4",
11
- "prettier": "^3.8.1"
12
- }
13
- },
14
- "node_modules/@invisionag/prettier-config": {
15
- "version": "2.1.3",
16
- "resolved": "https://registry.npmjs.org/@invisionag/prettier-config/-/prettier-config-2.1.3.tgz",
17
- "integrity": "sha512-/BRe7iCWtsn43hhYrD2ANla2Qf332EusDjcuuB9xOK/z3lEghp59pkuxNFIvlQ/Y9AFMaT1zOFhvxzYax+fj3g==",
18
- "dev": true,
19
- "peerDependencies": {
20
- "prettier": ">=2.0.0"
21
- }
22
- },
23
- "node_modules/@prettier/plugin-ruby": {
24
- "version": "4.0.4",
25
- "resolved": "https://registry.npmjs.org/@prettier/plugin-ruby/-/plugin-ruby-4.0.4.tgz",
26
- "integrity": "sha512-lCpvfS/dQU5WrwN3AQ5vR8qrvj2h5gE41X08NNzAAXvHdM4zwwGRcP2sHSxfu6n6No+ljWCVx95NvJPFTTjCTg==",
27
- "dev": true,
28
- "peerDependencies": {
29
- "prettier": "^3.0.0"
30
- }
31
- },
32
- "node_modules/prettier": {
33
- "version": "3.8.1",
34
- "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.1.tgz",
35
- "integrity": "sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg==",
36
- "dev": true,
37
- "license": "MIT",
38
- "bin": {
39
- "prettier": "bin/prettier.cjs"
40
- },
41
- "engines": {
42
- "node": ">=14"
43
- },
44
- "funding": {
45
- "url": "https://github.com/prettier/prettier?sponsor=1"
46
- }
47
- }
48
- },
49
- "dependencies": {
50
- "@invisionag/prettier-config": {
51
- "version": "2.1.3",
52
- "resolved": "https://registry.npmjs.org/@invisionag/prettier-config/-/prettier-config-2.1.3.tgz",
53
- "integrity": "sha512-/BRe7iCWtsn43hhYrD2ANla2Qf332EusDjcuuB9xOK/z3lEghp59pkuxNFIvlQ/Y9AFMaT1zOFhvxzYax+fj3g==",
54
- "dev": true,
55
- "requires": {}
56
- },
57
- "@prettier/plugin-ruby": {
58
- "version": "4.0.4",
59
- "resolved": "https://registry.npmjs.org/@prettier/plugin-ruby/-/plugin-ruby-4.0.4.tgz",
60
- "integrity": "sha512-lCpvfS/dQU5WrwN3AQ5vR8qrvj2h5gE41X08NNzAAXvHdM4zwwGRcP2sHSxfu6n6No+ljWCVx95NvJPFTTjCTg==",
61
- "dev": true,
62
- "requires": {}
63
- },
64
- "prettier": {
65
- "version": "3.8.1",
66
- "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.1.tgz",
67
- "integrity": "sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg==",
68
- "dev": true
69
- }
70
- }
71
- }