airbrake-ruby 1.4.1 → 1.4.2
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 +5 -0
- data/lib/airbrake-ruby/version.rb +1 -1
- data/spec/config_spec.rb +33 -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: 26dd376dd3646e94ceb28cd59f49e3f5edd67321
|
4
|
+
data.tar.gz: 413ac77fb12f382bac026959ebc502ed0246eab1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e49ee6c9772cd21dfa62c6441218f122cfe382e27bb60200506e2a816c5c981b181815013276aa8a8933d2a204e1560e5f3a8d71300fa6fc9c9fb0d2c2ecf44b
|
7
|
+
data.tar.gz: 753a7a36e840edc99a555950722bb7c7eae06efb61f2f297a563f077ca8150fd474db45c6acfe5ee0df37644283d3e566b29ef87f27bf8df3caf7124873ec8d9
|
data/lib/airbrake-ruby/config.rb
CHANGED
@@ -138,6 +138,11 @@ module Airbrake
|
|
138
138
|
# @return [Boolean] true if the config ignores current environment, false
|
139
139
|
# otherwise
|
140
140
|
def ignored_environment?
|
141
|
+
if ignore_environments.any? && environment.nil?
|
142
|
+
logger.warn("#{LOG_LABEL} the 'environment' option is not set, " \
|
143
|
+
"'ignore_environments' has no effect")
|
144
|
+
end
|
145
|
+
|
141
146
|
ignore_environments.include?(environment)
|
142
147
|
end
|
143
148
|
|
data/spec/config_spec.rb
CHANGED
@@ -156,4 +156,37 @@ RSpec.describe Airbrake::Config do
|
|
156
156
|
end
|
157
157
|
end
|
158
158
|
end
|
159
|
+
|
160
|
+
describe "#ignored_environment?" do
|
161
|
+
describe "warnings" do
|
162
|
+
let(:out) { StringIO.new }
|
163
|
+
let(:config) { described_class.new(logger: Logger.new(out)) }
|
164
|
+
|
165
|
+
context "when 'ignore_environments' is set and 'environment' isn't" do
|
166
|
+
it "prints a warning" do
|
167
|
+
config.ignore_environments = [:bingo]
|
168
|
+
|
169
|
+
expect(config.ignored_environment?).to be_falsey
|
170
|
+
expect(out.string).to match(/ignore_environments' has no effect/)
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
context "when 'ignore_environments' is set along with 'environment'" do
|
175
|
+
it "doesn't print a warning" do
|
176
|
+
config.environment = :bango
|
177
|
+
config.ignore_environments = [:bingo]
|
178
|
+
|
179
|
+
expect(config.ignored_environment?).to be_falsey
|
180
|
+
expect(out.string).to be_empty
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
184
|
+
context "when 'ignore_environments' isn't set and 'environment' isn't set too" do
|
185
|
+
it "doesn't print a warning" do
|
186
|
+
expect(config.ignored_environment?).to be_falsey
|
187
|
+
expect(out.string).to be_empty
|
188
|
+
end
|
189
|
+
end
|
190
|
+
end
|
191
|
+
end
|
159
192
|
end
|
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: 1.4.
|
4
|
+
version: 1.4.2
|
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: 2016-06-
|
11
|
+
date: 2016-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|