diff --git a/Gemfile.lock b/Gemfile.lock index dd6551f..8d21197 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - trouble (0.0.13) + trouble (0.1.0) GEM remote: https://rubygems.org/ @@ -47,4 +47,4 @@ DEPENDENCIES trouble! BUNDLED WITH - 1.13.6 + 1.16.4 diff --git a/lib/trouble.rb b/lib/trouble.rb index 63ad64c..fb6a906 100644 --- a/lib/trouble.rb +++ b/lib/trouble.rb @@ -47,10 +47,13 @@ def self.log(exception, metadata = nil) # Internal: Dispatch the Exception to the backend(s). # def self.notify_error_service(exception, metadata) - Bugsnag.notify(exception, metadata) if defined?(Bugsnag) + return unless defined? Bugsnag + Bugsnag.notify(exception) do |report| + report.metadata = metadata + end end - - # Internal: track exceptions metric + + # Internal: track exceptions metric # def self.increment_metric Meter.increment('exceptions') if defined?(Meter) diff --git a/lib/trouble/version.rb b/lib/trouble/version.rb index c1ffef4..c5819c4 100644 --- a/lib/trouble/version.rb +++ b/lib/trouble/version.rb @@ -1,8 +1,8 @@ module Trouble module VERSION #:nodoc: MAJOR = 0 - MINOR = 0 - TINY = 13 + MINOR = 1 + TINY = 0 STRING = [MAJOR, MINOR, TINY].compact.join('.') end diff --git a/spec/lib/trouble_spec.rb b/spec/lib/trouble_spec.rb index 6dccd70..737a14e 100644 --- a/spec/lib/trouble_spec.rb +++ b/spec/lib/trouble_spec.rb @@ -39,7 +39,9 @@ end it 'uses Bugsnag as notification backend' do - Bugsnag.should_receive(:notify).with(exception, metadata) + report = stub + report.should_receive(:metadata=).with(metadata) + Bugsnag.should_receive(:notify).with(exception).and_yield(report) trouble.notify exception, metadata end end