sentry-raven 2.11.3 → 2.12.0

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: 8789fea16446e839e1e1835c11b7e949749891e8
4
- data.tar.gz: 2c6b88705e24ca9ee1705e8b507ddbcae6478ed4
3
+ metadata.gz: f37a763ca31b2055676b2ddc77a03903b3a9312e
4
+ data.tar.gz: 546178505242c06d765f0aee0b0ecde9700839bc
5
5
  SHA512:
6
- metadata.gz: bd3436ea8c2fcc598ed6dc53c9a420b4edf73e4a1f2af95ead15f8505854c9f61a71db40feda7c042fd9c6385c327666ab6863c713755148aeba20c2e4b014fe
7
- data.tar.gz: 1eaa180c5e71459f5edfb4ab9c9673a554c2751daf1c9779236260d3fb19a4ed2d002b2157c0d484218bc1a28d6bfd83400a096b6a2caa6ccfe9ef595574ec0a
6
+ metadata.gz: 64b156ce51c269d7a189248f4ff31868771b45b6555b669ad5c0c3e3b01d2a433d973763218499cf9361448cbbcebeb440d77e8235555db54ca34a5ce99697d7
7
+ data.tar.gz: 804f70494533a1215980ce9cf0b5bb10e56ad73cbd0d12b9da066b0252f215f1ffa670cc55f4db913c46ef9e128a2b8e92cd1b7549ddd27ee9a325eb6449be61
data/.travis.yml CHANGED
@@ -12,9 +12,9 @@ branches:
12
12
  rvm:
13
13
  - 2.2.10
14
14
  - 2.3.8
15
- - 2.4.6
16
- - 2.5.5
17
- - 2.6.3
15
+ - 2.4.9
16
+ - 2.5.7
17
+ - 2.6.5
18
18
 
19
19
  env:
20
20
  - RAILS_VERSION=4
data/changelog.md CHANGED
@@ -1,3 +1,10 @@
1
+ 2.12.0
2
+ ----
3
+
4
+ * FIX: Remove duplicate message when exception is emitted
5
+ * FIX: Frozen string bug in utf8conversation
6
+ * FEATURE: Allow block on tags_context and extra_context
7
+
1
8
  2.11.3
2
9
  ----
3
10
 
data/lib/raven/client.rb CHANGED
@@ -79,8 +79,14 @@ module Raven
79
79
  end
80
80
  end
81
81
 
82
+ def get_message_from_exception(event)
83
+ (event && event[:exception][:values][0][:type] &&
84
+ event[:exception][:values][0][:value] &&
85
+ "#{event[:exception][:values][0][:type]}: #{event[:exception][:values][0][:value]}")
86
+ end
87
+
82
88
  def get_log_message(event)
83
- (event && event[:message]) || '<no message value>'
89
+ (event && event[:message]) || get_message_from_exception(event) || '<no message value>'
84
90
  end
85
91
 
86
92
  def generate_auth_header
data/lib/raven/event.rb CHANGED
@@ -59,10 +59,7 @@ module Raven
59
59
  return unless configuration.exception_class_allowed?(exc)
60
60
 
61
61
  new(options) do |evt|
62
- evt.message = "#{exc.class}: #{exc.message}"
63
-
64
62
  evt.add_exception_interface(exc)
65
-
66
63
  yield evt if block
67
64
  end
68
65
  end
@@ -183,6 +183,9 @@ module Raven
183
183
  # Raven.tags_context('my_custom_tag' => 'tag_value')
184
184
  def tags_context(options = nil)
185
185
  context.tags.merge!(options || {})
186
+ yield if block_given?
187
+ ensure
188
+ context.tags.delete_if { |k, _| options.keys.include? k } if block_given?
186
189
  end
187
190
 
188
191
  # Bind extra context. Merges with existing context (if any).
@@ -194,6 +197,9 @@ module Raven
194
197
  # Raven.extra_context('my_custom_data' => 'value')
195
198
  def extra_context(options = nil)
196
199
  context.extra.merge!(options || {})
200
+ yield if block_given?
201
+ ensure
202
+ context.extra.delete_if { |k, _| options.keys.include? k } if block_given?
197
203
  end
198
204
 
199
205
  def rack_context(env)
@@ -39,7 +39,7 @@ module Raven
39
39
  # https://github.com/rspec/rspec-support/blob/f0af3fd74a94ff7bb700f6ba06dbdc67bba17fbf/lib/rspec/support/encoded_string.rb#L120-L139
40
40
  if String.method_defined?(:scrub) # 2.1+
41
41
  def remove_invalid_bytes(string)
42
- string.scrub!(REPLACE)
42
+ string.scrub(REPLACE)
43
43
  end
44
44
  else
45
45
  def remove_invalid_bytes(string)
data/lib/raven/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  module Raven
3
3
  # Freezing this constant breaks in 1.9.x
4
- VERSION = "2.11.3" # rubocop:disable Style/MutableConstant
4
+ VERSION = "2.12.0" # rubocop:disable Style/MutableConstant
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sentry-raven
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.11.3
4
+ version: 2.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sentry Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-09-26 00:00:00.000000000 Z
11
+ date: 2019-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday