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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d8bbd31ca8b2bb05fd05a421ff9b69885aad0536
4
- data.tar.gz: ef355e0789e3c887532ac9ccb9b914b646bceb86
3
+ metadata.gz: 068b9e2194b424660cdbb40d19fa3c22c60d9968
4
+ data.tar.gz: 68181b2849fb96625616363debd565a8bb2f245f
5
5
  SHA512:
6
- metadata.gz: d649051af4ed87b4d5f135d48ca48d1c7221406d60c1c33086254de1c2ed3990d8b4b71d5ee4a5711ba05725fd88e10108742ec1ba71dfdff4a645155be0a5f5
7
- data.tar.gz: d036e303f4ca14735e20cd5631a988f26d706461598672b4d4128ac02b1573116b7ba3a39092502375de2bb4c8f9da1dfbdf7062b648d289edb75255d37be170
6
+ metadata.gz: 020b001e540dd1ed39ce283d073b6756dc1159759bdf0d49427995d07e2b6c3ce5033ef01e40ab3e2055066f21827b152c6d94a74738c17aa8b9eff8a970d4e3
7
+ data.tar.gz: ebd0b1d4b62e87696dda8a1b18d8d6f0c72f1702155bce273bad363d8d93ca25d33ce061d3f6e2dd22104f93c60a3a0eeeb708957a161fea7daafaf4f35a9b96
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ * Merge exceptions.ignore config values with default ignored exception class
2
+ names and add exceptions.ignore_only option to override.
3
+
4
+ *Joshua Wood*
5
+
1
6
  * Support for capistrano-rbenv gem in Capistrano task.
2
7
 
3
8
  *Chris Gunther*
@@ -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
- load_config_from_disk do |yml|
42
- update(yml)
43
- end
44
-
45
- update(Env.new(ENV))
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.include?(key)
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: ['development'.freeze, 'test'.freeze, 'cucumber'.freeze].freeze
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
@@ -1,4 +1,4 @@
1
1
  module Honeybadger
2
2
  # Public: The current String Honeybadger version.
3
- VERSION = '2.0.4'.freeze
3
+ VERSION = '2.0.5'.freeze
4
4
  end
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
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-10 00:00:00.000000000 Z
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: