sentry-ruby-core 4.6.2 → 4.6.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
  SHA256:
3
- metadata.gz: 4d739cc418695f66cb3ff2d84276138d9ede10a4c56c5bb18f7b5e64d95f591b
4
- data.tar.gz: bd81bdb989613b8a0a401f63a592723a5760bf3a96ec20698b69c3aca002120f
3
+ metadata.gz: d11c35de1743f0035364e78a4866425e8976f632363ccc83f63a9f6954e43b29
4
+ data.tar.gz: 79fe8dad952d06b588407109bc10a8f191ec04739edd5115efd3dbe7a32253d8
5
5
  SHA512:
6
- metadata.gz: b28d8c9ab0c76944dfdaf68298077ebedaffa054a2119b8490c4161090d2eef0981fcb8ee1494d68833539d98635b1baec11613ac7f5c8b8fce0bd7268d8c698
7
- data.tar.gz: 75bbf542edf0d15e1f55684d90566deab151114b6750ad59b9eb224ad998449817987b4d255125fc3316dc99dfb0670ae39783a28df6e539e4e3b3c7c862d65a
6
+ metadata.gz: 38d2f4b123c3df2f28117997a769cf54ea1fa4af2eb1e14cc1492b54a23ad0ed53abd8f0ae2492e30abd50df1bccd79d6e8987227ec0dae5411e7130c13821f0
7
+ data.tar.gz: c1c558a090aa8852b11af61e082ecf2977e948b7cce74c1331e1f019129376492169c901bb6a1b0b89802517b0b89559899e6f414ea93b80d40fee34565a2506
@@ -405,7 +405,7 @@ module Sentry
405
405
  def sample_allowed?
406
406
  return true if sample_rate == 1.0
407
407
 
408
- if Random::DEFAULT.rand >= sample_rate
408
+ if Random.rand >= sample_rate
409
409
  @errors << "Excluded by random sample"
410
410
  false
411
411
  else
@@ -1,3 +1,5 @@
1
+ return if Object.method_defined?(:deep_dup)
2
+
1
3
  require 'sentry/core_ext/object/duplicable'
2
4
 
3
5
  #########################################
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+ return if Object.method_defined?(:duplicable?)
2
3
 
3
4
  #########################################
4
5
  # This file was copied from Rails 5.2 #
data/lib/sentry/event.rb CHANGED
@@ -9,7 +9,7 @@ require 'sentry/utils/request_id'
9
9
 
10
10
  module Sentry
11
11
  class Event
12
- ATTRIBUTES = %i(
12
+ SERIALIZEABLE_ATTRIBUTES = %i(
13
13
  event_id level timestamp
14
14
  release environment server_name modules
15
15
  message user tags contexts extra
@@ -17,9 +17,13 @@ module Sentry
17
17
  platform sdk type
18
18
  )
19
19
 
20
+ WRITER_ATTRIBUTES = SERIALIZEABLE_ATTRIBUTES - %i(type timestamp level)
21
+
20
22
  MAX_MESSAGE_SIZE_IN_BYTES = 1024 * 8
21
23
 
22
- attr_accessor(*ATTRIBUTES)
24
+ attr_writer(*WRITER_ATTRIBUTES)
25
+ attr_reader(*SERIALIZEABLE_ATTRIBUTES)
26
+
23
27
  attr_reader :configuration, :request, :exception, :threads
24
28
 
25
29
  def initialize(configuration:, integration_meta: nil, message: nil)
@@ -99,9 +103,6 @@ module Sentry
99
103
  end
100
104
  end
101
105
 
102
- def type
103
- end
104
-
105
106
  def to_hash
106
107
  data = serialize_attributes
107
108
  data[:breadcrumbs] = breadcrumbs.to_hash if breadcrumbs
@@ -139,7 +140,7 @@ module Sentry
139
140
  private
140
141
 
141
142
  def serialize_attributes
142
- self.class::ATTRIBUTES.each_with_object({}) do |att, memo|
143
+ self.class::SERIALIZEABLE_ATTRIBUTES.each_with_object({}) do |att, memo|
143
144
  if value = public_send(att)
144
145
  memo[att] = value
145
146
  end
data/lib/sentry/rake.rb CHANGED
@@ -20,10 +20,10 @@ module Rake
20
20
  alias orig_execute execute
21
21
 
22
22
  def execute(args=nil)
23
- return orig_execute unless Sentry.initialized? && Sentry.get_current_hub
23
+ return orig_execute(args) unless Sentry.initialized? && Sentry.get_current_hub
24
24
 
25
25
  Sentry.get_current_hub.with_background_worker_disabled do
26
- orig_execute
26
+ orig_execute(args)
27
27
  end
28
28
  end
29
29
  end
@@ -4,22 +4,27 @@ module Sentry
4
4
  class TransactionEvent < Event
5
5
  TYPE = "transaction"
6
6
 
7
- ATTRIBUTES = %i(
7
+ SERIALIZEABLE_ATTRIBUTES = %i(
8
8
  event_id level timestamp start_timestamp
9
9
  release environment server_name modules
10
10
  user tags contexts extra
11
11
  transaction platform sdk type
12
12
  )
13
13
 
14
- attr_accessor(*ATTRIBUTES)
14
+ WRITER_ATTRIBUTES = SERIALIZEABLE_ATTRIBUTES - %i(type timestamp start_timestamp level)
15
+
16
+ attr_writer(*WRITER_ATTRIBUTES)
17
+ attr_reader(*SERIALIZEABLE_ATTRIBUTES)
18
+
15
19
  attr_accessor :spans
16
20
 
17
- def start_timestamp=(time)
18
- @start_timestamp = time.is_a?(Time) ? time.to_f : time
21
+ def initialize(configuration:, integration_meta: nil, message: nil)
22
+ super
23
+ @type = TYPE
19
24
  end
20
25
 
21
- def type
22
- TYPE
26
+ def start_timestamp=(time)
27
+ @start_timestamp = time.is_a?(Time) ? time.to_f : time
23
28
  end
24
29
 
25
30
  def to_hash
@@ -2,7 +2,8 @@ module Sentry
2
2
  class Transport
3
3
  class Configuration
4
4
  attr_accessor :timeout, :open_timeout, :proxy, :ssl, :ssl_ca_file, :ssl_verification, :http_adapter, :faraday_builder,
5
- :transport_class, :encoding
5
+ :encoding
6
+ attr_reader :transport_class
6
7
 
7
8
  def initialize
8
9
  @ssl_verification = true
@@ -1,3 +1,3 @@
1
1
  module Sentry
2
- VERSION = "4.6.2"
2
+ VERSION = "4.6.3"
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.6.2
4
+ version: 4.6.3
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-07-23 00:00:00.000000000 Z
11
+ date: 2021-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday