sentry-raven 2.3.1 → 2.4.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: fe631150dba3e7d468ec1b82dce90c833efe4e09
4
- data.tar.gz: 6b362a1faf2b2b17bb4635cbeca461402459428b
3
+ metadata.gz: cb65022aed8ddc08bcb526c2c71d0b53b6cda940
4
+ data.tar.gz: '079e7ee3652a38722ebf913095cfd45be86d79d7'
5
5
  SHA512:
6
- metadata.gz: 82ca336c688dd243a368bb59cca6afb73e5de96828f2dfca286efded734946997cea6f6dcd862d41184d5cfe251f5927d4b7a25fd7fc705841b40662dd131680
7
- data.tar.gz: 1e49e8fc891a662fc6043690d5711419f5703a44f2a40c8a5acff9f1696368d52160345f9e575f8e7b965b8d803abd3b5896266702e57256305279dbd2a2bb28
6
+ metadata.gz: 4aafa4ea87fc78346f7050cddfc71f445e6a9deccc5990c1cebfaf8b62882178a8160d40bf9267ec014c826ffa8a1a2bc8b3cea13a6f748ccca6b2c4feda3e5b
7
+ data.tar.gz: 00000f1fe367791b055f763e3100223bc3f71827a41d60c2dcfcbe63baf4ec25214e3c3a21383901c56e5d4c4c0d72b6be07b1534cf0ecc6b5c5fe1eb0f3bb13
@@ -37,6 +37,10 @@ module Raven
37
37
  # The Faraday adapter to be used. Will default to Net::HTTP when not set.
38
38
  attr_accessor :http_adapter
39
39
 
40
+ # A Proc yeilding the faraday builder allowing for further configuration
41
+ # of the faraday adapter
42
+ attr_accessor :faraday_builder
43
+
40
44
  # You may provide your own LineCache for matching paths with source files.
41
45
  # This may be useful if you need to get source code from places other than
42
46
  # the disk. See Raven::LineCache for the required interface you must implement.
@@ -21,7 +21,7 @@ module Raven
21
21
  BACKTRACE_RE = /^(.+?):(\d+)(?::in `(.+?)')?$/
22
22
 
23
23
  PLATFORM = "ruby".freeze
24
- SDK = { "name" => "sentry-raven", "version" => Raven::VERSION }.freeze
24
+ SDK = { "name" => "raven-ruby", "version" => Raven::VERSION }.freeze
25
25
 
26
26
  attr_accessor :id, :timestamp, :time_spent, :level, :logger,
27
27
  :culprit, :server_name, :release, :modules, :extra, :tags,
@@ -32,10 +32,13 @@ module Raven
32
32
  end
33
33
  end
34
34
 
35
+ config.before_initialize do
36
+ Raven.configuration.logger = ::Rails.logger
37
+ end
38
+
35
39
  config.after_initialize do
36
40
  Raven.configure do |config|
37
41
  config.project_root ||= ::Rails.root
38
- config.logger ||= ::Rails.logger
39
42
  config.release ||= config.detect_release # if project_root has changed, need to re-check
40
43
  end
41
44
 
@@ -2,7 +2,16 @@ require 'time'
2
2
  require 'sidekiq'
3
3
 
4
4
  module Raven
5
- class Sidekiq
5
+ class SidekiqCleanupMiddleware
6
+ def call(_worker, _job, _queue)
7
+ yield
8
+ ensure
9
+ Context.clear!
10
+ BreadcrumbBuffer.clear!
11
+ end
12
+ end
13
+
14
+ class SidekiqErrorHandler
6
15
  ACTIVEJOB_RESERVED_PREFIX = "_aj_".freeze
7
16
 
8
17
  def call(ex, context)
@@ -13,9 +22,6 @@ module Raven
13
22
  :extra => { :sidekiq => context },
14
23
  :culprit => culprit_from_context(context)
15
24
  )
16
- ensure
17
- Context.clear!
18
- BreadcrumbBuffer.clear!
19
25
  end
20
26
 
21
27
  private
@@ -59,6 +65,9 @@ end
59
65
 
60
66
  if Sidekiq::VERSION > '3'
61
67
  Sidekiq.configure_server do |config|
62
- config.error_handlers << Raven::Sidekiq.new
68
+ config.error_handlers << Raven::SidekiqErrorHandler.new
69
+ config.server_middleware do |chain|
70
+ chain.add Raven::SidekiqCleanupMiddleware
71
+ end
63
72
  end
64
73
  end
@@ -48,6 +48,7 @@ module Raven
48
48
  :url => configuration[:server],
49
49
  :ssl => ssl_configuration
50
50
  ) do |builder|
51
+ configuration.faraday_builder.call(builder) if configuration.faraday_builder
51
52
  builder.response :raise_error
52
53
  builder.adapter(*adapter)
53
54
  end
@@ -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.3.1" # rubocop:disable Style/MutableConstant
4
+ VERSION = "2.4.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.3.1
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sentry Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-20 00:00:00.000000000 Z
11
+ date: 2017-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday