contrast-agent 4.14.0 → 4.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2fd48ab0d63bb36fd51e032c360b2ffebe0c387a57e2b70a5e025c1af9667bfb
4
- data.tar.gz: 7aaf091b2e3fd2ced8c8b11708db4a8e216bf55b7499fc235940e93ebff2ef1a
3
+ metadata.gz: 8ab9eae65aeefbeb3c12102f71287c60856783238067a7c461fcf534aaa65712
4
+ data.tar.gz: 1fe74d85374374f40a11c47e44ab0da1042a3f99d607fdfd697a45cc321b45b0
5
5
  SHA512:
6
- metadata.gz: 56fbdd193cc27bcd7e21fe5c4f237276c616e4633344db18b6f27e7e73c99979131cbb9922a2d0cf947c0b666dd3a0d5098b120a805d8cf7b52bc73c6becc535
7
- data.tar.gz: dce071438c0f996567c9867b4ab59900d2225fc3afc59887ffbd850705981f59f228360899084711fe88c9d566e33cdb20f3d5a9127b30efaa0c689274c84159
6
+ metadata.gz: df020b9d0ff09e61107e280f6e76411f9a9b75c1c94f7082ef52d487e5f88b940e75996dd869d648ac0af654f5f84e48b1f691fdcc9e5f294a565d2bb1a39b7d
7
+ data.tar.gz: 8bd869bfacbb82aea7b0cf55ff806fded4bae5c6b0454185c4c422bdd14ee07fd1edb3f4b843e702765a4693b51697a0497129d73d3d3652f32cc50056ed783b
@@ -3,6 +3,6 @@
3
3
 
4
4
  module Contrast
5
5
  module Agent
6
- VERSION = '4.14.0'
6
+ VERSION = '4.14.1'
7
7
  end
8
8
  end
@@ -10,22 +10,41 @@
10
10
  # exists mostly for reference.
11
11
  #
12
12
  # Scope HAS to exist per-fiber.
13
+ # Check to see if Thread#initialize has been prepended. If it hasn't, then we should use the alias approach, so that
14
+ # others can continue to alias it. If it has been, then we must use prepend ourselves.
15
+ if Thread.instance_method(:initialize).owner == Thread
16
+ # Alias-chaining Thread#initialize.
17
+ class Thread
18
+ alias_method :cs__initialize, :initialize
13
19
 
14
- # Monkey-patching Thread#initialize.
15
- class Thread
16
- alias_method :cs__initialize, :initialize
20
+ def initialize *args, &block
21
+ # Thread.current still references the original(callee) thread that is instantiating this new fiber during
22
+ # initialization.
23
+ Contrast::Components::Scope::MONITOR.synchronize do
24
+ if (current_context = Thread.current[:current_context])
25
+ self[:current_context] = current_context.dup
26
+ end
17
27
 
18
- def initialize *args, &block
19
- # Thread.current still references the original(callee) thread that is
20
- # instantiating this new fiber during initialization
21
- Contrast::Components::Scope::MONITOR.synchronize do
22
- if (current_context = Thread.current[:current_context])
23
- self[:current_context] = current_context.dup
28
+ Contrast::Components::Scope.sweep_dead_ecs
24
29
  end
25
30
 
26
- Contrast::Components::Scope.sweep_dead_ecs
31
+ cs__initialize(*args, &block)
32
+ end
33
+ end
34
+ else
35
+ # Prepending Thread#initialize.
36
+ module ContrastThread
37
+ def initialize *args, &block
38
+ # Thread.current still references the original(callee) thread that is instantiating this new fiber during
39
+ # initialization.
40
+ Contrast::Components::Scope::MONITOR.synchronize do
41
+ if (current_context = Thread.current[:current_context])
42
+ self[:current_context] = current_context.dup
43
+ end
44
+ Contrast::Components::Scope.sweep_dead_ecs
45
+ end
46
+ super
27
47
  end
28
-
29
- cs__initialize(*args, &block)
30
48
  end
49
+ Thread.prepend(ContrastThread)
31
50
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contrast-agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.14.0
4
+ version: 4.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - galen.palmer@contrastsecurity.com
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: exe
15
15
  cert_chain: []
16
- date: 2021-12-07 00:00:00.000000000 Z
16
+ date: 2021-12-17 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: bundler
@@ -617,20 +617,20 @@ executables:
617
617
  - contrast_service
618
618
  extensions:
619
619
  - ext/cs__common/extconf.rb
620
- - ext/cs__assess_basic_object/extconf.rb
621
- - ext/cs__assess_string/extconf.rb
622
- - ext/cs__assess_hash/extconf.rb
623
- - ext/cs__assess_module/extconf.rb
624
- - ext/cs__assess_kernel/extconf.rb
620
+ - ext/cs__assess_fiber_track/extconf.rb
625
621
  - ext/cs__assess_array/extconf.rb
622
+ - ext/cs__assess_string/extconf.rb
623
+ - ext/cs__assess_regexp/extconf.rb
624
+ - ext/cs__assess_yield_track/extconf.rb
625
+ - ext/cs__assess_active_record_named/extconf.rb
626
626
  - ext/cs__contrast_patch/extconf.rb
627
+ - ext/cs__assess_kernel/extconf.rb
628
+ - ext/cs__assess_hash/extconf.rb
629
+ - ext/cs__assess_string_interpolation26/extconf.rb
627
630
  - ext/cs__os_information/extconf.rb
628
631
  - ext/cs__assess_marshal_module/extconf.rb
629
- - ext/cs__assess_fiber_track/extconf.rb
630
- - ext/cs__assess_string_interpolation26/extconf.rb
631
- - ext/cs__assess_active_record_named/extconf.rb
632
- - ext/cs__assess_regexp/extconf.rb
633
- - ext/cs__assess_yield_track/extconf.rb
632
+ - ext/cs__assess_basic_object/extconf.rb
633
+ - ext/cs__assess_module/extconf.rb
634
634
  extra_rdoc_files: []
635
635
  files:
636
636
  - ".clang-format"