barsoom_utils 0.1.1.13 → 0.1.1.16
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 +4 -4
- data/.github/workflows/ci.yml +1 -0
- 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: 171c801d7728e06af6aa9501349ea50ead665a4a5e5a5c70b725a574789a857e
|
4
|
+
data.tar.gz: 8949fa3f2f2bbe431f74de71b8c491ae4a157a4b4bbbd64c5d0b3b403c48de4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c20db3c5fad7bde0d44ae0c9058b065dcbe24d19a1df6c3915bee468c869bd3141b632d75a5ad7136c016474a49b57e85b1c81a7f266619fc84017a48e046d0c
|
7
|
+
data.tar.gz: ce181f246a449f86c01077ba38b347b85e46db8931ce7477630407beaf9bd31de7f8c0b62bf3403a88d45ea80f709747498565553dfb3979dcd2342c55e49bc2
|
data/.github/workflows/ci.yml
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.1.
|
1
|
+
0.1.1.16
|
@@ -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.16
|
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:
|