dedup_csv 0.1.3-x86_64-darwin → 0.1.5-x86_64-darwin
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/ext/dedup_csv/src/lib.rs +4 -4
- data/lib/dedup_csv/2.7/dedup_csv.bundle +0 -0
- data/lib/dedup_csv/3.0/dedup_csv.bundle +0 -0
- data/lib/dedup_csv/3.1/dedup_csv.bundle +0 -0
- data/lib/dedup_csv/3.2/dedup_csv.bundle +0 -0
- data/lib/dedup_csv/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: bc7ff4008d5d639dc6dd1e5d072136e066bbc567d496193b0e5804b74a5e79fc
|
4
|
+
data.tar.gz: c5841f75dad22641fdc6a59a5e43aac5441b8b1fb658e040689856f5727c21f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16c9a4b861504f82fd78a245624c48689313a3c63244726503261ab93010f932d3c9a0804f1d0bb2968a84de57de333913f7c394c0a6cd573c97cbec563d4902
|
7
|
+
data.tar.gz: 8d01485de5496eb2ab27c3f9c08d5c086f5ab684ae453664eced20f49f64185d512a97826aaada48869b44f11801ce7390c8ed08db518f4175a2f8ed5c53f263
|
data/Gemfile.lock
CHANGED
data/ext/dedup_csv/src/lib.rs
CHANGED
@@ -7,10 +7,10 @@ use magnus::{define_module, function, prelude::*, Ruby};
|
|
7
7
|
|
8
8
|
fn dedup(ruby: &Ruby, previous_csv_path: String, new_csv_path: String, target_path: String) -> magnus::error::Result<()> {
|
9
9
|
if !previous_csv_path.has_extension(&["csv"]) {
|
10
|
-
return Err(magnus::Error::new(ruby.
|
10
|
+
return Err(magnus::Error::new(ruby.exception_standard_error(), "previous_csv_path must be a csv file".to_string()));
|
11
11
|
}
|
12
12
|
if !new_csv_path.has_extension(&["csv"]) {
|
13
|
-
return Err(magnus::Error::new(ruby.
|
13
|
+
return Err(magnus::Error::new(ruby.exception_standard_error(), "new_csv_path must be a csv file".to_string()));
|
14
14
|
}
|
15
15
|
|
16
16
|
let csv1 = File::open(previous_csv_path).map_err(|e| magnus_err(ruby, e, "previous_csv_path"))?;
|
@@ -25,7 +25,7 @@ fn dedup(ruby: &Ruby, previous_csv_path: String, new_csv_path: String, target_pa
|
|
25
25
|
let new_headers = new_csv.headers().map_err(|e| magnus_err(ruby, e, "new_csv_path headers"))?;
|
26
26
|
|
27
27
|
if previous_headers != new_headers {
|
28
|
-
return Err(magnus::Error::new(ruby.
|
28
|
+
return Err(magnus::Error::new(ruby.exception_standard_error(), "headers of both csv files must be the same".to_string()));
|
29
29
|
}
|
30
30
|
|
31
31
|
wtr.write_byte_record(previous_headers.as_byte_record()).unwrap();
|
@@ -50,7 +50,7 @@ fn dedup(ruby: &Ruby, previous_csv_path: String, new_csv_path: String, target_pa
|
|
50
50
|
}
|
51
51
|
|
52
52
|
fn magnus_err<E: Error>(ruby: &Ruby, e: E, msg: &str) -> magnus::Error {
|
53
|
-
magnus::Error::new(ruby.
|
53
|
+
magnus::Error::new(ruby.exception_standard_error(), format!("{}: {}", msg, e.to_string()))
|
54
54
|
}
|
55
55
|
|
56
56
|
#[magnus::init]
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/lib/dedup_csv/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dedup_csv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: x86_64-darwin
|
6
6
|
authors:
|
7
7
|
- kingsley.hendrickse
|
@@ -58,7 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 3.
|
61
|
+
version: 3.1.6
|
62
62
|
requirements: []
|
63
63
|
rubygems_version: 3.4.4
|
64
64
|
signing_key:
|