patchwork_csv_utils 0.1.19-aarch64-linux → 0.1.20-aarch64-linux
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/Gemfile.lock +1 -1
- data/ext/csv_utils/src/utils/csv.rs +7 -6
- data/ext/csv_utils/src/utils/xls.rs +3 -2
- data/lib/csv_utils/2.7/csv_utils.so +0 -0
- data/lib/csv_utils/3.0/csv_utils.so +0 -0
- data/lib/csv_utils/3.1/csv_utils.so +0 -0
- data/lib/csv_utils/3.2/csv_utils.so +0 -0
- data/lib/csv_utils/version.rb +1 -1
- 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: 4490cec46fe8db3039acdf1fb6804a29335d5f634ef3704f50ff256ae382d209
|
4
|
+
data.tar.gz: 3d69cd3a3f483270e2ab0531eb8adb216fbfd7ed6039ae009ab454a80e42cf5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d8a798be3930f41ddb4cf356cca2e1c7924c7c4e367c0fbb5089f276d4ce7cc3a525fa6d38ecf32ed53e8690c76408fed7b7c8f44cdce83c9a4818802f63ad7
|
7
|
+
data.tar.gz: dbd6d528035955f3959c8ccfef0548c874f06a4513cf0333c181581164895ca84d99d0d78159187997be82fc4b2f76c0716eb7daba56a387ef8f7b155387d84f
|
data/Gemfile.lock
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
use std::collections::HashMap;
|
2
|
-
use std::fs::File;
|
3
1
|
use chrono::{NaiveDate, NaiveDateTime, NaiveTime, Utc};
|
4
2
|
use csv::{Reader, StringRecord, Writer};
|
5
3
|
use magnus::{Error, RArray, Ruby};
|
4
|
+
use std::collections::HashMap;
|
5
|
+
use std::fs::File;
|
6
6
|
|
7
|
-
use crate::utils::{
|
7
|
+
use crate::utils::{check_mandatory_headers, create_header_map, headers_as_byte_record, index_of_header_in_mandatory_list, magnus_err, missing_header, missing_value, to_datetime_error, FileExtension};
|
8
8
|
|
9
9
|
pub fn transform_csv(ruby: &Ruby, csv_path: String,
|
10
10
|
target_path: String, exclusions: RArray,
|
@@ -60,7 +60,7 @@ pub fn transform_csv(ruby: &Ruby, csv_path: String,
|
|
60
60
|
let column_value = record.get(*column_index).ok_or(missing_value(ruby, column))?;
|
61
61
|
let column_value = column_value.trim_end();
|
62
62
|
|
63
|
-
validate_trust_name(ruby, &expected_trust_name, trust_name,
|
63
|
+
validate_trust_name(ruby, &expected_trust_name, trust_name, i, &column_value.to_string())?;
|
64
64
|
|
65
65
|
if i == *date {
|
66
66
|
let current = string_to_datetime(column_value).ok_or(to_datetime_error(ruby, column_value, ri, "Date"))?;
|
@@ -88,10 +88,11 @@ pub fn transform_csv(ruby: &Ruby, csv_path: String,
|
|
88
88
|
}
|
89
89
|
|
90
90
|
|
91
|
-
fn validate_trust_name(ruby: &Ruby, expected_trust_name: &String, trust_name: &usize,
|
91
|
+
fn validate_trust_name(ruby: &Ruby, expected_trust_name: &String, trust_name: &usize, i: usize, s: &String) -> magnus::error::Result<()> {
|
92
92
|
if i == *trust_name {
|
93
|
+
let s = s.trim();
|
93
94
|
if s != &expected_trust_name.clone() {
|
94
|
-
return Err(
|
95
|
+
return Err(Error::new(ruby.exception_standard_error(), format!("Trust actual name: '{}' is not as expected: '{}'", s, expected_trust_name)));
|
95
96
|
}
|
96
97
|
}
|
97
98
|
Ok(())
|
@@ -2,11 +2,11 @@ use std::collections::HashMap;
|
|
2
2
|
use std::fs::File;
|
3
3
|
use std::io::{BufWriter, Write};
|
4
4
|
|
5
|
-
use calamine::{
|
5
|
+
use calamine::{open_workbook_auto, Data, Range, Reader};
|
6
6
|
use chrono::{NaiveDateTime, Timelike, Utc};
|
7
7
|
use magnus::{RArray, Ruby};
|
8
8
|
|
9
|
-
use crate::utils::{
|
9
|
+
use crate::utils::{check_mandatory_headers, index_of_header_in_mandatory_list, magnus_err, missing_header, missing_value, to_datetime_error, FileExtension};
|
10
10
|
|
11
11
|
pub fn to_csv(ruby: &Ruby, xls_path: String,
|
12
12
|
target_path: String,
|
@@ -147,6 +147,7 @@ fn write_csv<W: Write>(ruby: &Ruby, dest: &mut W, range: &Range<Data>,
|
|
147
147
|
fn validate_trust_name(ruby: &Ruby, expected_trust_name: &String, trust_name: &usize, ri: usize, r: &Vec<&Data>) -> magnus::error::Result<()> {
|
148
148
|
if ri > 0 {
|
149
149
|
let s = r[*trust_name].to_string();
|
150
|
+
let s = s.trim();
|
150
151
|
if s != expected_trust_name.clone() {
|
151
152
|
return Err(magnus::Error::new(ruby.exception_standard_error(), format!("Trust actual name: '{}' is not as expected: '{}'", s, expected_trust_name)));
|
152
153
|
}
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/lib/csv_utils/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: patchwork_csv_utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.20
|
5
5
|
platform: aarch64-linux
|
6
6
|
authors:
|
7
7
|
- kingsley.hendrickse
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-12-
|
11
|
+
date: 2024-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Deduplication of CSV files and XLS to CSV conversion.
|
14
14
|
email:
|