maxmind-db-rust 0.6.0 → 0.8.0
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 +4 -4
- data/CHANGELOG.md +104 -0
- data/CONTRIBUTING.md +32 -14
- data/Cargo.lock +398 -0
- data/Cargo.toml +8 -0
- data/README.md +28 -10
- data/ext/maxmind_db_rust/Cargo.toml +5 -2
- data/ext/maxmind_db_rust/extconf.rb +4 -1
- data/ext/maxmind_db_rust/src/convert.rs +61 -0
- data/ext/maxmind_db_rust/src/gvl.rs +76 -0
- data/ext/maxmind_db_rust/src/initialization.rs +59 -18
- data/ext/maxmind_db_rust/src/lib.rs +2 -0
- data/ext/maxmind_db_rust/src/metadata.rs +35 -2
- data/ext/maxmind_db_rust/src/path.rs +136 -62
- data/ext/maxmind_db_rust/src/reader.rs +1091 -371
- data/lib/maxmind/db/rust.rb +11 -1
- metadata +21 -4
- data/ext/maxmind_db_rust/lib/maxmind/db/rust.rb +0 -16
data/lib/maxmind/db/rust.rb
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require 'ipaddr'
|
|
4
|
-
require '
|
|
4
|
+
require 'rbconfig'
|
|
5
|
+
|
|
6
|
+
# Precompiled gems store the extension under a Ruby version directory. Source
|
|
7
|
+
# builds do not. Fall back only when the versioned file is absent so that a
|
|
8
|
+
# real load failure of that file is not hidden.
|
|
9
|
+
versioned_extension = File.join(__dir__, RUBY_VERSION[/\d+\.\d+/], 'maxmind_db_rust')
|
|
10
|
+
if File.exist?("#{versioned_extension}.#{RbConfig::CONFIG['DLEXT']}")
|
|
11
|
+
require versioned_extension
|
|
12
|
+
else
|
|
13
|
+
require 'maxmind/db/maxmind_db_rust'
|
|
14
|
+
end
|
|
5
15
|
|
|
6
16
|
module MaxMind
|
|
7
17
|
# Check if DB is already defined as a Class (official gem)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: maxmind-db-rust
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.8.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Gregory Oschwald
|
|
@@ -23,6 +23,20 @@ dependencies:
|
|
|
23
23
|
- - "~>"
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
25
|
version: '0.9'
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: bigdecimal
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - "~>"
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '4.0'
|
|
33
|
+
type: :development
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - "~>"
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '4.0'
|
|
26
40
|
- !ruby/object:Gem::Dependency
|
|
27
41
|
name: minitest
|
|
28
42
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -174,12 +188,15 @@ extra_rdoc_files: []
|
|
|
174
188
|
files:
|
|
175
189
|
- CHANGELOG.md
|
|
176
190
|
- CONTRIBUTING.md
|
|
191
|
+
- Cargo.lock
|
|
192
|
+
- Cargo.toml
|
|
177
193
|
- LICENSE
|
|
178
194
|
- README.md
|
|
179
195
|
- ext/maxmind_db_rust/Cargo.toml
|
|
180
196
|
- ext/maxmind_db_rust/extconf.rb
|
|
181
|
-
- ext/maxmind_db_rust/
|
|
197
|
+
- ext/maxmind_db_rust/src/convert.rs
|
|
182
198
|
- ext/maxmind_db_rust/src/decoder.rs
|
|
199
|
+
- ext/maxmind_db_rust/src/gvl.rs
|
|
183
200
|
- ext/maxmind_db_rust/src/initialization.rs
|
|
184
201
|
- ext/maxmind_db_rust/src/lib.rs
|
|
185
202
|
- ext/maxmind_db_rust/src/metadata.rs
|
|
@@ -203,14 +220,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
203
220
|
requirements:
|
|
204
221
|
- - ">="
|
|
205
222
|
- !ruby/object:Gem::Version
|
|
206
|
-
version: '3.
|
|
223
|
+
version: '3.3'
|
|
207
224
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
208
225
|
requirements:
|
|
209
226
|
- - ">="
|
|
210
227
|
- !ruby/object:Gem::Version
|
|
211
228
|
version: '0'
|
|
212
229
|
requirements: []
|
|
213
|
-
rubygems_version: 4.0.
|
|
230
|
+
rubygems_version: 4.0.20
|
|
214
231
|
specification_version: 4
|
|
215
232
|
summary: Unofficial high-performance Rust-based MaxMind DB reader for Ruby
|
|
216
233
|
test_files: []
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'ipaddr'
|
|
4
|
-
require 'maxmind/db/maxmind_db_rust'
|
|
5
|
-
|
|
6
|
-
module MaxMind
|
|
7
|
-
module DB
|
|
8
|
-
module Rust
|
|
9
|
-
# The native extension defines:
|
|
10
|
-
# - Reader class
|
|
11
|
-
# - Metadata class
|
|
12
|
-
# - InvalidDatabaseError exception
|
|
13
|
-
# - MODE_AUTO, MODE_FILE, MODE_MEMORY, MODE_MMAP, MODE_PARAM_IS_BUFFER constants
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|