rscsv 0.3.0 → 0.3.1

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
  SHA1:
3
- metadata.gz: cb17bc325379d4ebf7d2c7e088b84495253c62d4
4
- data.tar.gz: e379a8d05d9a39d551e8a118ace70c394598e187
3
+ metadata.gz: d4be72bac8c595ee40b13567f4c9dbdf364e54f7
4
+ data.tar.gz: '0209d8f85af351b0962151d91bdef1d543423a47'
5
5
  SHA512:
6
- metadata.gz: 3fb8a756221d7b8e293c11ca885e2d935d90ea3abda2b451e0cbd29dd25d63cf2602e0d0109a01239935363fcc822c741b74750727eb29acbe458a95a7e85787
7
- data.tar.gz: 13dfae6dee17a62a51cd64dcb2503f2472066db729d05fd925b01ddb304bb61a551a591cf2813c92b9739b358eb3bd28459e70f8f16411a8ff1f7f734248c367
6
+ metadata.gz: 1138906ef09ff7c845e678006f8455249345764c894879cc0466d55b45c0b0871dce1a19498e1fca57af37c6fd94ce39d70537e6e47a1b8848984c153a5191dc
7
+ data.tar.gz: 84872416860db893d1efd41509a33c19ffdc9d9ac0b4b2b3e07cdc47de528b2163103082aed479a5589361501139a1f8a1feecceed3bb79d65671cb3aad319e6
data/.travis.yml CHANGED
@@ -4,7 +4,7 @@ rvm:
4
4
  - 2.4.1
5
5
  - 2.3.3
6
6
  before_install:
7
- - gem install bundler -v 1.14.6
7
+ - gem install bundler -v 1.15.4
8
8
  - if [ ! -e "$HOME/.cargo/bin" ]; then curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y; fi
9
9
  - export PATH="$HOME/.cargo/bin:$PATH"
10
10
  - rustup default stable
data/Cargo.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  [root]
2
2
  name = "rscsv"
3
- version = "0.1.0"
3
+ version = "0.3.0"
4
4
  dependencies = [
5
- "csv 1.0.0-beta.3 (registry+https://github.com/rust-lang/crates.io-index)",
6
- "helix 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
5
+ "csv 1.0.0-beta.4 (registry+https://github.com/rust-lang/crates.io-index)",
6
+ "helix 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
7
7
  ]
8
8
 
9
9
  [[package]]
@@ -18,16 +18,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
18
18
 
19
19
  [[package]]
20
20
  name = "csv"
21
- version = "1.0.0-beta.3"
21
+ version = "1.0.0-beta.4"
22
22
  source = "registry+https://github.com/rust-lang/crates.io-index"
23
23
  dependencies = [
24
- "csv-core 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
25
- "serde 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
24
+ "csv-core 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
25
+ "serde 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)",
26
26
  ]
27
27
 
28
28
  [[package]]
29
29
  name = "csv-core"
30
- version = "0.1.2"
30
+ version = "0.1.3"
31
31
  source = "registry+https://github.com/rust-lang/crates.io-index"
