opentelemetry-common 0.25.1 → 0.25.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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/opentelemetry/common/utilities.rb +8 -3
- data/lib/opentelemetry/common/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '097eba92f7929c8f874b97f8c618bb8be5585afef3c3103ae31d66dddca4d3d4'
|
|
4
|
+
data.tar.gz: 1d8fb2e9996a96f53a5c3a5fbc0abfb35b1e4077e7a857995ce2d08d1455cc11
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 123478756121ea8d2e96f74052137e8ac911fe03dc969ac2c7b8412e31dc300603de386dc71b578677f28caf9b6608181840a3d48c185e082f40b5b2894316b0
|
|
7
|
+
data.tar.gz: 88c47545222c8de12a0448c552af86f2a4716681abf4f873a51208e203ece3b01eb7dd4a43569d40009faefacc28916c76f093100c47fc478f190f5a4e97b800
|
data/CHANGELOG.md
CHANGED
|
@@ -54,9 +54,9 @@ module OpenTelemetry
|
|
|
54
54
|
#
|
|
55
55
|
# @param [String] string The string to be utf8 encoded
|
|
56
56
|
# @param [optional boolean] binary This option is for displaying binary data
|
|
57
|
-
# @param [
|
|
57
|
+
# @param [String, nil] placeholder The fallback value to be used if encoding fails
|
|
58
58
|
#
|
|
59
|
-
# @return [String]
|
|
59
|
+
# @return [String, nil]
|
|
60
60
|
def utf8_encode(string, binary: false, placeholder: STRING_PLACEHOLDER)
|
|
61
61
|
string = string.to_s
|
|
62
62
|
|
|
@@ -66,6 +66,11 @@ module OpenTelemetry
|
|
|
66
66
|
string.encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')
|
|
67
67
|
elsif string.encoding == ::Encoding::UTF_8
|
|
68
68
|
string
|
|
69
|
+
elsif string.encoding == ::Encoding::ASCII_8BIT
|
|
70
|
+
utf8_string = string.dup.force_encoding(::Encoding::UTF_8)
|
|
71
|
+
raise Encoding::InvalidByteSequenceError, 'binary string is not valid UTF-8' unless utf8_string.valid_encoding?
|
|
72
|
+
|
|
73
|
+
utf8_string
|
|
69
74
|
else
|
|
70
75
|
string.encode(::Encoding::UTF_8)
|
|
71
76
|
end
|
|
@@ -104,7 +109,7 @@ module OpenTelemetry
|
|
|
104
109
|
def untraced(context = Context.current)
|
|
105
110
|
context = context.set_value(UNTRACED_KEY, true)
|
|
106
111
|
if block_given?
|
|
107
|
-
Context.with_current(context) { |ctx| yield ctx }
|
|
112
|
+
Context.with_current(context) { |ctx| yield ctx } # rubocop:disable Style/ExplicitBlockArgument
|
|
108
113
|
else
|
|
109
114
|
context
|
|
110
115
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: opentelemetry-common
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.25.
|
|
4
|
+
version: 0.25.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- OpenTelemetry Authors
|
|
@@ -47,10 +47,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
|
|
|
47
47
|
licenses:
|
|
48
48
|
- Apache-2.0
|
|
49
49
|
metadata:
|
|
50
|
-
changelog_uri: https://rubydoc.info/gems/opentelemetry-common/0.25.
|
|
51
|
-
source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/opentelemetry-common/v0.25.
|
|
50
|
+
changelog_uri: https://rubydoc.info/gems/opentelemetry-common/0.25.2/file/CHANGELOG.md
|
|
51
|
+
source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/opentelemetry-common/v0.25.2/common
|
|
52
52
|
bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
|
|
53
|
-
documentation_uri: https://rubydoc.info/gems/opentelemetry-common/0.25.
|
|
53
|
+
documentation_uri: https://rubydoc.info/gems/opentelemetry-common/0.25.2
|
|
54
54
|
rdoc_options: []
|
|
55
55
|
require_paths:
|
|
56
56
|
- lib
|
|
@@ -65,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
65
65
|
- !ruby/object:Gem::Version
|
|
66
66
|
version: '0'
|
|
67
67
|
requirements: []
|
|
68
|
-
rubygems_version: 4.0.
|
|
68
|
+
rubygems_version: 4.0.20
|
|
69
69
|
specification_version: 4
|
|
70
70
|
summary: Common helpers for OpenTelemetry
|
|
71
71
|
test_files: []
|