From 91797bda8d370042cf7e00905399ec72de35aa18 Mon Sep 17 00:00:00 2001 From: koshigoe Date: Wed, 24 Jan 2018 15:59:35 +0900 Subject: [PATCH 1/4] Bump up Bugsnag to `6.x`. --- bugsnag-delivery-fluent.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bugsnag-delivery-fluent.gemspec b/bugsnag-delivery-fluent.gemspec index d062614..a537ffe 100644 --- a/bugsnag-delivery-fluent.gemspec +++ b/bugsnag-delivery-fluent.gemspec @@ -24,6 +24,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rspec' spec.add_development_dependency 'rspec-mocks' - spec.add_runtime_dependency 'bugsnag', "~> 5.0" + spec.add_runtime_dependency 'bugsnag', '~> 6.0' spec.add_runtime_dependency 'fluent-logger' end From aceb4f96cebd2597eba6b71d826224b96f78d9f8 Mon Sep 17 00:00:00 2001 From: koshigoe Date: Wed, 24 Jan 2018 16:13:07 +0900 Subject: [PATCH 2/4] Accept 4 arguments to allow to bump Bugsnag to 6.x. - API changed by https://github.com/bugsnag/bugsnag-ruby/pull/411 --- lib/bugsnag/delivery/fluent.rb | 2 +- spec/bugsnag/delivery/fluent_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/bugsnag/delivery/fluent.rb b/lib/bugsnag/delivery/fluent.rb index bef4799..5174874 100644 --- a/lib/bugsnag/delivery/fluent.rb +++ b/lib/bugsnag/delivery/fluent.rb @@ -23,7 +23,7 @@ class Configuration module Delivery class Fluent - def self.deliver(url, body, configuration) + def self.deliver(url, body, configuration, options = {}) begin logger = ::Fluent::Logger::FluentLogger.new( configuration.fluent_tag_prefix, diff --git a/spec/bugsnag/delivery/fluent_spec.rb b/spec/bugsnag/delivery/fluent_spec.rb index 0d4ea44..b37e078 100644 --- a/spec/bugsnag/delivery/fluent_spec.rb +++ b/spec/bugsnag/delivery/fluent_spec.rb @@ -20,7 +20,7 @@ expect(::Fluent::Logger::FluentLogger).to receive(:new).and_return(fluent_logger) end - subject { described_class.deliver(url, body, configuration) } + subject { described_class.deliver(url, body, configuration, {}) } context 'send successful' do before do From 40f35597b33536e51b4125eabfa22cfc28b997d0 Mon Sep 17 00:00:00 2001 From: koshigoe Date: Wed, 24 Jan 2018 16:35:17 +0900 Subject: [PATCH 3/4] Use `Bugsnag::Configuration.{warn,debug}` instead of `Bugsnag.{warn,debug}`. --- lib/bugsnag/delivery/fluent.rb | 8 ++++---- spec/bugsnag/delivery/fluent_spec.rb | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/bugsnag/delivery/fluent.rb b/lib/bugsnag/delivery/fluent.rb index 5174874..f06d72f 100644 --- a/lib/bugsnag/delivery/fluent.rb +++ b/lib/bugsnag/delivery/fluent.rb @@ -31,15 +31,15 @@ def self.deliver(url, body, configuration, options = {}) :port => configuration.fluent_port ) if logger.post('deliver', { :url => url, :body => body }) - Bugsnag.debug("Notification to #{url} finished, payload was #{body}") + configuration.debug("Notification to #{url} finished, payload was #{body}") else - Bugsnag.warn("Notification to #{url} failed, #{logger.last_error}") + configuration.warn("Notification to #{url} failed, #{logger.last_error}") end rescue StandardError => e raise if e.class.to_s == "RSpec::Expectations::ExpectationNotMetError" - Bugsnag.warn("Notification to #{url} failed, #{e.inspect}") - Bugsnag.warn(e.backtrace) + configuration.warn("Notification to #{url} failed, #{e.inspect}") + configuration.warn(e.backtrace) end end end diff --git a/spec/bugsnag/delivery/fluent_spec.rb b/spec/bugsnag/delivery/fluent_spec.rb index b37e078..a764490 100644 --- a/spec/bugsnag/delivery/fluent_spec.rb +++ b/spec/bugsnag/delivery/fluent_spec.rb @@ -29,7 +29,7 @@ it do expect(fluent_logger).to_not receive(:last_error) - expect(Bugsnag).to_not receive(:warn) + expect(configuration).to_not receive(:warn) subject end end @@ -42,7 +42,7 @@ it do expect(fluent_logger).to receive(:last_error).and_return('LAST ERROR') - expect(Bugsnag).to receive(:warn).with('Notification to http://www.example.com/ failed, LAST ERROR') + expect(configuration).to receive(:warn).with('Notification to http://www.example.com/ failed, LAST ERROR') subject end end @@ -54,7 +54,7 @@ it do expect(fluent_logger).to_not receive(:last_error) - expect(Bugsnag).to receive(:warn).exactly(2).times + expect(configuration).to receive(:warn).exactly(2).times subject end end From 4fe2e92a2349c5d166578c9d3879810944dc6777 Mon Sep 17 00:00:00 2001 From: koshigoe Date: Wed, 24 Jan 2018 16:15:12 +0900 Subject: [PATCH 4/4] Bump up version to `0.2.0`. --- lib/bugsnag/delivery/fluent/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bugsnag/delivery/fluent/version.rb b/lib/bugsnag/delivery/fluent/version.rb index 2c842cf..615995a 100644 --- a/lib/bugsnag/delivery/fluent/version.rb +++ b/lib/bugsnag/delivery/fluent/version.rb @@ -1,7 +1,7 @@ module Bugsnag module Delivery class Fluent - VERSION = "0.1.4" + VERSION = "0.2.0" end end end