traces 0.14.1 → 0.15.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: 8026283fe7d321e24324a4672e7aaf8575897c066364b44bda087c9801815647
4
- data.tar.gz: 6debcfc4f4ca487fe30c0e704c771bf50c56cfa7df6ee512d94fbe9e865a3560
3
+ metadata.gz: 93acb7b30f76a09112b22bbf51760750b7c80bb45573dd73355a2e6a8a3bbd23
4
+ data.tar.gz: d63543fd0cf41f4b39307d77294a280081341023df8963b6480cfb573e6776f2
5
5
  SHA512:
6
- metadata.gz: 55987e8c56f6b60f8985d9682b1d262b06b1badce6cf6d17a2aea5e27a9bafc8bc75c8385b0c1a7d91f67e9e6f23d9a518d082c57c77b47ac0d4a8c2ba206210
7
- data.tar.gz: f4dd535ff8dbcfecc3a1fe2c79a5f32a77aaa643751ac337975af98d2e8f6a5f331433281ebea851e4f2705730dc4fa8ba2e8ca02d11f50b843b3fb11ca7a1cf
6
+ metadata.gz: 39ffc15426bc835660f9935ef7255757664e175b08100ad342e25289fbd1206a82233058fde5efc2fa09058fd9f1cf7054165a962e78f985dbd5814d13509771
7
+ data.tar.gz: a1be8f1ee62e09913f6ca16990943dd1a1cb9f4e1e93aabdaa9067c1b9fc9d4c2d3af0daac3aca228a6660ee45543d0d1f4fe57c9de485ead3f72427ec47b3dc
checksums.yaml.gz.sig CHANGED
Binary file
@@ -84,6 +84,11 @@ module Traces
84
84
  def trace_context
85
85
  Fiber.current.traces_backend_context
86
86
  end
87
+
88
+ # @returns [Boolean] Whether there is an active trace.
89
+ def active?
90
+ !!Fiber.current.traces_backend_context
91
+ end
87
92
  end
88
93
  end
89
94
 
@@ -62,6 +62,11 @@ module Traces
62
62
  def trace_context
63
63
  Fiber.current.traces_backend_context
64
64
  end
65
+
66
+ # @returns [Boolean] Whether there is an active trace.
67
+ def active?
68
+ !!Fiber.current.traces_backend_context
69
+ end
65
70
  end
66
71
  end
67
72
 
@@ -85,6 +85,12 @@ module Traces
85
85
  def trace_context
86
86
  Fiber.current.traces_backend_context
87
87
  end
88
+
89
+ # @returns [Boolean] Whether there is an active trace.
90
+ def active?
91
+ # For the sake of testing, we always enable tracing.
92
+ true
93
+ end
88
94
  end
89
95
  end
90
96
 
@@ -10,5 +10,11 @@ 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 [Boolean] Whether there is an active trace.
15
+ def self.active?
16
+ !!self.trace_context
17
+ end
18
+
13
19
  Config::DEFAULT.require_backend
14
20
  end
@@ -4,5 +4,5 @@
4
4
  # Copyright, 2021-2023, by Samuel Williams.
5
5
 
6
6
  module Traces
7
- VERSION = "0.14.1"
7
+ VERSION = "0.15.1"
8
8
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,12 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: traces
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.1
4
+ version: 0.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  - Felix Yan
9
- autorequire:
10
9
  bindir: bin
11
10
  cert_chain:
12
11
  - |
@@ -38,10 +37,8 @@ cert_chain:
38
37
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
39
38
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
40
39
  -----END CERTIFICATE-----
41
- date: 2024-11-05 00:00:00.000000000 Z
40
+ date: 2025-01-31 00:00:00.000000000 Z
42
41
  dependencies: []
43
- description:
44
- email:
45
42
  executables: []
46
43
  extensions: []
47
44
  extra_rdoc_files: []
@@ -64,7 +61,6 @@ licenses:
64
61
  metadata:
65
62
  documentation_uri: https://socketry.github.io/traces/
66
63
  source_code_uri: https://github.com/socketry/traces.git
67
- post_install_message:
68
64
  rdoc_options: []
69
65
  require_paths:
70
66
  - lib
@@ -79,8 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
75
  - !ruby/object:Gem::Version
80
76
  version: '0'
81
77
  requirements: []
82
- rubygems_version: 3.5.11
83
- signing_key:
78
+ rubygems_version: 3.6.2
84
79
  specification_version: 4
85
80
  summary: Application instrumentation and tracing.
86
81
  test_files: []
metadata.gz.sig CHANGED
Binary file