Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade dependencies, Ruby 3.2 compat #392

Merged
merged 6 commits into from
Dec 20, 2022
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
15 changes: 7 additions & 8 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
source 'https://rubygems.org'

ruby '>= 2.3.0'
ruby '>= 2.6.0'

gemspec

group :development do
gem "rake"
gem "guard", "~> 2.14", platform: :mri_23
gem "guard", "~> 2.18"
gem "guard-rspec", "~> 4.7", platform: :mri_23

gem "yard", "~> 0.9"
Expand All @@ -16,21 +16,20 @@ group :development do
end

group :development, :test do
gem "rspec", "~> 3.5"
gem "simplecov", "~> 0.12"
gem "rspec", "~> 3.12"
gem "simplecov", "~> 0.21"

gem "sentry-raven"
gem "sentry-ruby"
gem "honeybadger"
gem "coveralls", "~> 0.8.15", require: false
gem "newrelic_rpm"
gem "ddtrace", "~> 0.54.2"
gem "airbrake", "~> 10.0"
gem "ddtrace", "~> 1.8"
gem "airbrake", "~> 13.0"
gem "rollbar"
gem "bugsnag"
end

group :development, :darwin do
gem "rb-fsevent", "~> 0.9"
gem "rb-fsevent", "~> 0.11.2"
gem "growl", "~> 1.0.3"
end
4 changes: 2 additions & 2 deletions hutch.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Gem::Specification.new do |gem|
gem.add_runtime_dependency 'march_hare', '>= 3.0.0'
else
gem.platform = Gem::Platform::RUBY
gem.add_runtime_dependency 'bunny', '>= 2.19', '< 3.0'
gem.add_runtime_dependency 'bunny', '>= 2.20', '< 3.0'
end
gem.add_runtime_dependency 'carrot-top', '~> 0.0.7'
gem.add_runtime_dependency 'multi_json', '~> 1.15'
Expand All @@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
gem.summary = 'Opinionated asynchronous inter-service communication using RabbitMQ'
gem.description = 'Hutch is a Ruby library for enabling asynchronous inter-service communication using RabbitMQ'
gem.version = Hutch::VERSION.dup
gem.required_ruby_version = '>= 2.2'
gem.required_ruby_version = '>= 2.6'
gem.authors = ['Harry Marr', 'Michael Klishin']
gem.homepage = 'https://github.com/ruby-amqp/hutch'
gem.require_paths = ['lib']
Expand Down
2 changes: 1 addition & 1 deletion lib/hutch/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def daemonise_process
end

def abort_without_file(file, file_description, &block)
abort_with_message("#{file_description} '#{file}' not found") unless File.exists?(file)
abort_with_message("#{file_description} '#{file}' not found") unless File.exist?(file)

yield
end
Expand Down
3 changes: 2 additions & 1 deletion lib/hutch/tracers/datadog.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'ddtrace'
require 'ddtrace/auto_instrument'

module Hutch
module Tracers
Expand All @@ -8,7 +9,7 @@ def initialize(klass)
end

def handle(message)
::Datadog.tracer.trace(@klass.class.name, service: 'hutch', span_type: 'rabbitmq') do
::Datadog::Tracing.trace(@klass.class.name, continue_from: nil, service: 'hutch', type: 'rabbitmq') do
@klass.process(message)
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/hutch/error_handlers/sentry_raven_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
end

it "logs the error to Sentry" do
expect(Raven).to receive(:capture_exception).with(error, extra: { payload: payload })
expect(Raven).to receive(:capture_exception).with(error, {extra: { payload: payload }})
error_handler.handle(properties, payload, double, error)
end
end
Expand Down
6 changes: 3 additions & 3 deletions spec/hutch/tracers/datadog_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ def process(message)
let(:message) { double(:message) }

before do
allow(Datadog.tracer).to receive(:trace).and_call_original
allow(::Datadog::Tracing).to receive(:trace).and_call_original
end

it 'uses Datadog tracer' do
handle

expect(Datadog.tracer).to have_received(:trace).with('ClassName',
hash_including(service: 'hutch', span_type: 'rabbitmq'))
expect(::Datadog::Tracing).to have_received(:trace).with('ClassName',
hash_including(service: 'hutch', type: 'rabbitmq'))
end

it 'processes the message' do
Expand Down