bugsnag 1.2.7 → 1.2.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,76 @@
1
+ Changelog
2
+ =========
3
+
4
+ 1.2.8
5
+ -----
6
+ - Added `disable` method to Bugsnag middleware, allows you to force-disable
7
+ built-in Bugsnag middleware.
8
+
9
+ 1.2.7
10
+ -----
11
+ - Protect against rare exception-unwrapping infinite loop
12
+ (only in some exceptions using the `original_exception` pattern)
13
+
14
+ 1.2.6
15
+ -----
16
+ - Fix for rails 2 request data extraction
17
+ - Deploy environment customization support (thanks coop)
18
+ - Ensure Bugsnag rails 3 middleware runs before initializers
19
+
20
+ 1.2.5
21
+ -----
22
+ - Show a warning if no release_stage is set when delivering exceptions
23
+ - Require resque plugin in a safer way
24
+
25
+ 1.2.4
26
+ -----
27
+ - Automatically set the release_stage in a safer way on rack/rails
28
+
29
+ 1.2.3
30
+ -----
31
+ - Re-add support for sending bugsnag notifications via resque
32
+
33
+ 1.2.2
34
+ -----
35
+ - Add rspec tests for rack middleware
36
+
37
+ 1.2.1
38
+ -----
39
+ - Fix a bug where before/after hooks were not being fired
40
+
41
+ 1.2.0
42
+ -----
43
+ - Added Bugsnag Middleware and callback, easier ways to add custom data to
44
+ your exceptions
45
+ - Added automatic Sidekiq integration
46
+ - Added automatic Devise integration
47
+ - Comprehensive rspec tests
48
+
49
+ 1.1.5
50
+ -----
51
+ - Fix minor internal version number parsing bug
52
+
53
+ 1.1.4
54
+ -----
55
+ - Move Bugsnag rack middleware later in the middleware stack, fixes
56
+ issue where development exception may not have been delivered
57
+
58
+ 1.1.3
59
+ -----
60
+ - Fix multi_json conflict with rails 3.1
61
+ - Make bugsnag_request_data public for easier EventMachine integration
62
+ (thanks fblee)
63
+
64
+ 1.1.2
65
+ -----
66
+ - Fix multi_json gem dependency conflicts
67
+
68
+ 1.1.1
69
+ -----
70
+ - Capistrano deploy tracking support
71
+ - More reliable project_root detection for non-rails rack apps
72
+ - Support for sending test exceptions from rake (`rake bugsnag:test_exception`)
73
+
74
+ 1.1.0
75
+ -----
76
+ - First public release
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.7
1
+ 1.2.8
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "bugsnag"
8
- s.version = "1.2.7"
8
+ s.version = "1.2.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["James Smith"]
12
- s.date = "2012-12-10"
12
+ s.date = "2013-01-08"
13
13
  s.description = "Ruby notifier for bugsnag.com"
14
14
  s.email = "james@bugsnag.com"
