rocket_pants 1.12.1 → 1.13.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -57,6 +57,13 @@ module RocketPants
57
57
  rescue LoadError => e
58
58
  end
59
59
 
60
+ # If possible, include Bugsnag methods in the Rails controller
61
+ begin
62
+ require 'bugsnag'
63
+ require 'bugsnag/rails/controller_methods'
64
+ MODULES << Bugsnag::Rails::ControllerMethods
65
+ rescue LoadError
66
+ end
60
67
 
61
68
  MODULES.each do |mixin|
62
69
  include mixin
@@ -2,7 +2,7 @@ module RocketPants
2
2
  # An alternative to Rail's built in ActionController::Rescue module,
3
3
  # tailored to deeply integrate rescue notififers into the application.
4
4
  #
5
- # Thus, it is relatively simple to
5
+ # Thus, it is relatively simple to
6
6
  module Rescuable
7
7
  extend ActiveSupport::Concern
8
8
  include ActiveSupport::Rescuable
@@ -10,7 +10,7 @@ module RocketPants
10
10
  DEFAULT_NOTIFIER_CALLBACK = lambda do |controller, exception, req|
11
11
  # Does nothing
12
12
  end
13
-
13
+
14
14
  NAMED_NOTIFIER_CALLBACKS = {
15
15
  :airbrake => lambda { |c, e, r|
16
16
  unless c.send(:airbrake_local_request?)
@@ -21,6 +21,9 @@ module RocketPants
21
21
  if controller.respond_to?(:notify_honeybadger, true)
22
22
  controller.send(:notify_honeybadger, exception)
23
23
  end
24
+ },
25
+ :bugsnag => lambda { |controller, exception, request|
26
+ controller.notify_bugsnag(exception, request: request)
24
27
  }
25
28
  }
26
29
 
@@ -33,7 +36,7 @@ module RocketPants
33
36
  module ClassMethods
34
37
 
35
38
  # Tells rocketpants to use the given exception handler to deal with errors.
36
- # E.g. use_named_exception_handler! :airbrake
39
+ # E.g. use_named_exception_notifier :airbrake
37
40
  # @param [Symbol] name the name of the exception handler to use.
38
41
  def use_named_exception_notifier(name)
39
42
  handler = NAMED_NOTIFIER_CALLBACKS.fetch(name, DEFAULT_NOTIFIER_CALLBACK)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rocket_pants
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.1
4
+ version: 1.13.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-05-25 00:00:00.000000000 Z
12
+ date: 2015-06-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack