airbrake-ruby 4.0.0 → 4.0.1
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.rb +1 -1
- data/lib/airbrake-ruby/config.rb +10 -7
- data/lib/airbrake-ruby/loggable.rb +6 -3
- data/lib/airbrake-ruby/version.rb +1 -1
- data/spec/airbrake_spec.rb +11 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 681ed72fb1b600b723e7dbb48c607d37a58a1c71
|
4
|
+
data.tar.gz: 3afa4336efbf5c0aa621eeebc6d1e890a0af7254
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: daadebdf259818ec34b172c694ea942416b498451461cdb09e728e28245fa0456dc8fe07fc000f01966650c6b567f7ec10cd46126c2d443e4d783c5670b29247
|
7
|
+
data.tar.gz: 8f2df8d80dbc8be84cf48a88678ee98ce4a538d02e995d63dfa1392dbb5acd0edd787f605b85f161b5131d20260e94345ae994fe77a3359a3c281b453bfc9804
|
data/lib/airbrake-ruby.rb
CHANGED
@@ -165,7 +165,7 @@ module Airbrake
|
|
165
165
|
|
166
166
|
raise Airbrake::Error, config.validation_error_message unless config.valid?
|
167
167
|
|
168
|
-
Airbrake::Loggable.instance =
|
168
|
+
Airbrake::Loggable.instance = config.logger
|
169
169
|
|
170
170
|
@performance_notifier = PerformanceNotifier.new
|
171
171
|
@notice_notifier = NoticeNotifier.new
|
data/lib/airbrake-ruby/config.rb
CHANGED
@@ -5,13 +5,6 @@ module Airbrake
|
|
5
5
|
# @api public
|
6
6
|
# @since v1.0.0
|
7
7
|
class Config
|
8
|
-
@instance = new
|
9
|
-
|
10
|
-
class << self
|
11
|
-
# @return [Config]
|
12
|
-
attr_accessor :instance
|
13
|
-
end
|
14
|
-
|
15
8
|
# @return [Integer] the project identificator. This value *must* be set.
|
16
9
|
# @api public
|
17
10
|
attr_accessor :project_id
|
@@ -102,6 +95,16 @@ module Airbrake
|
|
102
95
|
# @since v3.2.0
|
103
96
|
attr_accessor :performance_stats_flush_period
|
104
97
|
|
98
|
+
class << self
|
99
|
+
# @param [Config] new_instance
|
100
|
+
attr_writer :instance
|
101
|
+
|
102
|
+
# @return [Config]
|
103
|
+
def instance
|
104
|
+
@instance ||= new
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
105
108
|
# @param [Hash{Symbol=>Object}] user_config the hash to be used to build the
|
106
109
|
# config
|
107
110
|
def initialize(user_config = {})
|
@@ -16,11 +16,14 @@ module Airbrake
|
|
16
16
|
# @since v4.0.0
|
17
17
|
# @api private
|
18
18
|
module Loggable
|
19
|
-
@instance = ::Logger.new(File::NULL)
|
20
|
-
|
21
19
|
class << self
|
20
|
+
# @param [Logger] logger
|
21
|
+
attr_writer :instance
|
22
|
+
|
22
23
|
# @return [Logger]
|
23
|
-
|
24
|
+
def instance
|
25
|
+
@instance ||= ::Logger.new(File::NULL)
|
26
|
+
end
|
24
27
|
end
|
25
28
|
|
26
29
|
# @return [Logger] standard Ruby logger object
|
data/spec/airbrake_spec.rb
CHANGED
@@ -12,6 +12,17 @@ RSpec.describe Airbrake do
|
|
12
12
|
end.to yield_with_args(Airbrake::Config)
|
13
13
|
end
|
14
14
|
|
15
|
+
it "sets logger to Airbrake::Loggable" do
|
16
|
+
logger = Logger.new(File::NULL)
|
17
|
+
described_class.configure do |c|
|
18
|
+
c.project_id = 1
|
19
|
+
c.project_key = '123'
|
20
|
+
c.logger = logger
|
21
|
+
end
|
22
|
+
|
23
|
+
expect(Airbrake::Loggable.instance).to eql(logger)
|
24
|
+
end
|
25
|
+
|
15
26
|
context "when user config doesn't contain a project id" do
|
16
27
|
it "raises error" do
|
17
28
|
expect { described_class.configure { |c| c.project_key = '1' } }.
|
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: 4.0.
|
4
|
+
version: 4.0.1
|
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: 2019-02-
|
11
|
+
date: 2019-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rbtree3
|