From 17aac59091420598e30778984b2e0268dc7496d7 Mon Sep 17 00:00:00 2001 From: Zhong Zheng Date: Sat, 10 Mar 2018 14:34:17 +1100 Subject: [PATCH 1/6] Add support for Bugsnag version 6 --- lib/rocket_pants/controller/rescuable.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/rocket_pants/controller/rescuable.rb b/lib/rocket_pants/controller/rescuable.rb index 1c9d9ac..d04562e 100644 --- a/lib/rocket_pants/controller/rescuable.rb +++ b/lib/rocket_pants/controller/rescuable.rb @@ -23,7 +23,13 @@ module Rescuable end }, :bugsnag => lambda { |controller, exception, request| - controller.send(:notify_bugsnag, exception, request: request) + if controller.respond_to?(:notify_bugsnag, true) + controller.send(:notify_bugsnag, exception, request: request) + else + # Bugsnag v6 removed #notify_bugsnag controller method + # Use #notify directly + Bugsnag.notify(exception) + end } } From f4be7c7c7fbc474810d90c2fa4b50d9184e0bf5d Mon Sep 17 00:00:00 2001 From: Zhong Zheng Date: Sun, 11 Mar 2018 23:59:57 +1100 Subject: [PATCH 2/6] :white_check_mark: Update spec to use Bugsnag class method --- spec/rocket_pants/controller/error_handling_spec.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/rocket_pants/controller/error_handling_spec.rb b/spec/rocket_pants/controller/error_handling_spec.rb index 9563650..8d23c64 100644 --- a/spec/rocket_pants/controller/error_handling_spec.rb +++ b/spec/rocket_pants/controller/error_handling_spec.rb @@ -75,6 +75,9 @@ before :each do controller_class.use_named_exception_notifier :bugsnag stub.instance_of(controller_class).notify_bugsnag {} + Bugsnag = Class.new do + define_singleton_method(:notify) { |exception| } + end end it 'should send notification when it is the named exception notifier' do From d3868f921b2677b04f83a092bba9a8f7dc077520 Mon Sep 17 00:00:00 2001 From: Zhong Zheng Date: Mon, 12 Mar 2018 00:21:02 +1100 Subject: [PATCH 3/6] :art: explicitly use old rspec gem --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 93bfc47..fce81fe 100644 --- a/Gemfile +++ b/Gemfile @@ -14,7 +14,7 @@ if (moneta_version = ENV["MONETA_VERSION"]) gem 'moneta', moneta_version end -gem 'rspec' +gem 'rspec', '~>3.3.2' if (wp_version = ENV['WILL_PAGINATE_VERSION']) gem 'will_paginate', wp_version From 0bb2fd0996f49c90f71fb726599539ff2092244e Mon Sep 17 00:00:00 2001 From: Zhong Zheng Date: Mon, 12 Mar 2018 00:27:40 +1100 Subject: [PATCH 4/6] update rspec version --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index fce81fe..f7f97d0 100644 --- a/Gemfile +++ b/Gemfile @@ -14,7 +14,7 @@ if (moneta_version = ENV["MONETA_VERSION"]) gem 'moneta', moneta_version end -gem 'rspec', '~>3.3.2' +gem 'rspec', '~>3.3.0' if (wp_version = ENV['WILL_PAGINATE_VERSION']) gem 'will_paginate', wp_version From 1cd446c420887932ac32b18e0c77f7d2486c119d Mon Sep 17 00:00:00 2001 From: Zhong Zheng Date: Mon, 12 Mar 2018 01:01:37 +1100 Subject: [PATCH 5/6] Revert "update rspec version" This reverts commit 0bb2fd0996f49c90f71fb726599539ff2092244e. --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index f7f97d0..fce81fe 100644 --- a/Gemfile +++ b/Gemfile @@ -14,7 +14,7 @@ if (moneta_version = ENV["MONETA_VERSION"]) gem 'moneta', moneta_version end -gem 'rspec', '~>3.3.0' +gem 'rspec', '~>3.3.2' if (wp_version = ENV['WILL_PAGINATE_VERSION']) gem 'will_paginate', wp_version From 82d76faf85ad50d45bf849d3196a0100dd949ecf Mon Sep 17 00:00:00 2001 From: Zhong Zheng Date: Mon, 12 Mar 2018 01:01:40 +1100 Subject: [PATCH 6/6] Revert ":art: explicitly use old rspec gem" This reverts commit d3868f921b2677b04f83a092bba9a8f7dc077520. --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index fce81fe..93bfc47 100644 --- a/Gemfile +++ b/Gemfile @@ -14,7 +14,7 @@ if (moneta_version = ENV["MONETA_VERSION"]) gem 'moneta', moneta_version end -gem 'rspec', '~>3.3.2' +gem 'rspec' if (wp_version = ENV['WILL_PAGINATE_VERSION']) gem 'will_paginate', wp_version