airbrake-ruby 2.7.1 → 2.8.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 72df910469517a95b5188333116cacfd8e131210
4
- data.tar.gz: b31e5d88736c6d810104ac4f4ca62f4771473ebc
3
+ metadata.gz: 6917eacac7b378489a0cfe8989bb4db03d803934
4
+ data.tar.gz: 9326c2fb739a898a3111085ffeef6dac8a0f2872
5
5
  SHA512:
6
- metadata.gz: 24393ff4bd5881d41ecfed282110a43f0b394539990f95fbd8d0663e1bf8658aa6871bfd5fac38bb46e9580002b0af96c9ca13185f4737887837c50398ef4643
7
- data.tar.gz: 6a305e5efdd77cc5adebf73b55dac88ea33a6914e0871bd35c53b4d62888db85670aa3302674b8f36f38c21d39923eb33903f85b93e9415101e0f190bc31ed1a
6
+ metadata.gz: 4028f0808c5203440b03e54f80d2be6f369751bb20b205e3d006b1a4417718d98b6cdf3ce224462522ea4ec42c234a71940dad3011b5f3219c0741aa80d7502c
7
+ data.tar.gz: 3d9b0b62eec1477f74ae2536c475ff77ef84d01f8b44da04aa228bdd240766bd07e0b35c3d4301d3ed044eb8aab46c595f1eb8e58ef7d3e429a2379a5eb8e667
@@ -50,9 +50,9 @@ module Airbrake
50
50
  attr_accessor :environment
51
51
 
52
52
  ##
53
- # @return [Array<String, Symbol>] the array of environments that forbids
54
- # sending exceptions when the application is running in them. Other
55
- # possible environments not listed in the array will allow sending
53
+ # @return [Array<String,Symbol,Regexp>] the array of environments that
54
+ # forbids sending exceptions when the application is running in them.
55
+ # Other possible environments not listed in the array will allow sending
56
56
  # occurring exceptions.
57
57
  attr_accessor :ignore_environments
58
58
 
@@ -168,7 +168,14 @@ module Airbrake
168
168
  "'ignore_environments' has no effect")
169
169
  end
170
170
 
171
- ignore_environments.map(&:to_s).include?(environment.to_s)
171
+ env = environment.to_s
172
+ ignore_environments.any? do |pattern|
173
+ if pattern.is_a?(Regexp)
174
+ env.match(pattern)
175
+ else
176
+ env == pattern.to_s
177
+ end
178
+ end
172
179
  end
173
180
 
174
181
  private
@@ -4,5 +4,5 @@
4
4
  module Airbrake
5
5
  ##
6
6
  # @return [String] the library version
7
- AIRBRAKE_RUBY_VERSION = '2.7.1'.freeze
7
+ AIRBRAKE_RUBY_VERSION = '2.8.0'.freeze
8
8
  end
@@ -225,6 +225,15 @@ RSpec.describe Airbrake::Notifier do
225
225
  context "when the current env is set and notify envs aren't" do
226
226
  include_examples 'sent notice', environment: :development
227
227
  end
228
+
229
+ context "when ignore_environments specifies a Regexp pattern" do
230
+ params = {
231
+ environment: :testing,
232
+ ignore_environments: ['staging', /test.+/]
233
+ }
234
+
235
+ include_examples 'ignored notice', params
236
+ end
228
237
  end
229
238
 
230
239
  describe ":blacklist_keys" do
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: 2.7.1
4
+ version: 2.8.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: 2018-01-08 00:00:00.000000000 Z
11
+ date: 2018-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec