dedup_csv 0.1.2-x86_64-linux-musl → 0.1.4-x86_64-linux-musl

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7536441d826a01cea77d710f2f829d2117b97f2d9d7197f578c3c12bd0a006e0
4
- data.tar.gz: 8507d121674bbd259fd4acf45aedcd3a2901ff61a328223cc62c857715192e99
3
+ metadata.gz: 8a04189c0c3ab3d9eb4290550d4241d1428b63dc5c33a82ca2cd8822137b01d8
4
+ data.tar.gz: 01f54baef3e79147c75d07dfcbbae3c2c853aaa360918c46f1e2c75275da2e06
5
5
  SHA512:
6
- metadata.gz: d3328c2967bd16e6c9e79b69a06363c86c97205d95fc6c47a760294fcf754890d5aff2d884a25428c6febe3065eb1bc235b6f846d10d8728f865a1434ea1ef3f
7
- data.tar.gz: 54910ee3c215693e6a783c391578de2538b978693c877e0216e1edfb585272a4372355b5dd92cdee5cc3b25cd9a6d4a2c4fb23a713e95df31fd660d8d3d2b1f9
6
+ metadata.gz: 0dbabbbd4532c7051f1eea0899c78b65f61617636843e9b2fe353803596d5f27e29188fe0f19b35f61199135943bc1937be965a3ec41b7b72778d82d64ef5656
7
+ data.tar.gz: 3e0b7341702441a81dd9a18b868e6ed22b5bd0ea9ebc6d34be53810415e6913182a9ab48e2c024313b6fccd94d8edac8425590d51170431ba5dcee65c0dbee15
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-linux-musl
6
6
  authors:
7
7
  - kingsley.hendrickse