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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2bfe7ed2fab4ae654340e7aef5838dc71d904635ac4aa0d78dcee8b6d00ead31
4
- data.tar.gz: 4d2b22e57baaffd236846e3505fc1303391202a48e6b3e64867dd84ca9c4e61e
3
+ metadata.gz: 7447cd235fe9715cc6e6c868b0f0048c7ec516b70ea88e323dcdc1fd01e24f11
4
+ data.tar.gz: 16b4237428fdf1258327ebc86928c4f3cc8db292289ff8151db364f77c505439
5
5
  SHA512:
6
- metadata.gz: 6d4eccd2e2c6fcf7813da447cac43f3e359057edb17af8476666ee9e40ecf71735738a5b0a0919f284a213e87c7c7d19750a78a5c17e9ac15bd7c1d3ee6a8445
7
- data.tar.gz: 424d016b5959104a7778724fb71d65d205b3b3d2f9c9bfca54ca3a3c1fb4b9f8d622f2d5bb3d5584fe81d138870613ba8ae28c01982d656be754e00efa44faab
6
+ metadata.gz: 186d4b1f8f053e9fa2cba311d7f9760e496ea8597dbea5c7e3e1d34c62fe6237df8c51692ff40a18f98085b58dc9a98942a54b94854b0e32ea30e4033e9d9aa3
7
+ data.tar.gz: 68ada778e3d6d7b9187f5b95398f408ff08940e0c77f5019a99611279ff4e1bbb9a5bfacd32ed3c0082bfb607ecc93df158ef2399b414d53a0e0bc7c53c0727a
data/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
1
  ## [Unreleased]
2
2
  * No unreleased changes
3
3
 
4
+ ## 5.9.6 / 2023-11-14
5
+ ## Fixed
6
+ * YAMLSupport should preserve escape sequences in JSON text
7
+
4
8
  ## 5.9.5 / 2023-10-26
5
9
  * Support Rails 7.1
6
10
 
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: 2253a90ec8db872590a8167fdebe95d6ed677cc2
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: 45fa90daa2dd131ac0286ef7f4af1447bd01bc6c
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: f4f7cb0803ea34a2f1ba83495d8bcbd942786bce
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: f4f7cb0803ea34a2f1ba83495d8bcbd942786bce
286
+ safe_revision: '09ad2e0c210d3e4377de68dac3d54932df6c1994'
@@ -3,5 +3,5 @@
3
3
  # This defines the NdrSupport version. If you change it, rebuild and commit the gem.
4
4
  # Use "rake build" to build the gem, see rake -T for all bundler rake tasks.
5
5
  module NdrSupport
6
- VERSION = '5.9.5'
6
+ VERSION = '5.9.6'
7
7
  end
@@ -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.5
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-10-26 00:00:00.000000000 Z
11
+ date: 2023-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord