iptoasn 1.2.0 → 1.3.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/lib/iptoasn/iptoasn.rb +4 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a30920b9c52f4805314a9d3572f8a3a8b5152b9d8f9b610172e9e8a78b40b31b
|
4
|
+
data.tar.gz: 448626dfaa1ff8c0ca1d20f23a4389ec6596c4e7a0b1e692b427a4f0477acf66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7708e778a762e03e6e0fa774a029a69c242389e7a945811d97aafcfa0026bb7e66772341a96abdc7897daff622d9bd638126446e956c428621bccc15b8310f48
|
7
|
+
data.tar.gz: 9d10f6ed471ae834ef7f529784c9a36f641528e8fa1a2da8a40684208c477267ff29a7b5d075dd8491c1b95d55774fb97365e260889a6c1f282c6d9953e60575
|
data/lib/iptoasn/iptoasn.rb
CHANGED
@@ -27,6 +27,7 @@ module IpToAsn
|
|
27
27
|
@db_ip2asn.seek(0, IO::SEEK_END)
|
28
28
|
@db_total_entries = @db_ip2asn.size / @entry_size
|
29
29
|
@db_ip2asn.seek(0)
|
30
|
+
@mutex = Mutex.new
|
30
31
|
end
|
31
32
|
|
32
33
|
def ip_to_int(ip)
|
@@ -50,7 +51,9 @@ module IpToAsn
|
|
50
51
|
|
51
52
|
return { as_number: 0, country_code: 'XX', as_name: reserved_range_name } unless reserved_range_name.nil?
|
52
53
|
|
53
|
-
|
54
|
+
@mutex.synchronize do
|
55
|
+
search_db(ip)
|
56
|
+
end
|
54
57
|
end
|
55
58
|
|
56
59
|
def search_db(ip) # rubocop:disable Metrics/AbcSize
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iptoasn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OMAR
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-02-
|
11
|
+
date: 2025-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: This gem wraps the IP to ASN dataset. It uses lazy loading so it doesn't
|
14
14
|
load the entire ~25M dataset all at once.
|