exception_notification-bugsnag 0.3.0.preview1 → 0.3.0.preview2

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
  SHA256:
3
- metadata.gz: a45986dc9d34d84fa1aabb19ca8c92115729ef2cc8af428b7fb0657b102d1f3c
4
- data.tar.gz: a8ea170d50e76749b2f201e4066be5db2129eba46514a67705cb161caff975f0
3
+ metadata.gz: 25a0aef57f93ea4f815028fe7fdcf7f1b5f6472be2c5f0ae2291c7471a21a059
4
+ data.tar.gz: 43776033f4f0c32bc033d1a96ae90a568f248b09df82683b8c8a08d16338d55a
5
5
  SHA512:
6
- metadata.gz: 39a707384b3ba223bd69e01391468ab9b429bbdb1ef4b578b9f53d4fd9dd6fc9c29f8e888ea7dcc63ee0abc92c6bcf746eefb2f605a2bec5baf726e049ac2582
7
- data.tar.gz: bfe67a29f3846f2110c58a55683853f1b3bf2914aa29d4bf3acbbc7eb355df1d2a08636a8a720e8201405e0bc09058795952fbe98e34ad69f8f16cef68fb76a1
6
+ metadata.gz: 3f9a4b71f0ce2092b002492f9c3481fa7660c89e7507f684e3c4593adf6d67f660f2a77b0b60c1dfcb32b3d708b0969ef65d4f1a5514354e85977bce8326df85
7
+ data.tar.gz: 86a2501746f78cae18e84162314bef69b065b15df3aad5a8e6ad46f6d5f34ca2cf69998014d147499f17c701236095a06710da74f5ef1b824889f5dc581455f3
data/.gitignore CHANGED
@@ -1,4 +1,5 @@
1
1
  /.bundle/
2
+ /vendor/bundle
2
3
  /.yardoc
3
4
  /Gemfile.lock
4
5
  /_yardoc/
data/CHANGELOG.md CHANGED
@@ -2,23 +2,23 @@ Changelog
2
2
  ====
3
3
 
4
4
 
5
- [unreleased](https://github.com/koshigoe/exception_notification-bugsnag/compare/v0.2.0...master)
5
+ [unreleased](https://github.com/pocke/exception_notification-bugsnag/compare/v0.2.0...master)
6
6
  ----
7
7
 
8
- [Full Changelog](https://github.com/koshigoe/exception_notification-bugsnag/compare/v0.2.0...master)
8
+ [Full Changelog](https://github.com/pocke/exception_notification-bugsnag/compare/v0.2.0...master)
9
9
 
10
10
  ### Enhancements:
11
11
 
12
12
  ### Fixed Bugs:
13
13
 
14
14
 
15
- [0.2.0](https://github.com/koshigoe/exception_notification-bugsnag/compare/v0.1.0...v0.2.0)
15
+ [0.2.0](https://github.com/pocke/exception_notification-bugsnag/compare/v0.1.0...v0.2.0)
16
16
  ----
17
17
 
18
- [Full Changelog](https://github.com/koshigoe/exception_notification-bugsnag/compare/v0.1.0...v0.2.0)
18
+ [Full Changelog](https://github.com/pocke/exception_notification-bugsnag/compare/v0.1.0...v0.2.0)
19
19
 
20
20
  ### Breaking changes:
21
21
 
22
- - [#1 Use notify instead of auto notify by wata727](https://github.com/koshigoe/exception_notification-bugsnag/pull/1)
22
+ - [#1 Use notify instead of auto notify by wata727](https://github.com/pocke/exception_notification-bugsnag/pull/1)
23
23
 
24
24
  ### Fixed Bugs:
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/exception_notification-bugsnag.svg)](http://badge.fury.io/rb/exception_notification-bugsnag)
2
- ![Build Status](https://circleci.com/gh/koshigoe/exception_notification-bugsnag.svg?style=shield)
2
+ [![Build Status](https://travis-ci.org/pocke/exception_notification-bugsnag.svg?branch=master)](https://travis-ci.org/pocke/exception_notification-bugsnag)
3
3
 
4
4
  # ExceptionNotification::Bugsnag
5
5
 
@@ -23,9 +23,23 @@ Or install it yourself as:
23
23
 
24
24
  **NOTE: not use exception_notification's middleware.**
25
25
 
26
+ ```ruby
27
+ ExceptionNotifier.add_notifier :bugsnag
28
+ # or
29
+ ExceptionNotifier.add_notifier :bugsnag, severity: 'error'
26
30
  ```
27
- ExceptionNotifier.register_exception_notifier(:bugsnag, {})
28
- ExceptionNotifier.notify_exception(RuntimeError.new('TEST'))
31
+
32
+ ```ruby
33
+ begin
34
+ # some code...
35
+ rescue => err
36
+ ExceptionNotifier.notify_exception(err)
37
+ # or
38
+ ExceptionNotifier.notify_exception(err, severity: 'error')
39
+ # or
40
+ ExceptionNotifier.notify_exception(err) do |report|
41
+ report.severity = 'error'
42
+ end
29
43
  ```
30
44
 
31
45
  ### NOTE
@@ -40,7 +54,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
40
54
 
41
55
  ## Contributing
42
56
 
43
- 1. Fork it ( https://github.com/koshigoe/exception_notification-bugsnag/fork )
57
+ 1. Fork it ( https://github.com/pocke/exception_notification-bugsnag/fork )
44
58
  2. Create your feature branch (`git checkout -b my-new-feature`)
45
59
  3. Commit your changes (`git commit -am 'Add some feature'`)
46
60
  4. Push to the branch (`git push origin my-new-feature`)
@@ -24,5 +24,5 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency "rspec"
25
25
 
26
26
  spec.add_runtime_dependency 'exception_notification'
27
- spec.add_runtime_dependency 'bugsnag'
27
+ spec.add_runtime_dependency 'bugsnag', '>= 6'
28
28
  end
@@ -3,22 +3,22 @@ require 'exception_notifier'
3
3
 
4
4
  module ExceptionNotifier
5
5
  class BugsnagNotifier
6
- def initialize(options=nil, &default_block)
7
- @default_options = options
8
- @default_block = default_block
6
+ def initialize(options=nil)
7
+ @default_options = options || {}
9
8
  end
10
9
 
11
10
  def call(exception, options={}, &block)
12
- merged_block = proc do |notification|
13
- @default_block.call(notification) if @default_block
14
- block.call(notification) if block
15
- end
11
+ options = @default_options.merge(options)
12
+
13
+ wrapped_block = proc do |report|
14
+ options.each do |key, value|
15
+ report.public_send("#{key}=", value)
16
+ end
16
17
 
17
- if @default_options
18
- Bugsnag.notify(exception, @default_options.merge(options), &merged_block)
19
- else
20
- Bugsnag.notify(exception, &merged_block)
18
+ block.call(report) if block
21
19
  end
20
+
21
+ Bugsnag.notify(exception, &wrapped_block)
22
22
  end
23
23
  end
24
24
  end
@@ -1,5 +1,5 @@
1
1
  module ExceptionNotification
2
2
  module Bugsnag
3
- VERSION = "0.3.0.preview1"
3
+ VERSION = "0.3.0.preview2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exception_notification-bugsnag
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0.preview1
4
+ version: 0.3.0.preview2
5
5
  platform: ruby
6
6
  authors:
7
7
  - koshigoe
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-09 00:00:00.000000000 Z
11
+ date: 2018-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: '6'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: '6'
83
83
  description: Send exception info to Bugsnag.
84
84
  email:
85
85
  - koshigoeb@gmail.com