32
32
  dependencies = [
33
33
  "memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -35,26 +35,26 @@ dependencies = [
35
35
 
36
36
  [[package]]
37
37
  name = "helix"
38
- version = "0.6.1"
38
+ version = "0.6.2"
39
39
  source = "registry+https://github.com/rust-lang/crates.io-index"
40
40
  dependencies = [
41
41
  "cslice 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
42
42
  "cstr-macro 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
43
- "libc 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)",
44
- "libcruby-sys 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
43
+ "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)",
44
+ "libcruby-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
45
45
  ]
46
46
 
47
47
  [[package]]
48
48
  name = "libc"
49
- version = "0.2.23"
49
+ version = "0.2.30"
50
50
  source = "registry+https://github.com/rust-lang/crates.io-index"
51
51
 
52
52
  [[package]]
53
53
  name = "libcruby-sys"
54
- version = "0.6.1"
54
+ version = "0.6.2"
55
55
  source = "registry+https://github.com/rust-lang/crates.io-index"
56
56
  dependencies = [
57
- "libc 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)",
57
+ "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)",
58
58
  ]
59
59
 
60
60
  [[package]]
@@ -62,21 +62,21 @@ name = "memchr"
62
62
  version = "1.0.1"
63
63
  source = "registry+https://github.com/rust-lang/crates.io-index"
64
64
  dependencies = [
65
- "libc 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)",
65
+ "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)",
66
66
  ]
67
67
 
68
68
  [[package]]
69
69
  name = "serde"
70
- version = "1.0.8"
70
+ version = "1.0.11"
71
71
  source = "registry+https://github.com/rust-lang/crates.io-index"
72
72
 
73
73
  [metadata]
74
74
  "checksum cslice 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0f8cb7306107e4b10e64994de6d3274bd08996a7c1322a27b86482392f96be0a"
75
75
  "checksum cstr-macro 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "db53fddba18cdd35477a7213a3ef6acfbfa333c31b42ce019e544c4a1420a06f"
76
- "checksum csv 1.0.0-beta.3 (registry+https://github.com/rust-lang/crates.io-index)" = "158edc15f3da84af2ae2689ab84157f7f94a21dff3dec455320cf44be8963433"
77
- "checksum csv-core 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ed4919aaefb12f555bb4e34aa6415b5db7e20e01e517427f13c2bde286ae9b53"
78
- "checksum helix 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b97612e592273062bb127433a22b201c9b58375c95fc7ace355ee2fc6be61ebe"
79
- "checksum libc 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)" = "e7eb6b826bfc1fdea7935d46556250d1799b7fe2d9f7951071f4291710665e3e"
80
- "checksum libcruby-sys 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d9ae575f064157bc55bb543589971959e3a0163fd49be03fef4c1f3440146114"
76
+ "checksum csv 1.0.0-beta.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a841f3bc2c613b7a3e892c9c4404044de9dab6bc506e253bf8ef05ef906531e5"
77
+ "checksum csv-core 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ae1fbabf21d9a52d04675cc5b032d7bae24ecdcd22646f7eefcd0496a122686c"
78
+ "checksum helix 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f8d1d484452e11351d333dc0f13cce78226edbff63ef332ddb6d7babb58e796c"
79
+ "checksum libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)" = "2370ca07ec338939e356443dac2296f581453c35fe1e3a3ed06023c49435f915"
80
+ "checksum libcruby-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d8b542ce0e28b37e1ca06887c45bb0693d80a413361931dabffd309c1fd8d55b"
81
81
  "checksum memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1dbccc0e46f1ea47b9f17e6d67c5a96bd27030519c519c9c91327e31275a47b4"
82
- "checksum serde 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)" = "c2f530d36fb84ec48fb7146936881f026cdbf4892028835fd9398475f82c1bb4"
82
+ "checksum serde 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "f7726f29ddf9731b17ff113c461e362c381d9d69433f79de4f3dd572488823e9"
data/Cargo.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "rscsv"
3
- version = "0.1.0"
3
+ version = "0.3.0"
4
4
  authors = ["Ville Lautanala <lautis@gmail.com>"]
5
5
 
6
6
  [lib]
@@ -9,4 +9,4 @@ crate-type = ["cdylib"]
9
9
 
10
10
  [dependencies]
11
11
  helix = "0.6.1"
12
- csv = "1.0.0-beta.1"
12
+ csv = "1.0.0-beta.4"
data/lib/rscsv/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rscsv
2
- VERSION = '0.3.0'.freeze
2
+ VERSION = '0.3.1'.freeze
3
3
  end
@@ -1,14 +1,5 @@
1
1
  require 'helix_runtime/build_task'
2
2
 
3
- HelixRuntime::BuildTask.new('rscsv')
4
-
5
- # Monkey-patch project name as directory name varies during installation
6
- module HelixRuntime
7
- class Project
8
- def name
9
- 'rscsv'
10
- end
11
- end
12
- end
3
+ HelixRuntime::BuildTask.new
13
4
 
14
5
  task :default => :build
data/rscsv.gemspec CHANGED
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+
2
3
  lib = File.expand_path('../lib', __FILE__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
5
  require 'rscsv/version'
@@ -22,7 +23,7 @@ Gem::Specification.new do |spec|
22
23
  spec.require_paths = ['lib']
23
24
  spec.extensions = Dir['ext/extconf.rb']
24
25
 
25
- spec.add_dependency 'helix_runtime', '0.6.1'
26
+ spec.add_dependency 'helix_runtime', '0.6.2'
26
27
  spec.add_dependency 'rake', '>= 10.0'
27
28
  spec.add_development_dependency 'bundler', '~> 1.14'
28
29
  spec.add_development_dependency 'rspec', '~> 3.0'
data/src/lib.rs CHANGED
@@ -6,14 +6,15 @@ use std::error::Error;
6
6
  use std::io::Read;
7
7
  use std::slice::from_raw_parts;
8
8
  use helix::sys;
9
- use helix::sys::{VALUE, ID};
10
- use helix::{UncheckedValue, CheckResult, CheckedValue, ToRust, ToRuby};
9
+ use helix::sys::{ID, VALUE};
10
+ use helix::{CheckResult, CheckedValue, ToRuby, ToRust, UncheckedValue};
11
11
  use helix::libc::c_int;
12
12
 
13
13
  struct VecWrap<T>(Vec<T>);
14
14
 
15
15
  impl<T> UncheckedValue<VecWrap<T>> for VALUE
16
- where VALUE: UncheckedValue<T>
16
+ where
17
+ VALUE: UncheckedValue<T>,
17
18
  {
18
19
  fn to_checked(self) -> CheckResult<VecWrap<T>> {
19
20
  if unsafe { sys::RB_TYPE_P(self, sys::T_ARRAY) } {
@@ -26,8 +27,10 @@ impl<T> UncheckedValue<VecWrap<T>> for VALUE
26
27
  Ok(unsafe { CheckedValue::<VecWrap<T>>::new(self) })
27
28
  } else {
28
29
  let val = unsafe { CheckedValue::<String>::new(sys::rb_inspect(self)) };
29
- Err(format!("No implicit conversion of {} into Vec<String>",
30
- val.to_rust()))
30
+ Err(format!(
31
+ "No implicit conversion of {} into Vec<String>",
32
+ val.to_rust()
33
+ ))
31
34
  }
32
35
  }
33
36
  }
@@ -38,8 +41,9 @@ fn ruby_array_to_slice<'a>(array: VALUE) -> &'a [VALUE] {
38
41
  }
39
42
 
40
43
  impl ToRust<VecWrap<String>> for CheckedValue<VecWrap<String>>
41
- where VALUE: UncheckedValue<String>,
42
- CheckedValue<String>: ToRust<String>
44
+ where
45
+ VALUE: UncheckedValue<String>,
46
+ CheckedValue<String>: ToRust<String>,
43
47
  {
44
48
  fn to_rust(self) -> VecWrap<String> {
45
49
  let slice = ruby_array_to_slice(self.inner);
@@ -53,8 +57,9 @@ impl ToRust<VecWrap<String>> for CheckedValue<VecWrap<String>>
53
57
  }
54
58
 
55
59
  impl ToRust<VecWrap<VecWrap<String>>> for CheckedValue<VecWrap<VecWrap<String>>>
56
- where VALUE: UncheckedValue<VecWrap<String>>,
57
- CheckedValue<VecWrap<String>>: ToRust<VecWrap<String>>
60
+ where
61
+ VALUE: UncheckedValue<VecWrap<String>>,
62
+ CheckedValue<VecWrap<String>>: ToRust<VecWrap<String>>,
58
63
  {
59
64
  fn to_rust(self) -> VecWrap<VecWrap<String>> {
60
65
  let slice = ruby_array_to_slice(self.inner);
@@ -67,7 +72,7 @@ impl ToRust<VecWrap<VecWrap<String>>> for CheckedValue<VecWrap<VecWrap<String>>>
67
72
  }
68
73
  }
69
74
 
70
- #[cfg_attr(windows, link(name="helix-runtime"))]
75
+ #[cfg_attr(windows, link(name = "helix-runtime"))]
71
76
  extern "C" {
72
77
  pub fn rb_ary_new_capa(capa: isize) -> VALUE;
73
78
  pub fn rb_ary_entry(ary: VALUE, offset: isize) -> VALUE;
@@ -108,8 +113,8 @@ fn record_to_ruby(record: &csv::ByteRecord) -> VALUE {
108
113
  let inner_array = unsafe { rb_ary_new_capa(record.len() as isize) };
109
114
  for column in record.iter() {
110
115
  unsafe {
111
- let column_value = sys::rb_utf8_str_new(column.as_ptr() as *const i8,
112
- column.len() as i64);
116
+ let column_value =
117
+ sys::rb_utf8_str_new(column.as_ptr() as *const i8, column.len() as i64);
113
118
  rb_ary_push(inner_array, column_value);
114
119
  }
115
120
  }
@@ -169,13 +174,17 @@ impl EnumeratorRead {
169
174
 
170
175
  fn read_from_external(&mut self, buf: &mut [u8]) -> std::io::Result<usize> {
171
176
  let next = unsafe {
172
- rb_funcall(self.value,
173
- sys::rb_intern("next\0".as_ptr() as *const i8),
174
- 0)
177
+ rb_funcall(
178
+ self.value,
179
+ sys::rb_intern("next\0".as_ptr() as *const i8),
180
+ 0,
181
+ )
175
182
  };
176
183
  let slice = unsafe {
177
- from_raw_parts(sys::RSTRING_PTR(next) as *const u8,
178
- sys::RSTRING_LEN(next) as usize)
184
+ from_raw_parts(
185
+ sys::RSTRING_PTR(next) as *const u8,
186
+ sys::RSTRING_LEN(next) as usize,
187
+ )
179
188
  };
180
189
 
181
190
  self.read_and_store_overflow(buf, slice)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rscsv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ville Lautanala
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-30 00:00:00.000000000 Z
11
+ date: 2017-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: helix_runtime
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.6.1
19
+ version: 0.6.2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.6.1
26
+ version: 0.6.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement