barsoom_utils 0.1.1.12 → 0.1.1.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/VERSION +1 -1
- data/lib/barsoom_utils/exception_notifier.rb +0 -12
- data/shared_rubocop.yml +6 -0
- data/spec/exception_notifier_spec.rb +0 -58
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b8e51fb775e6f3cec868f3a781b516ca4dffb8f022555e143b705d049cf1118
|
4
|
+
data.tar.gz: 46b1b0a2f83881dc4d65538829d4deffb3d2a23fb4d8d13ba64bb5d1ea1077b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7429ecf447e05f2bce208cff38790cb2fc88bfb47182a14227c5b03cac74a75610edde7f4b44070d6ad4574eaf93348178f0b388abfba385729852d35234241d
|
7
|
+
data.tar.gz: a1adab087236e3fe32dafdf6ba30abfff1ace663f79813af9496fa281fb6ef7c7c966edcec09848d3af45519651a4d3170e8e999eae847d3d75e2a08882eb6c7
|
data/README.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.1.
|
1
|
+
0.1.1.15
|
@@ -46,17 +46,5 @@ module BarsoomUtils
|
|
46
46
|
Honeybadger.context.clear!
|
47
47
|
Honeybadger.context(old_context)
|
48
48
|
end
|
49
|
-
|
50
|
-
# While developing a feature we'd like the feature developers to be responsible for any errors that occur.
|
51
|
-
# Wrapping the new code with this tags the errors as "wip" in order to hide them from the dashboard.
|
52
|
-
def self.developers_working_on_this_feature_are_responsible_for_errors_until(expire_on, &block)
|
53
|
-
block.call
|
54
|
-
rescue => ex
|
55
|
-
FIXME "#{expire_on}: WIP error-handling code needs to be removed!"
|
56
|
-
notify(ex, context: { tags: "wip" })
|
57
|
-
|
58
|
-
is_rails_production = defined?(Rails) && Rails.env.production?
|
59
|
-
raise unless is_rails_production
|
60
|
-
end
|
61
49
|
end
|
62
50
|
end
|
data/shared_rubocop.yml
CHANGED
@@ -144,6 +144,12 @@ Layout/EmptyLineAfterGuardClause:
|
|
144
144
|
Enabled: true
|
145
145
|
StyleGuide: https://github.com/barsoom/devbook/tree/master/styleguide#put-a-blank-line-below-guard-statements
|
146
146
|
|
147
|
+
Layout/ExtraSpacing:
|
148
|
+
Enabled: true
|
149
|
+
AllowForAlignment: true
|
150
|
+
AllowBeforeTrailingComments: true # Henrik likes this
|
151
|
+
ForceEqualSignAlignment: false
|
152
|
+
|
147
153
|
# Allow:
|
148
154
|
#
|
149
155
|
# Date.new(2019, 1, 2)
|
@@ -95,62 +95,4 @@ RSpec.describe BarsoomUtils::ExceptionNotifier do
|
|
95
95
|
expect(Honeybadger.get_context).to eq({ my_old_context: "hello" })
|
96
96
|
end
|
97
97
|
end
|
98
|
-
|
99
|
-
describe ".developers_working_on_this_feature_are_responsible_for_errors_until" do
|
100
|
-
before do
|
101
|
-
# We need some value, and this value means we don't have to rescue exceptions in some tests.
|
102
|
-
set_rails_production(true)
|
103
|
-
end
|
104
|
-
|
105
|
-
it "notifies Honeybadger with a 'wip' tag" do
|
106
|
-
ex = StandardError.new
|
107
|
-
|
108
|
-
BarsoomUtils::ExceptionNotifier.developers_working_on_this_feature_are_responsible_for_errors_until("9999-01-01") do
|
109
|
-
raise ex
|
110
|
-
end
|
111
|
-
|
112
|
-
expect(Honeybadger).to have_received(:notify).with(ex, context: { tags: "wip" })
|
113
|
-
end
|
114
|
-
|
115
|
-
it "does not raise the error in production" do
|
116
|
-
set_rails_production(true)
|
117
|
-
|
118
|
-
ex = StandardError.new
|
119
|
-
|
120
|
-
expect {
|
121
|
-
BarsoomUtils::ExceptionNotifier.developers_working_on_this_feature_are_responsible_for_errors_until("9999-01-01") do
|
122
|
-
raise ex
|
123
|
-
end
|
124
|
-
}.not_to raise_error
|
125
|
-
end
|
126
|
-
|
127
|
-
it "raises the error in non-production" do
|
128
|
-
set_rails_production(false)
|
129
|
-
|
130
|
-
ex = StandardError.new
|
131
|
-
|
132
|
-
expect {
|
133
|
-
BarsoomUtils::ExceptionNotifier.developers_working_on_this_feature_are_responsible_for_errors_until("9999-01-01") do
|
134
|
-
raise ex
|
135
|
-
end
|
136
|
-
}.to raise_error(ex)
|
137
|
-
end
|
138
|
-
|
139
|
-
it "sets a FIXME raise" do
|
140
|
-
set_rails_production(false)
|
141
|
-
|
142
|
-
expect {
|
143
|
-
BarsoomUtils::ExceptionNotifier.developers_working_on_this_feature_are_responsible_for_errors_until("1999-01-01") do
|
144
|
-
raise "hola"
|
145
|
-
end
|
146
|
-
}.to raise_error(Fixme::UnfixedError, /Fix by 1999-01-01: WIP error-handling/)
|
147
|
-
end
|
148
|
-
|
149
|
-
private
|
150
|
-
|
151
|
-
def set_rails_production(bool)
|
152
|
-
string_env = bool ? "production" : "test"
|
153
|
-
stub_const("Rails", double(:rails, env: double(:env, production?: bool, to_s: string_env)))
|
154
|
-
end
|
155
|
-
end
|
156
98
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: barsoom_utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.1.
|
4
|
+
version: 0.1.1.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomas Skogberg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|