failbot 2.2.1 → 2.3.1

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
- SHA1:
3
- metadata.gz: cc9dd48f921610daf8daa95a58327f9500baea5a
4
- data.tar.gz: bdf27d87fc889a4f958c8d7b8f467c474154b12c
2
+ SHA256:
3
+ metadata.gz: 556ca34093cb33fc4db100a530b407cd4ed38282d615ecffbea2050a6479121d
4
+ data.tar.gz: b885163eaefde6ef987f7b4340dcd98f1a2c45c34cfda1352fd9c490eb866a35
5
5
  SHA512:
6
- metadata.gz: 2a8bb0bb6871429e9498b60972fdbd651fd962e23866f15a5b09262dbcb6161f4a74d98c8659a6d2b0707756b065b949c30351f91a41f1b8a1e9fdb1d63696f2
7
- data.tar.gz: 7e770b7ee3e70121b7f9d6dbb83f35bb9ac7bc56ee372b30d34c109c686f1af40c3f92ba2cc5b05f5c12992cdad161f8365f5d2f1591cdbd049b20fb932bf876
6
+ metadata.gz: 303221221b3f2426e21fcee2bd4398ed0975fe68ba68d82938a495fc1654ec8476fef153fa617b33a8034f42babc4617ea0c5b48ab94d2121ba3e1da4eb29a92
7
+ data.tar.gz: d38ba8d750531eac9f6ee1359c0ec30aa6165ad9d64f3f7fda3454a18cbe818242d50a4e524827ea1c37b79dc2db66ea3e558294b352d4a2db4fbe2ce00c9315
data/lib/failbot.rb CHANGED
@@ -71,6 +71,8 @@ module Failbot
71
71
  context[0] = default_context.to_hash
72
72
  end
73
73
 
74
+ populate_context_from_settings(settings)
75
+
74
76
  self.backend =
75
77
  case (name = settings["FAILBOT_BACKEND"])
76
78
  when "memory"
@@ -410,6 +412,16 @@ module Failbot
410
412
  Failbot.instrumenter.instrument(name, payload) if Failbot.instrumenter
411
413
  end
412
414
 
415
+ # Populate default context from settings. Since settings commonly comes from
416
+ # ENV, this allows setting defaults for the context via the environment.
417
+ def populate_context_from_settings(settings)
418
+ settings.each do |key, value|
419
+ if /\AFAILBOT_CONTEXT_(.+)\z/ =~ key
420
+ context[0][$1.downcase] = value
421
+ end
422
+ end
423
+ end
424
+
413
425
  # We'll include this many nested Exception#cause objects in the needle
414
426
  # context. We limit the number of objects to prevent excessive recursion and
415
427
  # large needle contexts.
@@ -1,3 +1,3 @@
1
1
  module Failbot
2
- VERSION = "2.2.1"
2
+ VERSION = "2.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: failbot
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - "@rtomayko"
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2019-10-11 00:00:00.000000000 Z
13
+ date: 2019-12-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake
@@ -122,8 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
122
  - !ruby/object:Gem::Version
123
123
  version: 1.3.6
124
124
  requirements: []
125
- rubyforge_project:
126
- rubygems_version: 2.5.2.3
125
+ rubygems_version: 3.0.3
127
126
  signing_key:
128
127
  specification_version: 4
129
128
  summary: Deliver exceptions to Haystack