dedup_csv 0.1.2-x86_64-darwin → 0.1.4-x86_64-darwin

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: 7290246d78259866785480ce07145c99a9f5e83bfdbf8e7a901546f02db417d8
4
- data.tar.gz: ab8ec7615f87edb76c7d098703f7eefb0ee0bea837c084a26d311cac16a200d7
3
+ metadata.gz: a8d54db5b75c74ebba8ab9b3fb58f1c47c483175e01303bb4b4a35bcc43b6771
4
+ data.tar.gz: 9a35304a3e0e05af7c300ab68277c641333933d20850171402ae88513230a7b9
5
5
  SHA512:
6
- metadata.gz: 89788cbeb7f51c8bcd028788dfefe942b6cb77c8426870481ed10fc23a0c84e0fd7fec7d1c6af4b33d4d89a25c1408f49bbd1ac131bcf532f33993578f84c9f7
7
- data.tar.gz: 0a2f83733d23e9a8e3e838753299683685e34d570232106b83c6d555e5680a6b05d769157edc6b2b023dcb72f2754eaafc1bc60471a952cf66bb2ddbeb159ef4
6
+ metadata.gz: 01b1589790737e9ad5bbb44987a27d5b32eb536be92d1682825a0d06446a73a7f1bb1655f01ba40f0c5f41a9cf98dad93a3ba5b6eb89a34bf16d4b7545141582
7
+ data.tar.gz: 6eb1cc9aeac42671d79b35d1f6b97754a6295f62bf903555ab08929366ab04a700b92a0dc195682d2cdf46abab703cd67ce8a87bd7499d6de1905ef482cfc728
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dedup_csv (0.1.2)
4
+ dedup_csv (0.1.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -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.exception_exception(), "previous_csv_path must be a csv file".to_string()));
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.exception_exception(), "new_csv_path must be a csv file".to_string()));
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.exception_exception(), "headers of both csv files must be the same".to_string()));
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.exception_exception(), format!("{}: {}", msg, e.to_string()))
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DedupCsv
4
- VERSION = '0.1.2'
4
+ VERSION = '0.1.4'
5
5
  end
data/lib/dedup_csv.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  # load native extension
4
4
  begin
5
5
  ruby_version = /(\d+\.\d+)/.match(RUBY_VERSION)
6
- require_relative "#{ruby_version}/dedup_csv"
6
+ require_relative "dedup_csv/#{ruby_version}/dedup_csv"
7
7
  rescue LoadError
8
8
  require_relative 'dedup_csv/dedup_csv'
9
9
  end
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.2
4
+ version: 0.1.4
5
5
  platform: x86_64-darwin
6
6
  authors:
7
7
  - kingsley.hendrickse