Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.24.0 (2025-12-18)

- Replace `MultiJson` in `Ears::Middlewares::JSON` with `JSON`

## 0.23.0 (2025-11-06)

- Add `have_been_published` rspec matcher
Expand Down
16 changes: 5 additions & 11 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
PATH
remote: .
specs:
ears (0.23.0)
ears (0.24.0)
bunny (>= 2.22.0)
connection_pool (~> 2.4)
multi_json
json (>= 2.9.0)

GEM
remote: https://rubygems.org/
Expand All @@ -20,7 +20,6 @@ GEM
json (2.13.2)
language_server-protocol (3.17.0.5)
lint_roller (1.1.0)
multi_json (1.17.0)
parallel (1.27.0)
parser (3.3.9.0)
ast (~> 2.4.1)
Expand Down Expand Up @@ -84,13 +83,9 @@ GEM
yard (0.9.37)

PLATFORMS
arm64-darwin-20
arm64-darwin-21
arm64-darwin-22
arm64-darwin
ruby
x86_64-darwin-20
x86_64-darwin-21
x86_64-darwin-22
x86_64-darwin
x86_64-linux

DEPENDENCIES
Expand All @@ -111,11 +106,10 @@ CHECKSUMS
connection_pool (2.5.4) sha256=e9e1922327416091f3f6542f5f4446c2a20745276b9aa796dd0bb2fd0ea1e70a
diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
docile (1.4.1) sha256=96159be799bfa73cdb721b840e9802126e4e03dfc26863db73647204c727f21e
ears (0.23.0)
ears (0.24.0)
json (2.13.2) sha256=02e1f118d434c6b230a64ffa5c8dee07e3ec96244335c392eaed39e1199dbb68
language_server-protocol (3.17.0.5) sha256=fd1e39a51a28bf3eec959379985a72e296e9f9acfce46f6a79d31ca8760803cc
lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
multi_json (1.17.0) sha256=76581f6c96aebf2e85f8a8b9854829e0988f335e8671cd1a56a1036eb75e4a1b
parallel (1.27.0) sha256=4ac151e1806b755fb4e2dc2332cbf0e54f2e24ba821ff2d3dcf86bf6dc4ae130
parser (3.3.9.0) sha256=94d6929354b1a6e3e1f89d79d4d302cc8f5aa814431a6c9c7e0623335d7687f2
prettier_print (1.2.1) sha256=a72838b5f23facff21f90a5423cdcdda19e4271092b41f4ea7f50b83929e6ff9
Expand Down
2 changes: 1 addition & 1 deletion ears.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ Gem::Specification.new do |spec|

spec.add_dependency 'bunny', '>= 2.22.0'
spec.add_dependency 'connection_pool', '~> 2.4'
spec.add_dependency 'multi_json'
spec.add_dependency 'json', '>= 2.9.0'
end
4 changes: 2 additions & 2 deletions lib/ears/middlewares/json.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'json'
require 'ears/middleware'
require 'multi_json'

module Ears
module Middlewares
Expand All @@ -17,7 +17,7 @@ def initialize(opts = {})
def call(delivery_info, metadata, payload, app)
begin
parsed_payload =
MultiJson.load(payload, symbolize_keys: symbolize_keys)
::JSON.parse(payload, symbolize_names: symbolize_keys)
rescue => e
return on_error.call(e)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/ears/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Ears
VERSION = '0.23.0'
VERSION = '0.24.0'
end
4 changes: 2 additions & 2 deletions spec/ears/middlewares/json_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
let(:middleware) { Ears::Middlewares::JSON.new(options) }
let(:delivery_info) { instance_double(Bunny::DeliveryInfo) }
let(:metadata) { instance_double(Bunny::MessageProperties) }
let(:payload) { MultiJson.dump({ my: 'payload' }) }
let(:payload) { JSON.generate({ my: 'payload' }) }
let(:error_handler) { Proc.new { :error_handler_result } }
let(:options) { { on_error: error_handler } }

Expand Down Expand Up @@ -85,7 +85,7 @@

it 'calls the error handler with the error' do
expect(error_handler).to receive(:call).with(
instance_of(MultiJson::ParseError),
instance_of(JSON::ParserError),
)

middleware.call(delivery_info, metadata, payload, Proc.new { :success })
Expand Down