sentry-ruby-core 4.4.0 → 4.4.1

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
  SHA256:
3
- metadata.gz: a6ec50e2aac42f99230cb5a3f78970b057535aae4d31b1dd94e18b0fdf8995be
4
- data.tar.gz: 162dc5844575766403454816354ec4b93ac0c05950c44251963fdcbea685f8e4
3
+ metadata.gz: 55322eb3e1391f625b292b0827c37a6e3c44ea4aacc6b9cc35a77f3feb2522a0
4
+ data.tar.gz: 4d07834ec0038f98f990141b2997a5f6e0a00db33183d928d129dd67fa1324cd
5
5
  SHA512:
6
- metadata.gz: bed995802c6f5b4c628071283aacd5f9804ec1a963202fb2cf63170bc5c3bf75a16dcebc64520aa5b209bbef6042765456df9ff012512b66ba95261553732d1b
7
- data.tar.gz: da726d263583d1db7f5c163cfb5c4e947e3cd4145e512229f37ca8e2a416c62b2284a1a465d26af1155be12ccaf053e93ec74968aff415cca544ff71140e8038
6
+ metadata.gz: 220d28a57647a0c91d28502fe94913d87fcb5f81f7ae474da274ee5855350d911adb1c5b0786b0acbced0308bc37baf911203bda1d8b03348386e6e7f882db9e
7
+ data.tar.gz: 443749298c01be72f32bbbb82759c3d8ffd765e72bb0134405685798e7d92584742f8402b1dd2bf88d5b079dc48d24690b9951fa3f88cbafad1d0aa01b2cb9c7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.4.1
4
+
5
+ - Apply patches when initializing the SDK [#1432](https://github.com/getsentry/sentry-ruby/pull/1432)
6
+
3
7
  ## 4.4.0
4
8
 
5
9
  ### Features
data/lib/sentry-ruby.rb CHANGED
@@ -7,7 +7,6 @@ require "sentry/exceptions"
7
7
  require "sentry/core_ext/object/deep_dup"
8
8
  require "sentry/utils/argument_checking_helper"
9
9
  require "sentry/utils/logging_helper"
10
- require "sentry/net/http"
11
10
  require "sentry/configuration"
12
11
  require "sentry/logger"
13
12
  require "sentry/event"
@@ -64,9 +63,26 @@ module Sentry
64
63
 
65
64
  attr_accessor :background_worker
66
65
 
66
+ @@registered_patches = []
67
+
68
+ def register_patch(&block)
69
+ registered_patches << block
70
+ end
71
+
72
+ def apply_patches(config)
73
+ registered_patches.each do |patch|
74
+ patch.call(config)
75
+ end
76
+ end
77
+
78
+ def registered_patches
79
+ @@registered_patches
80
+ end
81
+
67
82
  def init(&block)
68
83
  config = Configuration.new
69
84
  yield(config) if block_given?
85
+ apply_patches(config)
70
86
  client = Client.new(config)
71
87
  scope = Scope.new(max_breadcrumbs: config.max_breadcrumbs)
72
88
  hub = Hub.new(client, scope)
@@ -190,3 +206,6 @@ module Sentry
190
206
  end
191
207
  end
192
208
  end
209
+
210
+ # patches
211
+ require "sentry/net/http"
@@ -84,4 +84,7 @@ module Sentry
84
84
  end
85
85
  end
86
86
 
87
- Net::HTTP.send(:prepend, Sentry::Net::HTTP)
87
+ Sentry.register_patch do
88
+ patch = Sentry::Net::HTTP
89
+ Net::HTTP.send(:prepend, patch) unless Net::HTTP.ancestors.include?(patch)
90
+ end
@@ -1,3 +1,3 @@
1
1
  module Sentry
2
- VERSION = "4.4.0"
2
+ VERSION = "4.4.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sentry-ruby-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.4.0
4
+ version: 4.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sentry Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-03 00:00:00.000000000 Z
11
+ date: 2021-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday