osv 0.3.2 → 0.3.3

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: 687f5a3426558ea4d4d342f153dae1f11da93807daddcc6944888d92cda7502b
4
- data.tar.gz: e9f766b94e4c7f806e81eec859a0146b6a4758c5a69c759b084f64e01fd7a888
3
+ metadata.gz: 33c644fac6e61f8bf3b9f11e646d6706017ece2a386df03a568b5ed06fd91e2a
4
+ data.tar.gz: 0d977fb3a7eaf867663feb76161eb2d3fbe42e758523ef8cafbff51a9acfef0d
5
5
  SHA512:
6
- metadata.gz: bb14e59bca79613064a07cbcfa6c2531f08c68eb131e512b9822c7295bcacfd051de8dcd49100d12c8377d90a438d528dc5b20bcf6a1aa7c4e44f8e2aaae7111
7
- data.tar.gz: a3a83f9653ef5bc41c908de14c96b756c719fd2750c8739b4a2165ff91ed82d34fdfde184c853185a8ff516e324d01816c65764f05adf58db6b2159ae66b0c74
6
+ metadata.gz: b6fe382c005837fbfc705bd02b1859fdfa9fa9f955c15f7b13ffacb97f1d5dc0714288c23a7e2431a21aada6aacb1952b33ae8d14acd019c96ed719f5580c02d
7
+ data.tar.gz: 4e7c3d783f23af709505a4c182d1ee6744c9f28226aecdf68c532ada9ffa653858bc730bfd879cfa94d8e8f7a1280c49380bb5b6f74ed16b7ac776318aa53d1b
data/Cargo.lock CHANGED
@@ -2,6 +2,12 @@
2
2
  # It is not intended for manual editing.
3
3
  version = 3
4
4
 
5
+ [[package]]
6
+ name = "adler2"
7
+ version = "2.0.0"
8
+ source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627"
10
+
5
11
  [[package]]
6
12
  name = "aho-corasick"
7
13
  version = "1.1.3"
@@ -43,12 +49,6 @@ version = "2.6.0"
43
49
  source = "registry+https://github.com/rust-lang/crates.io-index"
44
50
  checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de"
45
51
 
46
- [[package]]
47
- name = "bumpalo"
48
- version = "3.16.0"
49
- source = "registry+https://github.com/rust-lang/crates.io-index"
50
- checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c"
51
-
52
52
  [[package]]
53
53
  name = "cexpr"
54
54
  version = "0.6.0"
@@ -75,6 +75,15 @@ dependencies = [
75
75
  "libloading",
76
76
  ]
77
77
 
78
+ [[package]]
79
+ name = "crc32fast"
80
+ version = "1.4.2"
81
+ source = "registry+https://github.com/rust-lang/crates.io-index"
82
+ checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3"
83
+ dependencies = [
84
+ "cfg-if",
85
+ ]
86
+
78
87
  [[package]]
79
88
  name = "csv"
80
89
  version = "1.3.1"
@@ -102,6 +111,16 @@ version = "1.13.0"
102
111
  source = "registry+https://github.com/rust-lang/crates.io-index"
103
112
  checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0"
104
113
 
114
+ [[package]]
115
+ name = "flate2"
116
+ version = "1.0.35"
117
+ source = "registry+https://github.com/rust-lang/crates.io-index"
118
+ checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c"
119
+ dependencies = [
120
+ "crc32fast",
121
+ "miniz_oxide",
122
+ ]
123
+
105
124
  [[package]]
106
125
  name = "futures-core"
107
126
  version = "0.3.31"
@@ -224,6 +243,15 @@ version = "0.2.1"
224
243
  source = "registry+https://github.com/rust-lang/crates.io-index"
225
244
  checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
226
245
 
246
+ [[package]]
247
+ name = "miniz_oxide"
248
+ version = "0.8.2"
249
+ source = "registry+https://github.com/rust-lang/crates.io-index"
250
+ checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394"
251
+ dependencies = [
252
+ "adler2",
253
+ ]
254
+
227
255
  [[package]]
228
256
  name = "nom"
229
257
  version = "7.1.3"
@@ -238,8 +266,8 @@ dependencies = [
238
266
  name = "osv"
239
267
  version = "0.1.0"
240
268
  dependencies = [
241
- "bumpalo",
242
269
  "csv",
270
+ "flate2",
243
271
  "kanal",
244
272
  "magnus 0.7.1",
245
273
  "rb-sys",
data/ext/osv/Cargo.toml CHANGED
@@ -8,9 +8,9 @@ crate-type = ["cdylib"]
8
8
 
9
9
  [dependencies]
10
10
  csv = "^1.3"
11
+ flate2 = "1.0.35"
12
+ kanal = "0.1.0-pre8"
11
13
  magnus = { version = "0.7", features = ["rb-sys"] }
12
14
  rb-sys = "^0.9"
13
15
  serde = { version = "1.0", features = ["derive"] }
14
16
  serde_magnus = "0.8.1"
15
- kanal = "0.1.0-pre8"
16
- bumpalo = { version = "3.16.0", features = ["collections"] }
@@ -3,6 +3,7 @@ use super::{
3
3
  parser::RecordParser,
4
4
  reader::{ReadImpl, RecordReader},
5
5
  };
6
+ use flate2::read::GzDecoder;
6
7
  use magnus::{rb_sys::AsRawValue, value::ReprValue, Error, RString, Ruby, Value};
7
8
  use std::{fs::File, io::Read, marker::PhantomData, os::fd::FromRawFd, thread};
8
9
 
@@ -75,7 +76,12 @@ impl<'a, T: RecordParser + Send + 'static> RecordReaderBuilder<'a, T> {
75
76
  format!("Failed to open file: {e}"),
76
77
  )
77
78
  })?;
78
- Ok(Box::new(file))
79
+ if path.ends_with(".gz") {
80
+ let file = GzDecoder::new(file);
81
+ Ok(Box::new(file))
82
+ } else {
83
+ Ok(Box::new(file))
84
+ }
79
85
  }
80
86
  }
81
87
 
@@ -1,3 +1,11 @@
1
+ /// This module exists to avoid cloning header keys in returned HashMaps.
2
+ /// Since the underlying RString creation already involves cloning,
3
+ /// this caching layer aims to reduce redundant allocations.
4
+ ///
5
+ /// Note: Performance testing on macOS showed minimal speed improvements,
6
+ /// so this optimization could be removed if any issues arise.
7
+
8
+
1
9
  use std::{
2
10
  collections::HashMap,
3
11
  sync::{atomic::AtomicU32, LazyLock, Mutex},
data/lib/osv/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module OSV
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: osv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Jaremko