bugsnag 1.0.7 → 1.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,7 +9,7 @@ GEM
9
9
  bundler (~> 1.0)
10
10
  git (>= 1.2.5)
11
11
  rake
12
- multi_json (1.0.3)
12
+ multi_json (1.1.0)
13
13
  rake (0.9.2)
14
14
  rcov (0.9.11)
15
15
  shoulda (2.11.3)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.7
1
+ 1.0.8
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "bugsnag"
8
- s.version = "1.0.7"
8
+ s.version = "1.0.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-01-16"
12
+ s.date = "2012-02-27"
13
13
  s.description = "Ruby notifier for bugsnag.com"
14
14
  s.email = "james@bugsnag.com"
15
15
  s.extra_rdoc_files = [
@@ -27,6 +27,7 @@ Gem::Specification.new do |s|
27
27
  "bugsnag.gemspec",
28
28
  "lib/bugsnag.rb",
29
29
  "lib/bugsnag/configuration.rb",
30
+ "lib/bugsnag/delay/resque.rb",
30
31
  "lib/bugsnag/helpers.rb",
31
32
  "lib/bugsnag/notification.rb",
32
33
  "lib/bugsnag/rack.rb",
@@ -34,7 +35,6 @@ Gem::Specification.new do |s|
34
35
  "lib/bugsnag/rails/action_controller_rescue.rb",
35
36
  "lib/bugsnag/rails/controller_methods.rb",
36
37
  "lib/bugsnag/railtie.rb",
37
- "lib/bugsnag/resque.rb",
38
38
  "lib/bugsnag/version.rb",
39
39
  "rails/init.rb",
40
40
  "test/helper.rb",
@@ -43,7 +43,7 @@ Gem::Specification.new do |s|
43
43
  s.homepage = "http://github.com/bugsnag/bugsnag-ruby"
44
44
  s.licenses = ["MIT"]
45
45
  s.require_paths = ["lib"]
46
- s.rubygems_version = "1.8.10"
46
+ s.rubygems_version = "1.8.15"
47
47
  s.summary = "Ruby notifier for bugsnag.com"
48
48
 
49
49
  if s.respond_to? :specification_version then
@@ -17,7 +17,7 @@ module Bugsnag
17
17
  yield(configuration)
18
18
 
19
19
  # Use resque for asynchronous notification if required
20
- require "bugsnag/resque" if configuration.use_resque && defined?(Resque)
20
+ require "bugsnag/delay/resque" if configuration.delay_with_resque && defined?(Resque)
21
21
 
22
22
  # Log that we are ready to rock
23
23
  if configuration.api_key && !@logged_ready
@@ -1,15 +1,13 @@
1
1
  module Bugsnag
2
2
  class Configuration
3
3
  OPTIONS = [
4
- :api_key, :release_stage, :project_root, :app_version,
4
+ :api_key, :release_stage, :use_ssl, :project_root, :app_version,
5
5
  :framework, :endpoint, :logger, :disable_auto_notification,
6
6
  :params_filters, :stacktrace_filters, :ignore_classes,
7
- :use_resque
7
+ :delay_with_resque
8
8
  ]
9
9
  OPTIONS.each {|o| attr_accessor o }
10
10
 
11
-
12
- DEFAULT_ENDPOINT = "http://api.bugsnag.com/notify"
13
11
  DEFAULT_PARAMS_FILTERS = %w(password password_confirmation).freeze
14
12
 
15
13
  DEFAULT_STACKTRACE_FILTERS = [
@@ -42,7 +40,6 @@ module Bugsnag
42
40
 
43
41
 
44
42
  def initialize
45
- @endpoint = DEFAULT_ENDPOINT
46
43
  @params_filters = DEFAULT_PARAMS_FILTERS.dup
47
44
  @stacktrace_filters = DEFAULT_STACKTRACE_FILTERS.dup
48
45
  @ignore_classes = DEFAULT_IGNORE_CLASSES.dup
@@ -1,8 +1,10 @@
1
1
  module Bugsnag
2
- class Resque
3
- @queue = "bugsnag"
4
- def self.perform(*args)
5
- Bugsnag::Notification.deliver_exception_payload_without_resque(*args)
2
+ module Delay
3
+ class Resque
4
+ @queue = "bugsnag"
5
+ def self.perform(*args)
6
+ Bugsnag::Notification.deliver_exception_payload_without_resque(*args)
7
+ end
6
8
  end
7
9
  end
8
10
  end
@@ -10,7 +12,7 @@ end
10
12
  Bugsnag::Notification.class_eval do
11
13
  class << self
12
14
  def deliver_exception_payload_with_resque(*args)
13
- Resque.enqueue(Bugsnag::Resque, *args)
15
+ Resque.enqueue(Bugsnag::Delay::Resque, *args)
14
16
  end
15
17
 
16
18
  alias_method :deliver_exception_payload_without_resque, :deliver_exception_payload
@@ -8,7 +8,9 @@ module Bugsnag
8
8
  NOTIFIER_NAME = "Ruby Bugsnag Notifier"
9
9
  NOTIFIER_VERSION = Bugsnag::VERSION
10
10
  NOTIFIER_URL = "http://www.bugsnag.com"
11
-
11
+
12
+ DEFAULT_ENDPOINT = "api.bugsnag.com/notify"
13
+
12
14
  # HTTParty settings
13
15
  headers "Content-Type" => "application/json"
14
16
  default_timeout 5
@@ -22,7 +24,7 @@ module Bugsnag
22
24
  # Attributes from configuration
23
25
  attr_accessor :api_key, :params_filters, :stacktrace_filters,
24
26
  :ignore_classes, :endpoint, :app_version, :release_stage,
25
- :project_root
27
+ :project_root, :use_ssl
26
28
 
27
29
 
28
30
  def self.deliver_exception_payload(endpoint, payload_string)
@@ -41,6 +43,11 @@ module Bugsnag
41
43
  end
42
44
 
43
45
  def deliver
46
+ # Unless we are using a custom endpoint, use api.bugsnag.com, and work out protocol
47
+ unless self.endpoint
48
+ self.endpoint = (self.use_ssl ? "https://" : "http://") + DEFAULT_ENDPOINT
49
+ end
50
+
44
51
  Bugsnag.log("Notifying #{self.endpoint} of exception")
45
52
 
46
53
  payload = {
@@ -60,7 +67,7 @@ module Bugsnag
60
67
  end
61
68
 
62
69
  def ignore?
63
- self.ignore_classes.include?(self.exception.class.to_s)
70
+ self.ignore_classes.include?(error_class(self.exception))
64
71
  end
65
72
 
66
73
 
@@ -106,10 +113,16 @@ module Bugsnag
106
113
 
107
114
  def exception_hash
108
115
  {
109
- :errorClass => self.exception.class.to_s,
116
+ :errorClass => error_class(self.exception),
110
117
  :message => self.exception.message,
111
118
  :stacktrace => stacktrace_hash
112
119
  }
113
120
  end
121
+
122
+ def error_class(exception)
123
+ # The "Class" check is for some strange exceptions like Timeout::Error
124
+ # which throw the error class instead of an instance
125
+ (exception.is_a? Class) ? exception.name : exception.class.name
126
+ end
114
127
  end
115
128
  end
@@ -9,7 +9,6 @@ class TestBugsnag < Test::Unit::TestCase
9
9
  config.endpoint = "http://localhost:8000/notify"
10
10
  config.release_stage = "production"
11
11
  config.project_root = File.dirname(__FILE__)
12
- config.user_id = "static_user_id"
13
12
  end
14
13
 
15
14
  begin
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: 25
4
+ hash: 7
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 7
10
- version: 1.0.7
9
+ - 8
10
+ version: 1.0.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - James Smith
@@ -15,11 +15,10 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-01-16 00:00:00 Z
18
+ date: 2012-02-27 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
- prerelease: false
22
- requirement: &id001 !ruby/object:Gem::Requirement
21
+ version_requirements: &id001 !ruby/object:Gem::Requirement
23
22
  none: false
24
23
  requirements:
25
24
  - - ">="
@@ -28,12 +27,12 @@ dependencies:
28
27
  segments:
29
28
  - 0
30
29
  version: "0"
31
- version_requirements: *id001
32
- name: multi_json
30
+ requirement: *id001
33
31
  type: :runtime
34
- - !ruby/object:Gem::Dependency
35
32
  prerelease: false
36
- requirement: &id002 !ruby/object:Gem::Requirement
33
+ name: multi_json
34
+ - !ruby/object:Gem::Dependency
35
+ version_requirements: &id002 !ruby/object:Gem::Requirement
37
36
  none: false
38
37
  requirements:
39
38
  - - ">="
@@ -42,12 +41,12 @@ dependencies:
42
41
  segments:
43
42
  - 0
44
43
  version: "0"
45
- version_requirements: *id002
46
- name: httparty
44
+ requirement: *id002
47
45
  type: :runtime
48
- - !ruby/object:Gem::Dependency
49
46
  prerelease: false
50
- requirement: &id003 !ruby/object:Gem::Requirement
47
+ name: httparty
48
+ - !ruby/object:Gem::Dependency
49
+ version_requirements: &id003 !ruby/object:Gem::Requirement
51
50
  none: false
52
51
  requirements:
53
52
  - - ">="
@@ -56,12 +55,12 @@ dependencies:
56
55
  segments:
57
56
  - 0
58
57
  version: "0"
59
- version_requirements: *id003
60
- name: shoulda
58
+ requirement: *id003
61
59
  type: :development
62
- - !ruby/object:Gem::Dependency
63
60
  prerelease: false
64
- requirement: &id004 !ruby/object:Gem::Requirement
61
+ name: shoulda
62
+ - !ruby/object:Gem::Dependency
63
+ version_requirements: &id004 !ruby/object:Gem::Requirement
65
64
  none: false
66
65
  requirements:
67
66
  - - ~>
@@ -72,12 +71,12 @@ dependencies:
72
71
  - 0
73
72
  - 0
74
73
  version: 1.0.0
75
- version_requirements: *id004
76
- name: bundler
74
+ requirement: *id004
77
75
  type: :development
78
- - !ruby/object:Gem::Dependency
79
76
  prerelease: false
80
- requirement: &id005 !ruby/object:Gem::Requirement
77
+ name: bundler
78
+ - !ruby/object:Gem::Dependency
79
+ version_requirements: &id005 !ruby/object:Gem::Requirement
81
80
  none: false
82
81
  requirements:
83
82
  - - ~>
@@ -88,12 +87,12 @@ dependencies:
88
87
  - 6
89
88
  - 4
90
89
  version: 1.6.4
91
- version_requirements: *id005
92
- name: jeweler
90
+ requirement: *id005
93
91
  type: :development
94
- - !ruby/object:Gem::Dependency
95
92
  prerelease: false
96
- requirement: &id006 !ruby/object:Gem::Requirement
93
+ name: jeweler
94
+ - !ruby/object:Gem::Dependency
95
+ version_requirements: &id006 !ruby/object:Gem::Requirement
97
96
  none: false
98
97
  requirements:
99
98
  - - ">="
@@ -102,9 +101,10 @@ dependencies:
102
101
  segments:
103
102
  - 0
104
103
  version: "0"
105
- version_requirements: *id006
106
- name: rcov
104
+ requirement: *id006
107
105
  type: :development
106
+ prerelease: false
107
+ name: rcov
108
108
  description: Ruby notifier for bugsnag.com
109
109
  email: james@bugsnag.com
110
110
  executables: []
@@ -125,6 +125,7 @@ files:
125
125
  - bugsnag.gemspec
126
126
  - lib/bugsnag.rb
127
127
  - lib/bugsnag/configuration.rb
128
+ - lib/bugsnag/delay/resque.rb
128
129
  - lib/bugsnag/helpers.rb
129
130
  - lib/bugsnag/notification.rb
130
131
  - lib/bugsnag/rack.rb
@@ -132,7 +133,6 @@ files:
132
133
  - lib/bugsnag/rails/action_controller_rescue.rb
133
134
  - lib/bugsnag/rails/controller_methods.rb
134
135
  - lib/bugsnag/railtie.rb
135
- - lib/bugsnag/resque.rb
136
136
  - lib/bugsnag/version.rb
137
137
  - rails/init.rb
138
138
  - test/helper.rb
@@ -166,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
166
166
  requirements: []
167
167
 
168
168
  rubyforge_project:
169
- rubygems_version: 1.8.10
169
+ rubygems_version: 1.8.15
170
170
  signing_key:
171
171
  specification_version: 3
172
172
  summary: Ruby notifier for bugsnag.com