egregious 0.2.12 → 0.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9f054b5425e665f2ebda249fb5df5e8f89b39f96
4
- data.tar.gz: a0b34cdbdd5fbd5938c9436c8d62b0f0c454033b
3
+ metadata.gz: 0fb95e4cdf55dc63158da950f693bd5e39165fc2
4
+ data.tar.gz: ec0d72a6c370e4f5bf03fe47e893721d30d6d910
5
5
  SHA512:
6
- metadata.gz: c782e63e62b4cf4013beee5d097ed70f4c304e3893edfbdaf58a519240d6621c363fe88370e38e52f15b74f290b2fcc92e19c0245c43d9f54f95f8c3f74937a1
7
- data.tar.gz: 653ae2c6121911c6c46f6931450b8ff0141d532676b4003372fe557e332ab6066ad38ca8a603507b4410a1e560103d48f080be666113e0f55e212df57e5ea4ee
6
+ metadata.gz: 832a49b50107f21af31d9850b0b05446fd33a141b2c89f923277f0300ddd8f237a78fceb562c0d506fd2b900181261f37761ae9a869beef9bdddf36786022cfb
7
+ data.tar.gz: 81027ccf7f59e37bd6205e0411ff9a98d84a9c3fa6c1123814b4a53ba9225924cf742478227a89c3b07cae599810d639cf01c94cd8c08d137a129058f5bc52f8
data/README.md CHANGED
@@ -1,15 +1,13 @@
1
1
  [![Build Status](https://travis-ci.org/voomify/egregious.svg?branch=master)](https://travis-ci.org/voomify/egregious)
2
2
  ##### Update Log:
3
3
 
4
+ * Version 0.2.13 Added Airbrake rack env to notifications for Airbrake 4 and 5
5
+
4
6
  * Version 0.2.12 Added support for Airbrake 5
5
7
 
6
8
  * Version 0.2.11 Fixed the development behavior that does not show the debugging screens when exceptions
7
9
  are thrown. Now when in development you will get the rails default exception handling screens for html requests.
8
10
 
9
- * Version 0.2.10 released to https://rubygems.org/gems/egregious on 10.28.2015
10
- Fixed bug where an exception defines http_status but returns nil.
11
- This was resulting in a status of 200 being returned, when it should be a 500.
12
-
13
11
  If you would like to contribute take a look at the issues feature list, fork and issue a pull request!
14
12
 
15
13
  ##### What is Egregious?
@@ -206,12 +206,14 @@ module Egregious
206
206
 
207
207
  # override this if you want to control what gets sent to airbrake
208
208
  def notify_airbrake(exception)
209
- # tested with airbrake 3.1.15, 4.2.1 and 5.0.5
209
+ # tested with airbrake 4.3.5 and 5.0.5
210
210
  if defined?(Airbrake)
211
211
  if(Airbrake.respond_to?(:notify_or_ignore))
212
- env['airbrake.error_id'] = Airbrake.notify_or_ignore(exception) # V4
212
+ env['airbrake.error_id'] = Airbrake.notify_or_ignore(exception, airbrake_request_data) # V4
213
213
  else
214
- env['airbrake.error_id'] = Airbrake.notify(exception) # V5
214
+ # V5
215
+ notice = Airbrake::Rack::NoticeBuilder.new(env).build_notice(exception)
216
+ env['airbrake.error_id'] = Airbrake.notify(notice)
215
217
  end
216
218
  end
217
219
  end
@@ -1,3 +1,3 @@
1
1
  module Egregious
2
- VERSION = "0.2.12"
2
+ VERSION = "0.2.13"
3
3
  end
@@ -3,9 +3,19 @@ require 'spec_helper'
3
3
 
4
4
  def rescue_from(exception, options)
5
5
  end
6
- def env
6
+
7
+ def airbrake_request_data
7
8
  {}
8
9
  end
10
+
11
+ %w(env params session).each do |store|
12
+ eval <<-RX
13
+ def #{store}
14
+ {}
15
+ end
16
+ RX
17
+ end
18
+
9
19
  include Egregious
10
20
 
11
21
  describe Egregious do
@@ -21,6 +31,11 @@ describe Egregious do
21
31
  end
22
32
  end
23
33
  context "notify_airbrake 5" do
34
+ class Airbrake::Rack::NoticeBuilder
35
+ def initialize(env);end
36
+ def build_notice(exception);end
37
+ end
38
+
24
39
  class << Airbrake
25
40
  remove_method :notify_or_ignore
26
41
  def self.notify(*params)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: egregious
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.12
4
+ version: 0.2.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Russell Edens
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-18 00:00:00.000000000 Z
11
+ date: 2016-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails