honeybadger 2.0.4 → 2.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/honeybadger/config.rb +29 -6
- data/lib/honeybadger/config/defaults.rb +8 -2
- data/lib/honeybadger/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 068b9e2194b424660cdbb40d19fa3c22c60d9968
|
4
|
+
data.tar.gz: 68181b2849fb96625616363debd565a8bb2f245f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 020b001e540dd1ed39ce283d073b6756dc1159759bdf0d49427995d07e2b6c3ce5033ef01e40ab3e2055066f21827b152c6d94a74738c17aa8b9eff8a970d4e3
|
7
|
+
data.tar.gz: ebd0b1d4b62e87696dda8a1b18d8d6f0c72f1702155bce273bad363d8d93ca25d33ce061d3f6e2dd22104f93c60a3a0eeeb708957a161fea7daafaf4f35a9b96
|
data/CHANGELOG.md
CHANGED
data/lib/honeybadger/config.rb
CHANGED
@@ -33,16 +33,22 @@ module Honeybadger
|
|
33
33
|
|
34
34
|
FEATURES = [:notices, :local_variables, :metrics, :traces].freeze
|
35
35
|
|
36
|
+
MERGE_DEFAULT = [:'exceptions.ignore'].freeze
|
37
|
+
|
38
|
+
OVERRIDE = {
|
39
|
+
:'exceptions.ignore' => :'exceptions.ignore_only'
|
40
|
+
}.freeze
|
41
|
+
|
36
42
|
def initialize(opts = {})
|
37
43
|
l = opts.delete(:logger)
|
38
44
|
|
39
45
|
@values = opts
|
40
46
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
update(
|
47
|
+
priority = {}
|
48
|
+
priority.update(opts)
|
49
|
+
load_config_from_disk {|yml| priority.update(yml) }
|
50
|
+
priority.update(Env.new(ENV))
|
51
|
+
update(merge_defaults!(priority))
|
46
52
|
|
47
53
|
@logger = Logging::ConfigLogger.new(self, build_logger(l))
|
48
54
|
Logging::BootLogger.instance.flush(@logger)
|
@@ -56,7 +62,9 @@ module Honeybadger
|
|
56
62
|
|
57
63
|
def get(key)
|
58
64
|
key = key.to_sym
|
59
|
-
if @values.
|
65
|
+
if OVERRIDE.has_key?(key) && @values.has_key?(OVERRIDE[key])
|
66
|
+
@values[OVERRIDE[key]]
|
67
|
+
elsif @values.has_key?(key)
|
60
68
|
@values[key]
|
61
69
|
else
|
62
70
|
DEFAULTS[key]
|
@@ -351,5 +359,20 @@ api_key: '#{self[:api_key]}'
|
|
351
359
|
def symbolize_keys(hash)
|
352
360
|
Hash[hash.map {|k,v| [k.to_sym, v] }]
|
353
361
|
end
|
362
|
+
|
363
|
+
# Internal: Merges supplied config options with defaults.
|
364
|
+
#
|
365
|
+
# config - The Hash config options to merge.
|
366
|
+
#
|
367
|
+
# Returns the updated Hash config with merged values.
|
368
|
+
def merge_defaults!(config)
|
369
|
+
MERGE_DEFAULT.each do |option|
|
370
|
+
if config[option].kind_of?(Array)
|
371
|
+
config[option] = (DEFAULTS[option] | config[option])
|
372
|
+
end
|
373
|
+
end
|
374
|
+
|
375
|
+
config
|
376
|
+
end
|
354
377
|
end
|
355
378
|
end
|
@@ -12,6 +12,8 @@ module Honeybadger
|
|
12
12
|
'Mongoid::Errors::DocumentNotFound',
|
13
13
|
'Sinatra::NotFound'].map(&:freeze).freeze
|
14
14
|
|
15
|
+
DEVELOPMENT_ENVIRONMENTS = ['development', 'test', 'cucumber'].map(&:freeze).freeze
|
16
|
+
|
15
17
|
OPTIONS = {
|
16
18
|
api_key: {
|
17
19
|
description: 'The API key for your Honeybadger project.',
|
@@ -47,7 +49,7 @@ module Honeybadger
|
|
47
49
|
},
|
48
50
|
development_environments: {
|
49
51
|
description: 'Environments which will not report data by default (use report_data to enable/disable explicitly).',
|
50
|
-
default:
|
52
|
+
default: DEVELOPMENT_ENVIRONMENTS
|
51
53
|
},
|
52
54
|
:'send_data_at_exit' => {
|
53
55
|
description: 'Send remaining data when Ruby exits.',
|
@@ -158,9 +160,13 @@ module Honeybadger
|
|
158
160
|
default: true
|
159
161
|
},
|
160
162
|
:'exceptions.ignore' => {
|
161
|
-
description: 'A list of exceptions to ignore.',
|
163
|
+
description: 'A list of additional exceptions to ignore (includes default ignored exceptions).',
|
162
164
|
default: IGNORE_DEFAULT
|
163
165
|
},
|
166
|
+
:'exceptions.ignore_only' => {
|
167
|
+
description: 'A list of exceptions to ignore (overrides the default ignored exceptions).',
|
168
|
+
default: [].freeze
|
169
|
+
},
|
164
170
|
:'exceptions.ignored_user_agents' => {
|
165
171
|
description: 'A list of user agents to ignore.',
|
166
172
|
default: [].freeze
|
data/lib/honeybadger/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: honeybadger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Honeybadger Industries LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Make managing application errors a more pleasant experience.
|
14
14
|
email:
|