bug_courier 1.0.0 → 1.1.0

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: 36cb1c6c27aafcb8c121c7c45abd1096704ba4f2c93dac261cfc65edac80cf48
4
- data.tar.gz: 6331194fdee5a7140ab0bc951efe0d4a18d16415813275a0991b58fe30aaa2d0
3
+ metadata.gz: 06a59c97109d6c2be94e289fd37b08cab43775c9d5d2df0da6689e278cb29d78
4
+ data.tar.gz: 7cd768fbe85fbe9168ffc50eb5e63257abbf6a559d7740b0be588d5410a79582
5
5
  SHA512:
6
- metadata.gz: cdb705a50f9c96731d8acf9f2c0960ad5bedc34a477e452b3e68895db8f22ca5001f91d461546e03eeafcae6957729dfc41b284442825cada9e7df093ed8d2bf
7
- data.tar.gz: 1c185ff6306357c3b1cec72dff37018c97cf42c0c8b1054da8683fc52c5a242c5afd9f80a3bf9809e3ec587fe01df0a85a63b59bd12daf27f52ee3d2cb7601c4
6
+ metadata.gz: 8c5420222883243f061d091ec1cf676a9c2f8f8e6524a1a0b3247c76eff4968e031d3c93483bf697afb35cb4eda6b72002d630f4e4b919fbf5109b3fe8ca549a
7
+ data.tar.gz: 3e754802ec9770ebce2663c6944fbaf38289657bd02493de66e4212326c192d3cb534c4b86bde27f9f299d03d6fe3bc8231684c95e264c4d7fac1409fdc2f045
@@ -3,7 +3,7 @@
3
3
  module BugCourier
4
4
  class Configuration
5
5
  attr_accessor :access_token, :repo, :labels, :assignees, :enabled,
6
- :deduplicate, :rate_limit, :callback
6
+ :deduplicate, :rate_limit, :callback, :ignore_exceptions
7
7
 
8
8
  def initialize
9
9
  @access_token = nil
@@ -14,6 +14,7 @@ module BugCourier
14
14
  @deduplicate = true
15
15
  @rate_limit = 10 # max issues per hour
16
16
  @callback = nil
17
+ @ignore_exceptions = []
17
18
  end
18
19
 
19
20
  def valid?
@@ -30,6 +30,7 @@ module BugCourier
30
30
  def handle(exception, env = {})
31
31
  return unless BugCourier.configuration.enabled
32
32
  return unless BugCourier.configuration.valid?
33
+ return if ignored?(exception)
33
34
  return unless @rate_limiter.allow?
34
35
 
35
36
  title = build_title(exception)
@@ -137,5 +138,14 @@ module BugCourier
137
138
 
138
139
  params.except("controller", "action").to_s.slice(0, 500)
139
140
  end
141
+
142
+ def ignored?(exception)
143
+ BugCourier.configuration.ignore_exceptions.any? do |klass|
144
+ klass = Object.const_get(klass) if klass.is_a?(String)
145
+ exception.is_a?(klass)
146
+ rescue NameError
147
+ false
148
+ end
149
+ end
140
150
  end
141
151
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BugCourier
4
- VERSION = "1.0.0"
4
+ VERSION = "1.1.0"
5
5
  end
@@ -34,6 +34,12 @@ module BugCourier
34
34
  # Maximum number of issues to create per hour (default: 10)
35
35
  # config.rate_limit = 10
36
36
 
37
+ # Exception classes to ignore — these will not be reported (default: [])
38
+ # config.ignore_exceptions = [
39
+ # ActiveRecord::RecordNotFound,
40
+ # ActionController::RoutingError,
41
+ # ]
42
+
37
43
  # Optional callback — called after issue creation or commenting
38
44
  # config.callback = ->(action, issue) {
39
45
  # Rails.logger.info("[BugCourier] \#{action}: \#{issue['html_url']}")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bug_courier
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steffen Hansen