sentry-raven 2.1.2 → 2.1.3

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: aae9ec571ae0b5bfbd2a230d2a10e07f9a639fb1
4
- data.tar.gz: 3abede23ce09a427c5c6d85df29a030bfe915487
3
+ metadata.gz: 3c98bcb5d5577e2a88624db5a2cf08c2c903c033
4
+ data.tar.gz: ad1e3d207fe9930b26218616978298f73ea3ec55
5
5
  SHA512:
6
- metadata.gz: e1cf24c8c9815ed663db02cac792bb9949abdd8ce6477846f6748d15cb1ad877a6ce4d47524f2ab0594c8a8683fae9d19256e4fb39b34840b48f3d11c5cabaf2
7
- data.tar.gz: 26f7dcb0a7234e2bb12f0598a0685d13e07c90016c1c99f9758c8403fb06361ca6df9e93b916f9610cd6f72ab953a5abf4f1e50e2f5283ad0b9fe1b4f23db096
6
+ metadata.gz: 4f612c5dd4ae9772f1feeb0462d6f5f95019535ca3790dec9920fabf470cfc4272e604468ea8fc8e8e560f951331a32a1e30e79cbedf488390a63f504347359f
7
+ data.tar.gz: ed65ecae87b513b51973b38a4ed52be86ef88107859f50497146c5b2bc9f9222804d5776982e99f0e3438d27dc7f09e052e522aa6642990fcaad6be41cdc1770
@@ -10,11 +10,11 @@ module Raven
10
10
  Thread.current[:sentry_context] = nil
11
11
  end
12
12
 
13
- attr_accessor :extra, :os, :rack_env, :runtime, :tags, :user
13
+ attr_accessor :extra, :server_os, :rack_env, :runtime, :tags, :user
14
14
 
15
15
  def initialize
16
16
  self.extra = {}
17
- self.os = self.class.os_context
17
+ self.server_os = self.class.os_context
18
18
  self.rack_env = nil
19
19
  self.runtime = self.class.runtime_context
20
20
  self.tags = {}
@@ -26,7 +26,7 @@ module Raven
26
26
  attr_accessor :id, :timestamp, :time_spent, :level, :logger,
27
27
  :culprit, :server_name, :release, :modules, :extra, :tags,
28
28
  :context, :configuration, :checksum, :fingerprint, :environment,
29
- :os, :runtime, :breadcrumbs, :user, :backtrace
29
+ :server_os, :runtime, :breadcrumbs, :user, :backtrace
30
30
 
31
31
  def initialize(init = {})
32
32
  @configuration = Raven.configuration
@@ -44,7 +44,7 @@ module Raven
44
44
  @modules = list_gem_specs if @configuration.send_modules
45
45
  @user = {} # TODO: contexts
46
46
  @extra = {} # TODO: contexts
47
- @os = {} # TODO: contexts
47
+ @server_os = {} # TODO: contexts
48
48
  @runtime = {} # TODO: contexts
49
49
  @tags = {} # TODO: contexts
50
50
  @checksum = nil
@@ -68,7 +68,7 @@ module Raven
68
68
  @user = @context.user.merge(@user) # TODO: contexts
69
69
  @extra = @context.extra.merge(@extra) # TODO: contexts
70
70
  @tags = @configuration.tags.merge(@context.tags).merge(@tags) # TODO: contexts
71
- @os = @context.os # TODO: contexts
71
+ @server_os = @context.server_os # TODO: contexts
72
72
  @runtime = @context.runtime # TODO: contexts
73
73
 
74
74
  # Some type coercion
@@ -100,7 +100,7 @@ module Raven
100
100
  Raven.logger.info "Refusing to capture Raven error: #{exc.inspect}"
101
101
  return nil
102
102
  end
103
- if configuration[:excluded_exceptions].any? { |x| (x === exc rescue false) || x == exc.class.name }
103
+ if configuration[:excluded_exceptions].any? { |x| get_exception_class(x) === exc }
104
104
  Raven.logger.info "User excluded error: #{exc.inspect}"
105
105
  return nil
106
106
  end
@@ -134,6 +134,25 @@ module Raven
134
134
 
135
135
  private
136
136
 
137
+ def get_exception_class(x)
138
+ x.is_a?(Module) ? x : qualified_const_get(x)
139
+ end
140
+
141
+ # In Ruby <2.0 const_get can't lookup "SomeModule::SomeClass" in one go
142
+ def qualified_const_get(x)
143
+ x = x.to_s
144
+ parts = x.split("::")
145
+ parts.reject!(&:empty?)
146
+
147
+ if parts.size < 2
148
+ Object.const_get(x)
149
+ else
150
+ parts.inject(Object) { |a, e| a.const_get(e) }
151
+ end
152
+ rescue NameError # There's no way to safely ask if a constant exist for an unknown string
153
+ nil
154
+ end
155
+
137
156
  def get_exception_context(exc)
138
157
  if exc.instance_variable_defined?(:@__raven_context)
139
158
  exc.instance_variable_get(:@__raven_context)
@@ -231,7 +250,7 @@ module Raven
231
250
  :platform => PLATFORM,
232
251
  :sdk => SDK,
233
252
  :contexts => {
234
- :os => @os,
253
+ :server_os => @server_os,
235
254
  :runtime => @runtime
236
255
  }
237
256
  }
@@ -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.1.2" # rubocop:disable Style/MutableConstant
4
+ VERSION = "2.1.3" # 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.1.2
4
+ version: 2.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sentry Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-21 00:00:00.000000000 Z
11
+ date: 2016-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -193,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
193
193
  version: '0'
194
194
  requirements: []
195
195
  rubyforge_project:
196
- rubygems_version: 2.5.1
196
+ rubygems_version: 2.6.8
197
197
  signing_key:
198
198
  specification_version: 4
199
199
  summary: A gem that provides a client interface for the Sentry error logger