ndr_support 5.9.5 → 5.9.6
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/code_safety.yml +4 -4
- data/lib/ndr_support/version.rb +1 -1
- data/lib/ndr_support/yaml/serialization_migration.rb +3 -0
- data/test/yaml/serialization_test.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7447cd235fe9715cc6e6c868b0f0048c7ec516b70ea88e323dcdc1fd01e24f11
|
4
|
+
data.tar.gz: 16b4237428fdf1258327ebc86928c4f3cc8db292289ff8151db364f77c505439
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 186d4b1f8f053e9fa2cba311d7f9760e496ea8597dbea5c7e3e1d34c62fe6237df8c51692ff40a18f98085b58dc9a98942a54b94854b0e32ea30e4033e9d9aa3
|
7
|
+
data.tar.gz: 68ada778e3d6d7b9187f5b95398f408ff08940e0c77f5019a99611279ff4e1bbb9a5bfacd32ed3c0082bfb607ecc93df158ef2399b414d53a0e0bc7c53c0727a
|
data/CHANGELOG.md
CHANGED
data/code_safety.yml
CHANGED
@@ -23,7 +23,7 @@ file safety:
|
|
23
23
|
CHANGELOG.md:
|
24
24
|
comments:
|
25
25
|
reviewed_by: brian.shand
|
26
|
-
safe_revision:
|
26
|
+
safe_revision: '09ad2e0c210d3e4377de68dac3d54932df6c1994'
|
27
27
|
CODE_OF_CONDUCT.md:
|
28
28
|
comments:
|
29
29
|
reviewed_by: timgentry
|
@@ -171,7 +171,7 @@ file safety:
|
|
171
171
|
lib/ndr_support/version.rb:
|
172
172
|
comments:
|
173
173
|
reviewed_by: brian.shand
|
174
|
-
safe_revision:
|
174
|
+
safe_revision: 26236a310377036e1a27eb9534b4167430da6f3c
|
175
175
|
lib/ndr_support/working_days.rb:
|
176
176
|
comments:
|
177
177
|
reviewed_by: josh.pencheon
|
@@ -179,7 +179,7 @@ file safety:
|
|
179
179
|
lib/ndr_support/yaml/serialization_migration.rb:
|
180
180
|
comments:
|
181
181
|
reviewed_by: brian.shand
|
182
|
-
safe_revision:
|
182
|
+
safe_revision: '09ad2e0c210d3e4377de68dac3d54932df6c1994'
|
183
183
|
ndr_support.gemspec:
|
184
184
|
comments:
|
185
185
|
reviewed_by: brian.shand
|
@@ -283,4 +283,4 @@ file safety:
|
|
283
283
|
test/yaml/serialization_test.rb:
|
284
284
|
comments:
|
285
285
|
reviewed_by: brian.shand
|
286
|
-
safe_revision:
|
286
|
+
safe_revision: '09ad2e0c210d3e4377de68dac3d54932df6c1994'
|
data/lib/ndr_support/version.rb
CHANGED
@@ -57,6 +57,9 @@ module NdrSupport
|
|
57
57
|
# While `psych` emits UTF-8 YAML, `syck` double escapes
|
58
58
|
# higher characters. We need to unescape any we find:
|
59
59
|
def handle_special_characters!(string, coerce_invalid_chars)
|
60
|
+
# TODO: Change to only handle syck control characters
|
61
|
+
return unless string.start_with?('---') # Only handle YAML that is not JSON
|
62
|
+
|
60
63
|
# Replace any encoded hex chars with their actual value:
|
61
64
|
string.gsub!(/((?:\\x[0-9A-F]{2})+)/) do
|
62
65
|
byte_sequence = $1.scan(/[0-9A-F]{2}/)
|
@@ -29,6 +29,11 @@ class SerializationTest < Minitest::Test
|
|
29
29
|
assert_equal "control 0x01 char \n whoops!", load_yaml(chr_1_yaml)
|
30
30
|
end
|
31
31
|
|
32
|
+
test 'should leave non-binary JSON with things that look like control chars unchanged' do
|
33
|
+
hash = { 'report' => ' \x09 ' }
|
34
|
+
assert_equal hash, load_yaml(hash.to_json)
|
35
|
+
end
|
36
|
+
|
32
37
|
test 'load_yaml should not coerce to UTF-8 by default' do
|
33
38
|
assert_yaml_coercion_behaviour
|
34
39
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ndr_support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.9.
|
4
|
+
version: 5.9.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- NCRS Development Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|