bugsnag 1.0.8 → 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/bugsnag.gemspec +2 -1
- data/lib/bugsnag.rb +1 -0
- data/lib/bugsnag/notification.rb +1 -1
- data/lib/bugsnag/resque.rb +29 -0
- data/test/test_bugsnag.rb +4 -3
- metadata +4 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.9
|
data/bugsnag.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "bugsnag"
|
8
|
-
s.version = "1.0.
|
8
|
+
s.version = "1.0.9"
|
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"]
|
@@ -35,6 +35,7 @@ Gem::Specification.new do |s|
|
|
35
35
|
"lib/bugsnag/rails/action_controller_rescue.rb",
|
36
36
|
"lib/bugsnag/rails/controller_methods.rb",
|
37
37
|
"lib/bugsnag/railtie.rb",
|
38
|
+
"lib/bugsnag/resque.rb",
|
38
39
|
"lib/bugsnag/version.rb",
|
39
40
|
"rails/init.rb",
|
40
41
|
"test/helper.rb",
|
data/lib/bugsnag.rb
CHANGED
data/lib/bugsnag/notification.rb
CHANGED
@@ -101,7 +101,7 @@ module Bugsnag
|
|
101
101
|
method_match = /in `([^']+)'/.match(method_str)
|
102
102
|
method = method_match.captures.first if method_match
|
103
103
|
end
|
104
|
-
trace_hash[:method] = method if method
|
104
|
+
trace_hash[:method] = method if method && (method =~ /^__bind/).nil?
|
105
105
|
|
106
106
|
if trace_hash[:file] && !trace_hash[:file].empty?
|
107
107
|
trace_hash
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# Resque support
|
2
|
+
|
3
|
+
# How to use:
|
4
|
+
# Resque::Failure::Multiple.classes = [Resque::Failure::Redis, Bugsnag::Resque]
|
5
|
+
# Resque::Failure.backend = Resque::Failure::Multiple
|
6
|
+
#
|
7
|
+
module Bugsnag
|
8
|
+
class Resque < Resque::Failure::Base
|
9
|
+
def self.configure
|
10
|
+
Resque::Failure.backend = self
|
11
|
+
::Bugsnag.configure(&block)
|
12
|
+
end
|
13
|
+
|
14
|
+
def save
|
15
|
+
Bugsnag.auto_notify(exception, bugsnag_job_data)
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
def bugsnag_job_data
|
20
|
+
{
|
21
|
+
:user_id => nil, # TODO: How to infer a user id in resque?
|
22
|
+
:context => "#{queue} (resque)",
|
23
|
+
:meta_data => {
|
24
|
+
:payload => payload
|
25
|
+
}
|
26
|
+
}
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/test/test_bugsnag.rb
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
require 'helper'
|
2
|
+
require 'logger'
|
2
3
|
|
3
4
|
class BugsnagTestException < RuntimeError; end
|
4
5
|
|
5
6
|
class TestBugsnag < Test::Unit::TestCase
|
6
|
-
should "
|
7
|
+
should "send a normal exception" do
|
7
8
|
Bugsnag.configure do |config|
|
8
|
-
config.api_key = "
|
9
|
-
config.endpoint = "http://localhost:8000/notify"
|
9
|
+
config.api_key = "2dd3f9aaef927b88be4e3c713b663354"
|
10
10
|
config.release_stage = "production"
|
11
11
|
config.project_root = File.dirname(__FILE__)
|
12
|
+
config.logger = Logger.new(STDOUT)
|
12
13
|
end
|
13
14
|
|
14
15
|
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:
|
4
|
+
hash: 5
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 9
|
10
|
+
version: 1.0.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- James Smith
|
@@ -133,6 +133,7 @@ files:
|
|
133
133
|
- lib/bugsnag/rails/action_controller_rescue.rb
|
134
134
|
- lib/bugsnag/rails/controller_methods.rb
|
135
135
|
- lib/bugsnag/railtie.rb
|
136
|
+
- lib/bugsnag/resque.rb
|
136
137
|
- lib/bugsnag/version.rb
|
137
138
|
- rails/init.rb
|
138
139
|
- test/helper.rb
|