bugsnag 1.2.2 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.2
1
+ 1.2.3
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "bugsnag"
8
- s.version = "1.2.2"
8
+ s.version = "1.2.3"
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-10-01"
12
+ s.date = "2012-10-03"
13
13
  s.description = "Ruby notifier for bugsnag.com"
14
14
  s.email = "james@bugsnag.com"
15
15
  s.extra_rdoc_files = [
@@ -30,6 +30,7 @@ Gem::Specification.new do |s|
30
30
  "lib/bugsnag.rb",
31
31
  "lib/bugsnag/capistrano.rb",
32
32
  "lib/bugsnag/configuration.rb",
33
+ "lib/bugsnag/delay/resque.rb",
33
34
  "lib/bugsnag/helpers.rb",
34
35
  "lib/bugsnag/middleware/callbacks.rb",
35
36
  "lib/bugsnag/middleware/rack_request.rb",
@@ -25,6 +25,9 @@ module Bugsnag
25
25
 
26
26
  yield(configuration) if block_given?
27
27
 
28
+ # Use resque for asynchronous notification if required
29
+ require "bugsnag/delay/resque" if configuration.delay_with_resque && defined?(Resque)
30
+
28
31
  # Log that we are ready to rock
29
32
  if configuration.api_key && !@logged_ready
30
33
  log "Bugsnag exception handler #{VERSION} ready, api_key=#{configuration.api_key}"
@@ -16,6 +16,7 @@ module Bugsnag
16
16
  attr_accessor :endpoint
17
17
  attr_accessor :logger
18
18
  attr_accessor :middleware
19
+ attr_accessor :delay_with_resque
19
20
 
20
21
  THREAD_LOCAL_NAME = "bugsnag_req_data"
21
22
 
@@ -0,0 +1,21 @@
1
+ module Bugsnag
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
8
+ end
9
+ end
10
+ end
11
+
12
+ Bugsnag::Notification.class_eval do
13
+ class << self
14
+ def deliver_exception_payload_with_resque(*args)
15
+ Resque.enqueue(Bugsnag::Delay::Resque, *args)
16
+ end
17
+
18
+ alias_method :deliver_exception_payload_without_resque, :deliver_exception_payload
19
+ alias_method :deliver_exception_payload, :deliver_exception_payload_with_resque
20
+ end
21
+ end
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: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 2
10
- version: 1.2.2
9
+ - 3
10
+ version: 1.2.3
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-10-01 00:00:00 Z
18
+ date: 2012-10-03 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  requirement: &id001 !ruby/object:Gem::Requirement
@@ -124,6 +124,7 @@ files:
124
124
  - lib/bugsnag.rb
125
125
  - lib/bugsnag/capistrano.rb
126
126
  - lib/bugsnag/configuration.rb
127
+ - lib/bugsnag/delay/resque.rb
127
128
  - lib/bugsnag/helpers.rb
128
129
  - lib/bugsnag/middleware/callbacks.rb
129
130
  - lib/bugsnag/middleware/rack_request.rb