airbrake-ruby 4.9.0-java → 4.10.0-java
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/lib/airbrake-ruby.rb +55 -6
- data/lib/airbrake-ruby/async_sender.rb +3 -3
- data/lib/airbrake-ruby/backtrace.rb +2 -2
- data/lib/airbrake-ruby/code_hunk.rb +1 -1
- data/lib/airbrake-ruby/config.rb +1 -1
- data/lib/airbrake-ruby/config/validator.rb +3 -3
- data/lib/airbrake-ruby/deploy_notifier.rb +1 -1
- data/lib/airbrake-ruby/filters/exception_attributes_filter.rb +2 -2
- data/lib/airbrake-ruby/filters/git_last_checkout_filter.rb +2 -2
- data/lib/airbrake-ruby/filters/keys_filter.rb +1 -1
- data/lib/airbrake-ruby/filters/sql_filter.rb +3 -3
- data/lib/airbrake-ruby/filters/thread_filter.rb +1 -1
- data/lib/airbrake-ruby/inspectable.rb +2 -2
- data/lib/airbrake-ruby/notice.rb +7 -7
- data/lib/airbrake-ruby/notice_notifier.rb +1 -1
- data/lib/airbrake-ruby/performance_breakdown.rb +1 -1
- data/lib/airbrake-ruby/performance_notifier.rb +36 -20
- data/lib/airbrake-ruby/query.rb +1 -1
- data/lib/airbrake-ruby/queue.rb +2 -2
- data/lib/airbrake-ruby/request.rb +1 -1
- data/lib/airbrake-ruby/stat.rb +1 -1
- data/lib/airbrake-ruby/version.rb +1 -1
- data/spec/airbrake_spec.rb +107 -48
- data/spec/async_sender_spec.rb +4 -4
- data/spec/backtrace_spec.rb +18 -18
- data/spec/code_hunk_spec.rb +9 -9
- data/spec/config/validator_spec.rb +5 -5
- data/spec/config_spec.rb +5 -5
- data/spec/deploy_notifier_spec.rb +2 -2
- data/spec/filter_chain_spec.rb +1 -1
- data/spec/filters/dependency_filter_spec.rb +1 -1
- data/spec/filters/gem_root_filter_spec.rb +5 -5
- data/spec/filters/git_last_checkout_filter_spec.rb +1 -1
- data/spec/filters/git_repository_filter.rb +1 -1
- data/spec/filters/git_revision_filter_spec.rb +10 -10
- data/spec/filters/keys_blacklist_spec.rb +22 -22
- data/spec/filters/keys_whitelist_spec.rb +21 -21
- data/spec/filters/root_directory_filter_spec.rb +5 -5
- data/spec/filters/sql_filter_spec.rb +53 -53
- data/spec/filters/system_exit_filter_spec.rb +1 -1
- data/spec/filters/thread_filter_spec.rb +28 -28
- data/spec/fixtures/project_root/code.rb +9 -9
- data/spec/notice_notifier/options_spec.rb +12 -12
- data/spec/notice_notifier_spec.rb +17 -17
- data/spec/notice_spec.rb +5 -5
- data/spec/performance_notifier_spec.rb +88 -68
- data/spec/query_spec.rb +1 -1
- data/spec/request_spec.rb +1 -1
- data/spec/response_spec.rb +8 -8
- data/spec/spec_helper.rb +2 -2
- data/spec/stat_spec.rb +2 -2
- data/spec/sync_sender_spec.rb +12 -12
- data/spec/tdigest_spec.rb +6 -6
- data/spec/thread_pool_spec.rb +5 -5
- data/spec/timed_trace_spec.rb +1 -1
- data/spec/truncator_spec.rb +12 -12
- metadata +2 -2
@@ -10,7 +10,7 @@ RSpec.describe Airbrake::Filters::RootDirectoryFilter do
|
|
10
10
|
{ file: "/home/kyrylo/code/airbrake/ruby/spec/spec_helper.rb" },
|
11
11
|
{ file: "#{root_directory}/gems/rspec-core-3.3.2/lib/rspec/core/configuration.rb " },
|
12
12
|
{ file: "/opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb" },
|
13
|
-
{ file: "#{root_directory}/gems/rspec-core-3.3.2/exe/rspec" }
|
13
|
+
{ file: "#{root_directory}/gems/rspec-core-3.3.2/exe/rspec" },
|
14
14
|
]
|
15
15
|
# rubocop:enable Metrics/LineLength
|
16
16
|
|
@@ -23,9 +23,9 @@ RSpec.describe Airbrake::Filters::RootDirectoryFilter do
|
|
23
23
|
{ file: "/home/kyrylo/code/airbrake/ruby/spec/spec_helper.rb" },
|
24
24
|
{ file: "/PROJECT_ROOT/gems/rspec-core-3.3.2/lib/rspec/core/configuration.rb " },
|
25
25
|
{ file: "/opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb" },
|
26
|
-
{ file: "/PROJECT_ROOT/gems/rspec-core-3.3.2/exe/rspec" }
|
27
|
-
]
|
28
|
-
)
|
26
|
+
{ file: "/PROJECT_ROOT/gems/rspec-core-3.3.2/exe/rspec" },
|
27
|
+
],
|
28
|
+
),
|
29
29
|
)
|
30
30
|
# rubocop:enable Metrics/LineLength
|
31
31
|
end
|
@@ -33,7 +33,7 @@ RSpec.describe Airbrake::Filters::RootDirectoryFilter do
|
|
33
33
|
it "does not filter file when it is nil" do
|
34
34
|
expect(notice[:errors].first[:file]).to be_nil
|
35
35
|
expect { subject.call(notice) }.not_to(
|
36
|
-
change { notice[:errors].first[:file] }
|
36
|
+
change { notice[:errors].first[:file] },
|
37
37
|
)
|
38
38
|
end
|
39
39
|
end
|
@@ -14,7 +14,7 @@ RSpec.describe Airbrake::Filters::SqlFilter do
|
|
14
14
|
it "ignores '#{query}'" do
|
15
15
|
filter = described_class.new('postgres')
|
16
16
|
q = Airbrake::Query.new(
|
17
|
-
query: query, method: 'GET', route: '/', start_time: Time.now
|
17
|
+
query: query, method: 'GET', route: '/', start_time: Time.now,
|
18
18
|
)
|
19
19
|
filter.call(q)
|
20
20
|
|
@@ -29,204 +29,204 @@ RSpec.describe Airbrake::Filters::SqlFilter do
|
|
29
29
|
{
|
30
30
|
input: 'SELECT * FROM things;',
|
31
31
|
output: 'SELECT * FROM things;',
|
32
|
-
dialects: ALL_DIALECTS
|
32
|
+
dialects: ALL_DIALECTS,
|
33
33
|
}, {
|
34
34
|
input: "SELECT `t001`.`c2` FROM `t001` WHERE `t001`.`c2` = 'value' AND c3=\"othervalue\" LIMIT ?",
|
35
35
|
output: "SELECT `t001`.`c2` FROM `t001` WHERE `t001`.`c2` = ? AND c3=? LIMIT ?",
|
36
|
-
dialects: %i[mysql]
|
36
|
+
dialects: %i[mysql],
|
37
37
|
}, {
|
38
38
|
input: "SELECT * FROM t WHERE foo=\"bar/*\" AND baz=\"whatever */qux\"",
|
39
39
|
output: "SELECT * FROM t WHERE foo=? AND baz=?",
|
40
|
-
dialects: %i[mysql]
|
40
|
+
dialects: %i[mysql],
|
41
41
|
}, {
|
42
42
|
input: "SELECT * FROM t WHERE foo='bar/*' AND baz='whatever */qux'",
|
43
43
|
output: "SELECT * FROM t WHERE foo=? AND baz=?",
|
44
|
-
dialects: ALL_DIALECTS
|
44
|
+
dialects: ALL_DIALECTS,
|
45
45
|
}, {
|
46
46
|
input: "SELECT \"t001\".\"c2\" FROM \"t001\" WHERE \"t001\".\"c2\" = 'value' AND c3=1234 LIMIT 1",
|
47
47
|
output: "SELECT \"t001\".\"c2\" FROM \"t001\" WHERE \"t001\".\"c2\" = ? AND c3=? LIMIT ?",
|
48
|
-
dialects: %i[postgres oracle]
|
48
|
+
dialects: %i[postgres oracle],
|
49
49
|
}, {
|
50
50
|
input: "SELECT * FROM t WHERE foo=\"bar--\" AND\n baz=\"qux--\"",
|
51
51
|
output: "SELECT * FROM t WHERE foo=? AND\n baz=?",
|
52
|
-
dialects: %i[mysql]
|
52
|
+
dialects: %i[mysql],
|
53
53
|
}, {
|
54
54
|
input: "SELECT * FROM t WHERE foo='bar--' AND\n baz='qux--'",
|
55
55
|
output: "SELECT * FROM t WHERE foo=? AND\n baz=?",
|
56
|
-
dialects: ALL_DIALECTS
|
56
|
+
dialects: ALL_DIALECTS,
|
57
57
|
}, {
|
58
58
|
input: "SELECT * FROM foo WHERE bar='baz' /* Hide Me */",
|
59
59
|
output: "SELECT * FROM foo WHERE bar=? ?",
|
60
|
-
dialects: ALL_DIALECTS
|
60
|
+
dialects: ALL_DIALECTS,
|
61
61
|
}, {
|
62
62
|
input: "SELECT * FROM foobar WHERE password='hunter2'\n-- No peeking!",
|
63
63
|
output: "SELECT * FROM foobar WHERE password=?\n?",
|
64
|
-
dialects: ALL_DIALECTS
|
64
|
+
dialects: ALL_DIALECTS,
|
65
65
|
}, {
|
66
66
|
input: "SELECT foo, bar FROM baz WHERE password='hunter2' # Secret",
|
67
67
|
output: "SELECT foo, bar FROM baz WHERE password=? ?",
|
68
|
-
dialects: ALL_DIALECTS
|
68
|
+
dialects: ALL_DIALECTS,
|
69
69
|
}, {
|
70
70
|
input: "SELECT \"col1\", \"col2\" from \"table\" WHERE \"col3\"=E'foo\\'bar\\\\baz' AND country=e'foo\\'bar\\\\baz'",
|
71
71
|
output: "SELECT \"col1\", \"col2\" from \"table\" WHERE \"col3\"=E?",
|
72
|
-
dialects: %i[postgres]
|
72
|
+
dialects: %i[postgres],
|
73
73
|
}, {
|
74
74
|
input: "INSERT INTO `X` values(\"test\",0, 1 , 2, 'test')",
|
75
75
|
output: "INSERT INTO `X` values(?)",
|
76
|
-
dialects: %i[mysql]
|
76
|
+
dialects: %i[mysql],
|
77
77
|
}, {
|
78
78
|
input: "INSERT INTO `X` values(\"test\",0, 1 , 2, 'test')",
|
79
79
|
output: "INSERT INTO `X` values(?)",
|
80
|
-
dialects: %i[mysql]
|
80
|
+
dialects: %i[mysql],
|
81
81
|
}, {
|
82
82
|
input: "SELECT c11.col1, c22.col2 FROM table c11, table c22 WHERE value='nothing'",
|
83
83
|
output: "SELECT c11.col1, c22.col2 FROM table c11, table c22 WHERE value=?",
|
84
|
-
dialects: ALL_DIALECTS
|
84
|
+
dialects: ALL_DIALECTS,
|
85
85
|
}, {
|
86
86
|
input: "INSERT INTO X VALUES(1, 23456, 123.456, 99+100)",
|
87
87
|
output: "INSERT INTO X VALUES(?)",
|
88
|
-
dialects: ALL_DIALECTS
|
88
|
+
dialects: ALL_DIALECTS,
|
89
89
|
}, {
|
90
90
|
input: "SELECT * FROM table WHERE name=\"foo\" AND value=\"don't\"",
|
91
91
|
output: "SELECT * FROM table WHERE name=? AND value=?",
|
92
|
-
dialects: %i[mysql]
|
92
|
+
dialects: %i[mysql],
|
93
93
|
}, {
|
94
94
|
input: "SELECT * FROM table WHERE name='foo' AND value = 'bar'",
|
95
95
|
output: "SELECT * FROM table WHERE name=? AND value = ?",
|
96
|
-
dialects: ALL_DIALECTS
|
96
|
+
dialects: ALL_DIALECTS,
|
97
97
|
}, {
|
98
98
|
input: "SELECT * FROM table WHERE col='foo\\''bar'",
|
99
99
|
output: "SELECT * FROM table WHERE col=?",
|
100
|
-
dialects: ALL_DIALECTS
|
100
|
+
dialects: ALL_DIALECTS,
|
101
101
|
}, {
|
102
102
|
input: "SELECT * FROM table WHERE col1='foo\"bar' AND col2='what\"ever'",
|
103
103
|
output: "SELECT * FROM table WHERE col1=? AND col2=?",
|
104
|
-
dialects: ALL_DIALECTS
|
104
|
+
dialects: ALL_DIALECTS,
|
105
105
|
}, {
|
106
106
|
input: "select * from accounts where accounts.name != 'dude\n newline' order by accounts.name",
|
107
107
|
output: "select * from accounts where accounts.name != ? order by accounts.name",
|
108
|
-
dialects: ALL_DIALECTS
|
108
|
+
dialects: ALL_DIALECTS,
|
109
109
|
}, {
|
110
110
|
input: "SELECT * FROM table WHERE col1=\"don't\" AND col2=\"won't\"",
|
111
111
|
output: "SELECT * FROM table WHERE col1=? AND col2=?",
|
112
|
-
dialects: %i[mysql]
|
112
|
+
dialects: %i[mysql],
|
113
113
|
}, {
|
114
114
|
input: "INSERT INTO X values('', 'jim''s ssn',0, 1 , 'jim''s son''s son', \"\"\"jim''s\"\" hat\", \"\\\"jim''s secret\\\"\")",
|
115
115
|
output: "INSERT INTO X values(?, ?,?, ? , ?, ?, ?",
|
116
|
-
dialects: %i[mysql]
|
116
|
+
dialects: %i[mysql],
|
117
117
|
}, {
|
118
118
|
input: "SELECT * FROM table WHERE name='foo\\' AND color='blue'",
|
119
119
|
output: "SELECT * FROM table WHERE name=?",
|
120
|
-
dialects: ALL_DIALECTS
|
120
|
+
dialects: ALL_DIALECTS,
|
121
121
|
}, {
|
122
122
|
input: "SELECT * FROM table WHERE foo=\"this string ends with a backslash\\\\\"",
|
123
123
|
output: "SELECT * FROM table WHERE foo=?",
|
124
|
-
dialects: %i[mysql]
|
124
|
+
dialects: %i[mysql],
|
125
125
|
}, {
|
126
126
|
input: "SELECT * FROM table WHERE foo='this string ends with a backslash\\\\'",
|
127
127
|
output: "SELECT * FROM table WHERE foo=?",
|
128
|
-
dialects: ALL_DIALECTS
|
128
|
+
dialects: ALL_DIALECTS,
|
129
129
|
}, {
|
130
130
|
# TODO: fix this example.
|
131
131
|
input: "SELECT * FROM table WHERE name='foo\'' AND color='blue'",
|
132
132
|
output: "Error: Airbrake::Query was not filtered",
|
133
|
-
dialects: ALL_DIALECTS
|
133
|
+
dialects: ALL_DIALECTS,
|
134
134
|
}, {
|
135
135
|
input: "INSERT INTO X values('', 'a''b c',0, 1 , 'd''e f''s h')",
|
136
136
|
output: "INSERT INTO X values(?)",
|
137
|
-
dialects: ALL_DIALECTS
|
137
|
+
dialects: ALL_DIALECTS,
|
138
138
|
}, {
|
139
139
|
input: "SELECT * FROM t WHERE -- '\n bar='baz' -- '",
|
140
140
|
output: "SELECT * FROM t WHERE ?\n bar=? ?",
|
141
|
-
dialects: ALL_DIALECTS
|
141
|
+
dialects: ALL_DIALECTS,
|
142
142
|
}, {
|
143
143
|
input: "SELECT * FROM t WHERE /* ' */\n bar='baz' -- '",
|
144
144
|
output: "SELECT * FROM t WHERE ?\n bar=? ?",
|
145
|
-
dialects: ALL_DIALECTS
|
145
|
+
dialects: ALL_DIALECTS,
|
146
146
|
}, {
|
147
147
|
input: "SELECT * FROM t WHERE -- '\n /* ' */ c2='xxx' /* ' */\n c='x\n xx' -- '",
|
148
148
|
output: "SELECT * FROM t WHERE ?\n ? c2=? ?\n c=? ?",
|
149
|
-
dialects: ALL_DIALECTS
|
149
|
+
dialects: ALL_DIALECTS,
|
150
150
|
}, {
|
151
151
|
input: "SELECT * FROM t WHERE -- '\n c='x\n xx' -- '",
|
152
152
|
output: "SELECT * FROM t WHERE ?\n c=? ?",
|
153
|
-
dialects: ALL_DIALECTS
|
153
|
+
dialects: ALL_DIALECTS,
|
154
154
|
}, {
|
155
155
|
input: "SELECT * FROM foo WHERE col='value1' AND /* don't */ col2='value1' /* won't */",
|
156
156
|
output: "SELECT * FROM foo WHERE col=? AND ? col2=? ?",
|
157
|
-
dialects: ALL_DIALECTS
|
157
|
+
dialects: ALL_DIALECTS,
|
158
158
|
}, {
|
159
159
|
input: "SELECT * FROM table WHERE foo='bar' AND baz=\"nothing to see here'",
|
160
160
|
output: "Error: Airbrake::Query was not filtered",
|
161
|
-
dialects: %i[mysql]
|
161
|
+
dialects: %i[mysql],
|
162
162
|
}, {
|
163
163
|
input: "SELECT * FROM table WHERE foo='bar' AND baz='nothing to see here",
|
164
164
|
output: "Error: Airbrake::Query was not filtered",
|
165
|
-
dialects: ALL_DIALECTS
|
165
|
+
dialects: ALL_DIALECTS,
|
166
166
|
}, {
|
167
167
|
input: "SELECT * FROM \"foo\" WHERE \"foo\" = $a$dollar quotes can be $b$nested$b$$a$ and bar = 'baz'",
|
168
168
|
output: "SELECT * FROM \"foo\" WHERE \"foo\" = ? and bar = ?",
|
169
|
-
dialects: %i[postgres]
|
169
|
+
dialects: %i[postgres],
|
170
170
|
}, {
|
171
171
|
input: "INSERT INTO \"foo\" (\"bar\", \"baz\", \"qux\") VALUES ($1, $2, $3) RETURNING \"id\"",
|
172
172
|
output: "INSERT INTO \"foo\" (?) RETURNING \"id\"",
|
173
|
-
dialects: %i[postgres]
|
173
|
+
dialects: %i[postgres],
|
174
174
|
}, {
|
175
175
|
input: "select * from foo where bar = 'some\\tthing' and baz = 10",
|
176
176
|
output: "select * from foo where bar = ? and baz = ?",
|
177
|
-
dialects: ALL_DIALECTS
|
177
|
+
dialects: ALL_DIALECTS,
|
178
178
|
}, {
|
179
179
|
input: "select * from users where user = 'user1\\' password = 'hunter 2' -- ->don't count this quote",
|
180
180
|
output: "select * from users where user = ?",
|
181
|
-
dialects: ALL_DIALECTS
|
181
|
+
dialects: ALL_DIALECTS,
|
182
182
|
}, {
|
183
183
|
input: "select * from foo where bar=q'[baz's]' and x=5",
|
184
184
|
output: "select * from foo where bar=? and x=?",
|
185
|
-
dialects: %i[oracle]
|
185
|
+
dialects: %i[oracle],
|
186
186
|
}, {
|
187
187
|
input: "select * from foo where bar=q'{baz's}' and x=5",
|
188
188
|
output: "select * from foo where bar=? and x=?",
|
189
|
-
dialects: %i[oracle]
|
189
|
+
dialects: %i[oracle],
|
190
190
|
}, {
|
191
191
|
input: "select * from foo where bar=q'<baz's>' and x=5",
|
192
192
|
output: "select * from foo where bar=? and x=?",
|
193
|
-
dialects: %i[oracle]
|
193
|
+
dialects: %i[oracle],
|
194
194
|
}, {
|
195
195
|
input: "select * from foo where bar=q'(baz's)' and x=5",
|
196
196
|
output: "select * from foo where bar=? and x=?",
|
197
|
-
dialects: %i[oracle]
|
197
|
+
dialects: %i[oracle],
|
198
198
|
}, {
|
199
199
|
input: "select * from foo where bar=0xabcdef123 and x=5",
|
200
200
|
output: "select * from foo where bar=? and x=?",
|
201
|
-
dialects: %i[cassandra sqlite]
|
201
|
+
dialects: %i[cassandra sqlite],
|
202
202
|
}, {
|
203
203
|
input: "select * from foo where bar=0x2F and x=5",
|
204
204
|
output: "select * from foo where bar=? and x=?",
|
205
|
-
dialects: %i[mysql cassandra sqlite]
|
205
|
+
dialects: %i[mysql cassandra sqlite],
|
206
206
|
}, {
|
207
207
|
input: "select * from foo where bar=1.234e-5 and x=5",
|
208
208
|
output: "select * from foo where bar=? and x=?",
|
209
|
-
dialects: ALL_DIALECTS
|
209
|
+
dialects: ALL_DIALECTS,
|
210
210
|
}, {
|
211
211
|
input: "select * from foo where bar=01234567-89ab-cdef-0123-456789abcdef and x=5",
|
212
212
|
output: "select * from foo where bar=? and x=?",
|
213
|
-
dialects: %i[postgres cassandra]
|
213
|
+
dialects: %i[postgres cassandra],
|
214
214
|
}, {
|
215
215
|
input: "select * from foo where bar={01234567-89ab-cdef-0123-456789abcdef} and x=5",
|
216
216
|
output: "select * from foo where bar=? and x=?",
|
217
|
-
dialects: %i[postgres]
|
217
|
+
dialects: %i[postgres],
|
218
218
|
}, {
|
219
219
|
input: "select * from foo where bar=0123456789abcdef0123456789abcdef and x=5",
|
220
220
|
output: "select * from foo where bar=? and x=?",
|
221
|
-
dialects: %i[postgtes]
|
221
|
+
dialects: %i[postgtes],
|
222
222
|
}, {
|
223
223
|
input: "select * from foo where bar={012-345678-9abc-def012345678-9abcdef} and x=5",
|
224
224
|
output: "select * from foo where bar=? and x=?",
|
225
|
-
dialects: %i[postgres]
|
225
|
+
dialects: %i[postgres],
|
226
226
|
}, {
|
227
227
|
input: "select * from foo where bar=true and x=FALSE",
|
228
228
|
output: "select * from foo where bar=? and x=?",
|
229
|
-
dialects: %i[mysql postgres cassandra sqlite]
|
229
|
+
dialects: %i[mysql postgres cassandra sqlite],
|
230
230
|
}
|
231
231
|
].each do |test|
|
232
232
|
include_examples 'query filtering', test
|
@@ -263,13 +263,13 @@ RSpec.describe Airbrake::Filters::SqlFilter do
|
|
263
263
|
'oid = rngtypid WHERE t.typname IN (?) OR t.typtype IN (?) OR t.typinput ' \
|
264
264
|
'= ?::regprocedure OR t.typelem != ?',
|
265
265
|
|
266
|
-
'SELECT t.oid, t.typname FROM pg_type as t WHERE t.typname IN (?)'
|
266
|
+
'SELECT t.oid, t.typname FROM pg_type as t WHERE t.typname IN (?)',
|
267
267
|
].each do |query|
|
268
268
|
include_examples 'query blacklisting', query, should_ignore: true
|
269
269
|
end
|
270
270
|
|
271
271
|
[
|
272
|
-
'UPDATE "users" SET "last_sign_in_at" = ? WHERE "users"."id" = ?'
|
272
|
+
'UPDATE "users" SET "last_sign_in_at" = ? WHERE "users"."id" = ?',
|
273
273
|
].each do |query|
|
274
274
|
include_examples 'query blacklisting', query, should_ignore: false
|
275
275
|
end
|
@@ -2,7 +2,7 @@ RSpec.describe Airbrake::Filters::SystemExitFilter do
|
|
2
2
|
it "marks SystemExit exceptions as ignored" do
|
3
3
|
notice = Airbrake::Notice.new(SystemExit.new)
|
4
4
|
expect { subject.call(notice) }.to(
|
5
|
-
change { notice.ignored? }.from(false).to(true)
|
5
|
+
change { notice.ignored? }.from(false).to(true),
|
6
6
|
)
|
7
7
|
end
|
8
8
|
|
@@ -77,13 +77,13 @@ RSpec.describe Airbrake::Filters::ThreadFilter do
|
|
77
77
|
{
|
78
78
|
bish: {
|
79
79
|
bash: 'foo',
|
80
|
-
bosh: Object.new
|
81
|
-
}
|
82
|
-
}
|
83
|
-
]
|
84
|
-
}
|
80
|
+
bosh: Object.new,
|
81
|
+
},
|
82
|
+
},
|
83
|
+
],
|
84
|
+
},
|
85
85
|
},
|
86
|
-
123
|
86
|
+
123,
|
87
87
|
]
|
88
88
|
end
|
89
89
|
|
@@ -103,15 +103,15 @@ RSpec.describe Airbrake::Filters::ThreadFilter do
|
|
103
103
|
{
|
104
104
|
bish: {
|
105
105
|
bash: 'foo',
|
106
|
-
bosh: /\A#<Object:.+>\z
|
107
|
-
}
|
108
|
-
}
|
109
|
-
]
|
110
|
-
}
|
106
|
+
bosh: /\A#<Object:.+>\z/,
|
107
|
+
},
|
108
|
+
},
|
109
|
+
],
|
110
|
+
},
|
111
111
|
},
|
112
|
-
123
|
113
|
-
]
|
114
|
-
)
|
112
|
+
123,
|
113
|
+
],
|
114
|
+
),
|
115
115
|
)
|
116
116
|
end
|
117
117
|
end
|
@@ -194,13 +194,13 @@ RSpec.describe Airbrake::Filters::ThreadFilter do
|
|
194
194
|
{
|
195
195
|
bish: {
|
196
196
|
bash: 'foo',
|
197
|
-
bosh: Object.new
|
198
|
-
}
|
199
|
-
}
|
200
|
-
]
|
201
|
-
}
|
197
|
+
bosh: Object.new,
|
198
|
+
},
|
199
|
+
},
|
200
|
+
],
|
201
|
+
},
|
202
202
|
},
|
203
|
-
123
|
203
|
+
123,
|
204
204
|
]
|
205
205
|
end
|
206
206
|
|
@@ -220,15 +220,15 @@ RSpec.describe Airbrake::Filters::ThreadFilter do
|
|
220
220
|
{
|
221
221
|
bish: {
|
222
222
|
bash: 'foo',
|
223
|
-
bosh: /\A#<Object:.+>\z
|
224
|
-
}
|
225
|
-
}
|
226
|
-
]
|
227
|
-
}
|
223
|
+
bosh: /\A#<Object:.+>\z/,
|
224
|
+
},
|
225
|
+
},
|
226
|
+
],
|
227
|
+
},
|
228
228
|
},
|
229
|
-
123
|
230
|
-
]
|
231
|
-
)
|
229
|
+
123,
|
230
|
+
],
|
231
|
+
),
|
232
232
|
)
|
233
233
|
end
|
234
234
|
end
|
@@ -10,7 +10,7 @@ module Airbrake
|
|
10
10
|
NOTIFIER = {
|
11
11
|
name: 'airbrake-ruby'.freeze,
|
12
12
|
version: Airbrake::AIRBRAKE_RUBY_VERSION,
|
13
|
-
url: 'https://github.com/airbrake/airbrake-ruby'.freeze
|
13
|
+
url: 'https://github.com/airbrake/airbrake-ruby'.freeze,
|
14
14
|
}.freeze
|
15
15
|
|
16
16
|
##
|
@@ -19,7 +19,7 @@ module Airbrake
|
|
19
19
|
CONTEXT = {
|
20
20
|
os: RUBY_PLATFORM,
|
21
21
|
language: "#{RUBY_ENGINE}/#{RUBY_VERSION}".freeze,
|
22
|
-
notifier: NOTIFIER
|
22
|
+
notifier: NOTIFIER,
|
23
23
|
}.freeze
|
24
24
|
|
25
25
|
##
|
@@ -38,7 +38,7 @@ module Airbrake
|
|
38
38
|
IOError,
|
39
39
|
NotImplementedError,
|
40
40
|
JSON::GeneratorError,
|
41
|
-
Encoding::UndefinedConversionError
|
41
|
+
Encoding::UndefinedConversionError,
|
42
42
|
].freeze
|
43
43
|
|
44
44
|
# @return [Array<Symbol>] the list of keys that can be be overwritten with
|
@@ -71,10 +71,10 @@ module Airbrake
|
|
71
71
|
errors: NestedException.new(config, exception).as_json,
|
72
72
|
context: context,
|
73
73
|
environment: {
|
74
|
-
program_name: $PROGRAM_NAME
|
74
|
+
program_name: $PROGRAM_NAME,
|
75
75
|
},
|
76
76
|
session: {},
|
77
|
-
params: params
|
77
|
+
params: params,
|
78
78
|
}
|
79
79
|
@stash = { exception: exception }
|
80
80
|
@truncator = Airbrake::Truncator.new(PAYLOAD_MAX_SIZE)
|
@@ -170,7 +170,7 @@ module Airbrake
|
|
170
170
|
# Make sure we always send hostname.
|
171
171
|
hostname: HOSTNAME,
|
172
172
|
|
173
|
-
severity: DEFAULT_SEVERITY
|
173
|
+
severity: DEFAULT_SEVERITY,
|
174
174
|
}.merge(CONTEXT).delete_if { |_key, val| val.nil? || val.empty? }
|
175
175
|
end
|
176
176
|
|
@@ -187,7 +187,7 @@ module Airbrake
|
|
187
187
|
@config.logger.error(
|
188
188
|
"#{LOG_LABEL} truncation failed. File an issue at " \
|
189
189
|
"https://github.com/airbrake/airbrake-ruby " \
|
190
|
-
"and attach the following payload: #{@payload}"
|
190
|
+
"and attach the following payload: #{@payload}",
|
191
191
|
)
|
192
192
|
end
|
193
193
|
|
@@ -202,7 +202,7 @@ module Airbrake
|
|
202
202
|
attributes = exception.to_airbrake
|
203
203
|
rescue StandardError => ex
|
204
204
|
@config.logger.error(
|
205
|
-
"#{LOG_LABEL} #{exception.class}#to_airbrake failed: #{ex.class}: #{ex}"
|
205
|
+
"#{LOG_LABEL} #{exception.class}#to_airbrake failed: #{ex.class}: #{ex}",
|
206
206
|
)
|
207
207
|
end
|
208
208
|
|
@@ -213,7 +213,7 @@ module Airbrake
|
|
213
213
|
rescue TypeError
|
214
214
|
@config.logger.error(
|
215
215
|
"#{LOG_LABEL} #{exception.class}#to_airbrake failed:" \
|
216
|
-
" #{attributes} must be a Hash"
|
216
|
+
" #{attributes} must be a Hash",
|
217
217
|
)
|
218
218
|
end
|
219
219
|
end
|