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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2649182552b42388d488153498cd971ffa2c7ca1
4
- data.tar.gz: 2d8eb9a2e0e54e8784e8f9204545519456f4b87c
3
+ metadata.gz: 26dd376dd3646e94ceb28cd59f49e3f5edd67321
4
+ data.tar.gz: 413ac77fb12f382bac026959ebc502ed0246eab1
5
5
  SHA512:
6
- metadata.gz: d0b5e3f1bb6d74d84a619bfeb416688cbb7c773b14f9328365c800aa0b8532673ef58727991dd1e035256e6018f8d12186bc37ce2effc9d5ee5e10018210efbb
7
- data.tar.gz: c413d29e92a294952a73db358a7a62949075ab4d6bb5ed5b6295f7682517285d601e32bf93ed6fb2641fd6610ea2822e8b0e760d207d6c9033ced88aa5b919fb
6
+ metadata.gz: e49ee6c9772cd21dfa62c6441218f122cfe382e27bb60200506e2a816c5c981b181815013276aa8a8933d2a204e1560e5f3a8d71300fa6fc9c9fb0d2c2ecf44b
7
+ data.tar.gz: 753a7a36e840edc99a555950722bb7c7eae06efb61f2f297a563f077ca8150fd474db45c6acfe5ee0df37644283d3e566b29ef87f27bf8df3caf7124873ec8d9
@@ -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
 
@@ -3,5 +3,5 @@
3
3
  module Airbrake
4
4
  ##
5
5
  # @return [String] the library version
6
- AIRBRAKE_RUBY_VERSION = '1.4.1'.freeze
6
+ AIRBRAKE_RUBY_VERSION = '1.4.2'.freeze
7
7
  end
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.1
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-06 00:00:00.000000000 Z
11
+ date: 2016-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec