traces 0.15.0 → 0.15.2

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: b5540f65335aab146d74616bfb46fe0119e93134ad8b3c241bfa97c31319d274
4
- data.tar.gz: f4a13424f6035a3a11d1a3b5129123c391a3e3738a6a1594af83c17572d2410b
3
+ metadata.gz: 6cba8b363fbd6a0df7f971924f3b8d3f358bc5b91ea2eb57045716285081fc35
4
+ data.tar.gz: 612777384a90dbc375f1a349e8291cabd7bb8ebf77830075d29703e54d5f4d60
5
5
  SHA512:
6
- metadata.gz: 79f27a7a1e2fff3bfba6c17d933f957ae981778b9696c030f86cd12d08a0709ebc40a31b9812f2042d7bb3115bee52405f8eb27ec4a11e94032fa83d8302c39a
7
- data.tar.gz: 277a0b1427ee998fb017d8043d550aabde68371481395ff0b1b1a6733f6a80136889d9e3e934897059fa69bd32b11c1f30fa3598be4443933f9563f746dfc9cb
6
+ metadata.gz: 162910bc810cdb69c55e6bb59354dd7b0859237a4cc47c5d1a4ce4ccb6cafee24913680d9f1d815540b4524941eb9fd8bcda7cd49bebcd3fbdac534708cb828e
7
+ data.tar.gz: 4e5432869b0470ae85fbee9d6efbc57130b07944f5960eb7ee4832a848068caf56445b5846434075206111262f17b12ce92564417ff56d90c3162ee5338f0bbc
checksums.yaml.gz.sig CHANGED
Binary file
@@ -88,7 +88,8 @@ module Traces
88
88
 
89
89
  # @returns [Boolean] Whether there is an active trace.
90
90
  def active?
91
- !!Fiber.current.traces_backend_context
91
+ # For the sake of testing, we always enable tracing.
92
+ true
92
93
  end
93
94
  end
94
95
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2021-2023, by Samuel Williams.
4
+ # Copyright, 2021-2025, by Samuel Williams.
5
5
 
6
6
  require_relative 'config'
7
7
 
@@ -10,6 +10,12 @@ module Traces
10
10
  module Backend
11
11
  end
12
12
 
13
+ # This is a default implementation, which can be replaced by the backend.
14
+ # @returns [Object] The current trace context.
15
+ def self.trace_context
16
+ nil
17
+ end
18
+
13
19
  # This is a default implementation, which can be replaced by the backend.
14
20
  # @returns [Boolean] Whether there is an active trace.
15
21
  def self.active?
data/lib/traces/config.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2024, by Samuel Williams.
4
+ # Copyright, 2024-2025, by Samuel Williams.
5
5
 
6
6
  module Traces
7
7
  # Represents a configuration for the traces library.
@@ -36,7 +36,8 @@ module Traces
36
36
  if backend = env['TRACES_BACKEND']
37
37
  begin
38
38
  if require(backend)
39
- Traces.extend(Backend::Interface)
39
+ # We ensure that the interface methods replace any existing methods by prepending the module:
40
+ Traces.singleton_class.prepend(Backend::Interface)
40
41
 
41
42
  return true
42
43
  end
@@ -4,5 +4,5 @@
4
4
  # Copyright, 2021-2023, by Samuel Williams.
5
5
 
6
6
  module Traces
7
- VERSION = "0.15.0"
7
+ VERSION = "0.15.2"
8
8
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: traces
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.15.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -37,7 +37,7 @@ cert_chain:
37
37
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
38
38
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
39
39
  -----END CERTIFICATE-----
40
- date: 2025-01-31 00:00:00.000000000 Z
40
+ date: 2025-02-01 00:00:00.000000000 Z
41
41
  dependencies: []
42
42
  executables: []
43
43
  extensions: []
metadata.gz.sig CHANGED
Binary file