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
1 change: 0 additions & 1 deletion hutch.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Gem::Specification.new do |gem|
gem.add_runtime_dependency 'carrot-top', '~> 0.0.7'
gem.add_runtime_dependency 'multi_json', '~> 1.15'
gem.add_runtime_dependency 'activesupport', '>= 4.2'
gem.add_runtime_dependency 'ostruct', '~> 0.6'

gem.name = 'hutch'
gem.summary = 'Opinionated asynchronous inter-service communication using RabbitMQ'
Expand Down
6 changes: 4 additions & 2 deletions lib/hutch/broker.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require 'active_support/core_ext/object/blank'

require 'carrot-top'
require 'ostruct'
require 'hutch/logging'
require 'hutch/exceptions'
require 'hutch/publisher'
Expand Down Expand Up @@ -269,8 +268,11 @@ def using_publisher_confirmations?

private

Config = Struct.new(:host, :port, :username, :password, :ssl, :protocol, :sanitized_uri)
private_constant :Config

def api_config
@api_config ||= OpenStruct.new.tap do |config|
@api_config ||= Config.new.tap do |config|
config.host = @config[:mq_api_host]
config.port = @config[:mq_api_port]
config.username = @config[:mq_username]
Expand Down
2 changes: 1 addition & 1 deletion spec/hutch/error_handlers/airbrake_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

it "logs the error to Airbrake" do
message_id = "1"
properties = OpenStruct.new(message_id: message_id)
properties = Struct.new(:message_id).new(message_id)
payload = "{}"
consumer = double
ex = error
Expand Down
2 changes: 1 addition & 1 deletion spec/hutch/error_handlers/bugsnag_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

it "logs the error to Bugsnag" do
message_id = "1"
properties = OpenStruct.new(message_id: message_id)
properties = Struct.new(:message_id).new(message_id)
payload = "{}"
consumer = double
ex = error
Expand Down
2 changes: 1 addition & 1 deletion spec/hutch/error_handlers/honeybadger_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

it "logs the error to Honeybadger" do
message_id = "1"
properties = OpenStruct.new(message_id: message_id)
properties = Struct.new(:message_id).new(message_id)
payload = "{}"
consumer = double
ex = error
Expand Down
2 changes: 1 addition & 1 deletion spec/hutch/error_handlers/logger_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
let(:error_handler) { Hutch::ErrorHandlers::Logger.new }

describe '#handle' do
let(:properties) { OpenStruct.new(message_id: "1") }
let(:properties) { Struct.new(:message_id).new("1") }
let(:payload) { "{}" }
let(:error) { double(message: "Stuff went wrong", class: "RuntimeError",
backtrace: ["line 1", "line 2"]) }
Expand Down
2 changes: 1 addition & 1 deletion spec/hutch/error_handlers/rollbar_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

it "logs the error to Rollbar" do
message_id = "1"
properties = OpenStruct.new(message_id: message_id)
properties = Struct.new(:message_id).new(message_id)
payload = "{}"
consumer = double
ex = error
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 @@ -4,7 +4,7 @@
let(:error_handler) { Hutch::ErrorHandlers::SentryRaven.new }

describe '#handle' do
let(:properties) { OpenStruct.new(message_id: "1") }
let(:properties) { Struct.new(:message_id).new("1") }
let(:payload) { "{}" }
let(:error) do
begin
Expand Down
2 changes: 1 addition & 1 deletion spec/hutch/error_handlers/sentry_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
end

describe '#handle' do
let(:properties) { OpenStruct.new(message_id: "1") }
let(:properties) { Struct.new(:message_id).new("1") }
let(:payload) { "{}" }
let(:error) do
begin
Expand Down
2 changes: 1 addition & 1 deletion spec/hutch/tracers/datadog_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def initialize
end

def class
OpenStruct.new(name: 'ClassName')
Struct.new(:name).new('ClassName')
end

def process(message)
Expand Down
1 change: 0 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
require 'raven'
require 'hutch'
require 'logger'
require 'ostruct'

# set logger to be a null logger
Hutch::Logging.logger = Logger.new(File::NULL)
Expand Down