15
15
  s.extra_rdoc_files = [
@@ -20,6 +20,7 @@ Gem::Specification.new do |s|
20
20
  ".document",
21
21
  ".rspec",
22
22
  ".travis.yml",
23
+ "CHANGELOG.md",
23
24
  "Gemfile",
24
25
  "Gemfile.lock",
25
26
  "LICENSE.txt",
@@ -2,17 +2,18 @@ module Bugsnag
2
2
  class MiddlewareStack
3
3
  def initialize
4
4
  @middlewares = []
5
+ @disabled_middleware = []
5
6
  end
6
7
 
7
8
  def use(new_middleware)
8
- @middlewares << new_middleware
9
- end
9
+ return if @disabled_middleware.include?(new_middleware)
10
10
 
11
- def delete(middleware)
12
- @middlewares.delete(middleware)
11
+ @middlewares << new_middleware
13
12
  end
14
13
 
15
14
  def insert_after(after, new_middleware)
15
+ return if @disabled_middleware.include?(new_middleware)
16
+
16
17
  index = @middlewares.rindex(after)
17
18
  if index.nil?
18
19
  @middlewares << new_middleware
@@ -22,10 +23,18 @@ module Bugsnag
22
23
  end
23
24
 
24
25
  def insert_before(before, new_middleware)
26
+ return if @disabled_middleware.include?(new_middleware)
27
+
25
28
  index = @middlewares.index(before) || @middlewares.length
26
29
  @middlewares.insert index, new_middleware
27
30
  end
28
31
 
32
+ def disable(*middlewares)
33
+ @disabled_middleware += middlewares
34
+
35
+ @middlewares.delete_if {|m| @disabled_middleware.include?(m)}
36
+ end
37
+
29
38
  # This allows people to proxy methods to the array if they want to do more complex stuff
30
39
  def method_missing(method, *args, &block)
31
40
  @middlewares.send(method, *args, &block)
@@ -87,4 +87,18 @@ describe Bugsnag::MiddlewareStack do
87
87
 
88
88
  callback_run_count.should be == 1
89
89
  end
90
+
91
+ it "should not execute disabled bugsnag middleware" do
92
+ callback_run_count = 0
93
+ Bugsnag.configure do |config|
94
+ config.middleware.disable(Bugsnag::Middleware::Callbacks)
95
+ end
96
+
97
+ Bugsnag.before_notify_callbacks << lambda {|notif|
98
+ callback_run_count += 1
99
+ }
100
+
101
+ Bugsnag.notify(BugsnagTestException.new("It crashed"))
102
+ callback_run_count.should be == 0
103
+ end
90
104
  end
@@ -2,14 +2,7 @@ require 'spec_helper'
2
2
  require 'securerandom'
3
3
 
4
4
  module ActiveRecord; class RecordNotFound < RuntimeError; end; end
5
-
6
- class RecursiveException < StandardError
7
- attr_accessor :original_exception
8
- def initialize(*args)
9
- self.original_exception = self
10
- super(message)
11
- end
12
- end
5
+ class NestedException < StandardError; attr_accessor :original_exception; end
13
6
 
14
7
  describe Bugsnag::Notification do
15
8
  it "should contain an api_key if one is set" do
@@ -301,10 +294,14 @@ describe Bugsnag::Notification do
301
294
 
302
295
  it "should not unwrap the same exception twice" do
303
296
  Bugsnag::Notification.should_receive(:deliver_exception_payload) do |endpoint, payload|
304
- get_exception_from_payload(payload)
297
+ event = get_event_from_payload(payload)
298
+ event[:exceptions].should have(1).items
305
299
  end
306
300
 
307
- Bugsnag.notify_or_ignore(RecursiveException.new("Self-referential exception"))
301
+ ex = NestedException.new("Self-referential exception")
302
+ ex.original_exception = ex
303
+
304
+ Bugsnag.notify_or_ignore(ex)
308
305
  end
309
306
 
310
307
  it "should not unwrap more than 5 exceptions" do
@@ -313,9 +310,9 @@ describe Bugsnag::Notification do
313
310
  event[:exceptions].should have(5).items
314
311
  end
315
312
 
316
- first_ex = ex = RecursiveException.new("Deep exception")
313
+ first_ex = ex = NestedException.new("Deep exception")
317
314
  10.times do |idx|
318
- ex = ex.original_exception = RecursiveException.new("Deep exception #{idx}")
315
+ ex = ex.original_exception = NestedException.new("Deep exception #{idx}")
319
316
  end
320
317
 
321
318
  Bugsnag.notify_or_ignore(first_ex)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bugsnag
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 7
10
- version: 1.2.7
9
+ - 8
10
+ version: 1.2.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - James Smith
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-12-10 00:00:00 Z
18
+ date: 2013-01-08 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  requirement: &id001 !ruby/object:Gem::Requirement
@@ -114,6 +114,7 @@ files:
114
114
  - .document
115
115
  - .rspec
116
116
  - .travis.yml
117
+ - CHANGELOG.md
117
118
  - Gemfile
118
119
  - Gemfile.lock
119
120
  - LICENSE.txt