airbrake-ruby 5.1.1 → 5.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/airbrake-ruby/config.rb +14 -7
- data/lib/airbrake-ruby/config/processor.rb +2 -1
- data/lib/airbrake-ruby/file_cache.rb +1 -1
- data/lib/airbrake-ruby/filters/thread_filter.rb +1 -2
- data/lib/airbrake-ruby/grouppable.rb +1 -1
- data/lib/airbrake-ruby/mergeable.rb +1 -1
- data/lib/airbrake-ruby/remote_settings.rb +1 -1
- data/lib/airbrake-ruby/remote_settings/callback.rb +1 -1
- data/lib/airbrake-ruby/remote_settings/settings_data.rb +1 -1
- data/lib/airbrake-ruby/version.rb +2 -2
- data/spec/config/processor_spec.rb +9 -0
- data/spec/config_spec.rb +1 -0
- data/spec/filters/thread_filter_spec.rb +1 -1
- data/spec/tdigest_spec.rb +1 -1
- 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: 8102082d97168a2204b3e730fc2085d30d06d4ab501e6207d91ce9d67bd91584
|
4
|
+
data.tar.gz: cf2234bd6fc61e439796b0f664163a12fdd4c39c4256a1c469f06dd1f8132de3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5b353597aa2bf9d59fa454f8a6a87fadcdc71685a7e21ef3ec9f74e57b20268e5d6cad2d6d0fe061bdcdbe02e65cf2e5761d4e92c6370ea1d1316972da9d9af
|
7
|
+
data.tar.gz: d13b77d0f959ff3a5326f054b8df67c9402b216038afd25672df8b6803623ac135bb5366739687fc5c234ae2e127d075828f747bb945d9ba4d48f3f354775f17
|
data/lib/airbrake-ruby/config.rb
CHANGED
@@ -121,15 +121,21 @@ module Airbrake
|
|
121
121
|
# @return [Boolean] true if the library should send error reports to
|
122
122
|
# Airbrake, false otherwise
|
123
123
|
# @api public
|
124
|
-
# @since
|
124
|
+
# @since v5.0.0
|
125
125
|
attr_accessor :error_notifications
|
126
126
|
|
127
|
-
# @return [String] the host
|
128
|
-
# configuration options
|
129
|
-
# @api
|
130
|
-
# @since
|
127
|
+
# @return [String] the host which should be used for fetching remote
|
128
|
+
# configuration options
|
129
|
+
# @api public
|
130
|
+
# @since v5.0.0
|
131
131
|
attr_accessor :remote_config_host
|
132
132
|
|
133
|
+
# @return [String] true if notifier should periodically fetch remote
|
134
|
+
# configuration, false otherwise
|
135
|
+
# @api public
|
136
|
+
# @since v5.2.0
|
137
|
+
attr_accessor :remote_config
|
138
|
+
|
133
139
|
class << self
|
134
140
|
# @return [Config]
|
135
141
|
attr_writer :instance
|
@@ -142,7 +148,7 @@ module Airbrake
|
|
142
148
|
|
143
149
|
# @param [Hash{Symbol=>Object}] user_config the hash to be used to build the
|
144
150
|
# config
|
145
|
-
# rubocop:disable Metrics/AbcSize
|
151
|
+
# rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
146
152
|
def initialize(user_config = {})
|
147
153
|
self.proxy = {}
|
148
154
|
self.queue_size = 100
|
@@ -173,10 +179,11 @@ module Airbrake
|
|
173
179
|
self.query_stats = true
|
174
180
|
self.job_stats = true
|
175
181
|
self.error_notifications = true
|
182
|
+
self.remote_config = true
|
176
183
|
|
177
184
|
merge(user_config)
|
178
185
|
end
|
179
|
-
# rubocop:enable Metrics/AbcSize
|
186
|
+
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength
|
180
187
|
|
181
188
|
# The full URL to the Airbrake Notice API. Based on the +:error_host+ option.
|
182
189
|
# @return [URI] the endpoint address
|
@@ -3,7 +3,7 @@ module Airbrake
|
|
3
3
|
# Processor is a helper class, which is responsible for setting default
|
4
4
|
# config values, default notifier filters and remote configuration changes.
|
5
5
|
#
|
6
|
-
# @since
|
6
|
+
# @since v5.0.0
|
7
7
|
# @api private
|
8
8
|
class Processor
|
9
9
|
# @param [Airbrake::Config] config
|
@@ -41,6 +41,7 @@ module Airbrake
|
|
41
41
|
|
42
42
|
# @return [Airbrake::RemoteSettings]
|
43
43
|
def process_remote_configuration
|
44
|
+
return unless @config.remote_config
|
44
45
|
return unless @project_id
|
45
46
|
return if @config.environment == 'test'
|
46
47
|
|
@@ -3,10 +3,10 @@
|
|
3
3
|
module Airbrake
|
4
4
|
# @return [String] the library version
|
5
5
|
# @api public
|
6
|
-
AIRBRAKE_RUBY_VERSION = '5.
|
6
|
+
AIRBRAKE_RUBY_VERSION = '5.2.0'.freeze
|
7
7
|
|
8
8
|
# @return [Hash{Symbol=>String}] the information about the notifier library
|
9
|
-
# @since
|
9
|
+
# @since v5.0.0
|
10
10
|
# @api public
|
11
11
|
NOTIFIER_INFO = {
|
12
12
|
name: 'airbrake-ruby'.freeze,
|
@@ -72,6 +72,15 @@ RSpec.describe Airbrake::Config::Processor do
|
|
72
72
|
described_class.new(config).process_remote_configuration
|
73
73
|
end
|
74
74
|
end
|
75
|
+
|
76
|
+
context "when the config disables the remote_config option" do
|
77
|
+
let(:config) { Airbrake::Config.new(project_id: 123, remote_config: false) }
|
78
|
+
|
79
|
+
it "doesn't set remote settings" do
|
80
|
+
expect(Airbrake::RemoteSettings).not_to receive(:poll)
|
81
|
+
described_class.new(config).process_remote_configuration
|
82
|
+
end
|
83
|
+
end
|
75
84
|
end
|
76
85
|
|
77
86
|
describe "#add_filters" do
|
data/spec/config_spec.rb
CHANGED
@@ -26,6 +26,7 @@ RSpec.describe Airbrake::Config do
|
|
26
26
|
its(:query_stats) { is_expected.to eq(true) }
|
27
27
|
its(:job_stats) { is_expected.to eq(true) }
|
28
28
|
its(:error_notifications) { is_expected.to eq(true) }
|
29
|
+
its(:remote_config) { is_expected.to eq(true) }
|
29
30
|
|
30
31
|
its(:remote_config_host) do
|
31
32
|
is_expected.to eq('https://notifier-configs.airbrake.io')
|
data/spec/tdigest_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: airbrake-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Airbrake Technologies, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rbtree3
|