ndr_import 11.0.0 → 11.0.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 +11 -2
- data/lib/ndr_import/file/excel.rb +1 -1
- data/lib/ndr_import/helpers/file/excel.rb +1 -1
- data/lib/ndr_import/helpers/file/xml.rb +5 -0
- data/lib/ndr_import/version.rb +1 -1
- data/lib/ndr_import/xml/column_mapping.rb +7 -7
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab2194b39d6226b9c8883f89ef30045c714fe276cdd5312f0b53f643cebbc003
|
4
|
+
data.tar.gz: 54433f513c6a6fb546f2f1b217d711214e44e1c30f488d1d00f9a67f41b94c0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c60e8a7a9abd7e30ff754898e6c332f150133488ab5837cdf030bff483db6b3eda6196bb42a2bb42099104690d2621c1b9ad39580313ff82c66f813043f2843
|
7
|
+
data.tar.gz: 4094561f3f994b0a82ee974f5eba00f6e70fdf219c311534ab070dc5da8f861a4dbe73d67842db2231766a18d0a1721cd13e9a8e46a9910987e450f388f06369
|
data/CHANGELOG.md
CHANGED
@@ -1,12 +1,21 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
=======
|
3
|
-
*no unreleased changes*
|
3
|
+
* no unreleased changes*
|
4
|
+
|
5
|
+
## 11.0.2 / 2024-02-06
|
6
|
+
### Fixed
|
7
|
+
* Resolve Rails 7 deprecation warnings
|
8
|
+
* Fix XML parsing with latest `nokogiri` 1.16.0
|
9
|
+
|
10
|
+
## 11.0.1 / 2023-10-30
|
11
|
+
### Fixed
|
12
|
+
* Ensure autogenerated XML column mappings are unique
|
4
13
|
|
5
14
|
## 11.0.0 / 2023-10-27
|
6
15
|
### Changed
|
7
16
|
* XML enhancements. Breaking change, the enhancements are not backward compatible
|
8
17
|
### Fixed
|
9
|
-
* Replace unsupported seven_zip_ruby gem with seven-zip fork
|
18
|
+
* Replace unsupported `seven_zip_ruby` gem with seven-zip fork
|
10
19
|
|
11
20
|
## 10.3.0 / 2023-09-07
|
12
21
|
### Added
|
@@ -22,6 +22,11 @@ module NdrImport
|
|
22
22
|
doc = nil
|
23
23
|
|
24
24
|
escaping_control_chars_if_necessary(preserve_control_chars, file_data) do
|
25
|
+
if Nokogiri::XML('<?xml version="1.0" encoding="UTF-16"?><body/>').
|
26
|
+
errors.first.message.match?(/Blank needed here\z/)
|
27
|
+
# Nokogiri 1.16.0 workaround for UTF-16 data.
|
28
|
+
file_data.sub!('UTF-16', 'UTF-8')
|
29
|
+
end
|
25
30
|
doc = Nokogiri::XML(file_data, &:huge)
|
26
31
|
doc.encoding = 'UTF-8'
|
27
32
|
emulate_strict_mode_fatal_check!(doc)
|
data/lib/ndr_import/version.rb
CHANGED
@@ -57,19 +57,19 @@ module NdrImport
|
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
|
-
# Append "_1", "_2" etc to repeating rawtext and optionally mapped field names
|
61
|
-
# single record, so data is not overwritten
|
60
|
+
# Append "_1.1", "_2.1", "_1" etc to repeating rawtext and optionally mapped field names
|
61
|
+
# within a single record, so data is not overwritten
|
62
62
|
def apply_new_rawtext_and_mapped_names_to(new_column)
|
63
63
|
existing_rawtext = existing_column['rawtext_name'] || existing_column['column']
|
64
64
|
column_name_increment = new_column['column'].scan(/\[(\d+)\]/)
|
65
65
|
relative_path_increment = new_column.dig('xml_cell', 'relative_path').scan(/\[(\d+)\]/)
|
66
66
|
|
67
|
-
# Find all the increments (e.g. [1], [2]) from the new column and
|
68
|
-
# as the rawtext and column name increment
|
69
|
-
increment = (column_name_increment + relative_path_increment).flatten.
|
70
|
-
new_column['rawtext_name'] = existing_rawtext + "_#{increment}"
|
67
|
+
# Find all the increments (e.g. [1], [2]) from the new column and concatenate them to
|
68
|
+
# use as the rawtext and column name increment
|
69
|
+
increment = (column_name_increment + relative_path_increment).flatten.compact.join('.')
|
70
|
+
new_column['rawtext_name'] = existing_rawtext + "_#{increment}" if increment.present?
|
71
71
|
|
72
|
-
return unless
|
72
|
+
return unless increment.present? && increment_field_name
|
73
73
|
|
74
74
|
new_column['mappings'] = incremented_mappings_for(new_column, increment)
|
75
75
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ndr_import
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 11.0.
|
4
|
+
version: 11.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- NCRS Development Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -465,7 +465,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
465
465
|
- !ruby/object:Gem::Version
|
466
466
|
version: '0'
|
467
467
|
requirements: []
|
468
|
-
rubygems_version: 3.
|
468
|
+
rubygems_version: 3.2.33
|
469
469
|
signing_key:
|
470
470
|
specification_version: 4
|
471
471
|
summary: NDR Import
|