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 CHANGED
@@ -1 +1 @@
1
- 1.0.8
1
+ 1.0.9
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "bugsnag"
8
- s.version = "1.0.8"
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",
@@ -7,6 +7,7 @@ require "bugsnag/helpers"
7
7
 
8
8
  require "bugsnag/rack"
9
9
  require "bugsnag/railtie" if defined?(Rails::Railtie)
10
+ require "bugsnag/resque" if defined?(Resque)
10
11
 
11
12
  module Bugsnag
12
13
  LOG_PREFIX = "** [Bugsnag] "
@@ -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
@@ -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 "get a 200 response from bugsnag for exceptions" do
7
+ should "send a normal exception" do
7
8
  Bugsnag.configure do |config|
8
- config.api_key = "a799e9c27c3fb3017e4a556fd815317e"
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: 7
4
+ hash: 5
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 8
10
- version: 1.0.8
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