iptoasn 1.1.0 → 1.2.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 +6 -3
- 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: 35a255d0f44e5d8c30e8b16f43a6827d755efd5d82309cda9097952791acf07b
|
4
|
+
data.tar.gz: b9e5b9bf9d8a908a34fee0f1f8ba67831e170c60ebe85e46a2eb60eed65851a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd0f1ec6eb277b812dcac18db162314481ebd5d9ca49d43ce8ea470152649035478e632267bc3baa96b16df1196930445234d92f178039bca4fd2162a19b23d1
|
7
|
+
data.tar.gz: 1e6e339f59892c5c70b33882d40bbe443b452410a185f4bf51e6a9713fad25b0ad2978a07fa26845657ac1d06aaf554309c0046a746f687046c776fcd082508d
|
data/lib/iptoasn/iptoasn.rb
CHANGED
@@ -3,9 +3,12 @@
|
|
3
3
|
module IpToAsn
|
4
4
|
class Lookup
|
5
5
|
def initialize(db_ip2asn: nil, db_country: nil, db_names: nil) # rubocop:disable Metrics/AbcSize
|
6
|
-
db_ip2asn
|
7
|
-
|
8
|
-
|
6
|
+
if db_ip2asn.nil? || db_country.nil? || db_names.nil?
|
7
|
+
require 'iptoasn/data'
|
8
|
+
db_ip2asn = IpToAsn::Data.ip2asn
|
9
|
+
db_country = IpToAsn::Data.countries
|
10
|
+
db_names = IpToAsn::Data.asnames
|
11
|
+
end
|
9
12
|
|
10
13
|
@db_ip2asn = File.open(db_ip2asn, 'r')
|
11
14
|
@db_country = File.read(db_country)
|
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.2.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-08 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.
|