maxmind-geoip2 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/CHANGELOG.md +10 -0
- data/Gemfile.lock +114 -0
- data/README.dev.md +1 -1
- data/README.md +17 -2
- data/Rakefile +1 -0
- data/lib/maxmind/geoip2/model/anonymous_plus.rb +46 -0
- data/lib/maxmind/geoip2/model/city.rb +1 -1
- data/lib/maxmind/geoip2/reader.rb +26 -1
- data/lib/maxmind/geoip2/record/location.rb +3 -3
- data/lib/maxmind/geoip2/record/traits.rb +1 -1
- data/lib/maxmind/geoip2/version.rb +1 -1
- data/maxmind-geoip2.gemspec +5 -5
- data/test/data/LICENSE-APACHE +202 -0
- data/test/data/LICENSE-MIT +17 -0
- data/test/data/MaxMind-DB-spec.md +1 -2
- data/test/data/README.md +8 -1
- data/test/data/go.mod +1 -1
- data/test/data/pkg/writer/geoip2.go +7 -5
- data/test/data/pkg/writer/maxmind.go +2 -1
- data/test/data/pkg/writer/writer.go +4 -1
- data/test/data/source-data/GeoIP-Anonymous-Plus-Test.json +175 -0
- data/test/data/source-data/GeoIP2-Anonymous-IP-Test.json +6 -0
- data/test/data/source-data/GeoIP2-City-Test.json +73 -7
- data/test/data/source-data/GeoIP2-Country-Test.json +3 -28
- data/test/data/source-data/GeoIP2-Enterprise-Test.json +27 -8
- data/test/data/source-data/GeoIP2-IP-Risk-Test.json +31 -0
- data/test/data/source-data/GeoIP2-Precision-Enterprise-Test.json +585 -11
- data/test/data/source-data/GeoLite2-City-Test.json +0 -3
- data/test/data/source-data/GeoLite2-Country-Test.json +0 -3
- data/test/data/test-data/GeoIP-Anonymous-Plus-Test.mmdb +0 -0
- data/test/data/test-data/GeoIP2-Anonymous-IP-Test.mmdb +0 -0
- data/test/data/test-data/GeoIP2-City-Test.mmdb +0 -0
- data/test/data/test-data/GeoIP2-Connection-Type-Test.mmdb +0 -0
- data/test/data/test-data/GeoIP2-Country-Test.mmdb +0 -0
- data/test/data/test-data/GeoIP2-DensityIncome-Test.mmdb +0 -0
- data/test/data/test-data/GeoIP2-Domain-Test.mmdb +0 -0
- data/test/data/test-data/GeoIP2-Enterprise-Test.mmdb +0 -0
- data/test/data/test-data/GeoIP2-IP-Risk-Test.mmdb +0 -0
- data/test/data/test-data/GeoIP2-ISP-Test.mmdb +0 -0
- data/test/data/test-data/GeoIP2-Precision-Enterprise-Test.mmdb +0 -0
- data/test/data/test-data/GeoIP2-Static-IP-Score-Test.mmdb +0 -0
- data/test/data/test-data/GeoIP2-User-Count-Test.mmdb +0 -0
- data/test/data/test-data/GeoLite2-ASN-Test.mmdb +0 -0
- data/test/data/test-data/GeoLite2-City-Test.mmdb +0 -0
- data/test/data/test-data/GeoLite2-Country-Test.mmdb +0 -0
- data/test/data/test-data/MaxMind-DB-no-ipv4-search-tree.mmdb +0 -0
- data/test/data/test-data/MaxMind-DB-string-value-entries.mmdb +0 -0
- data/test/data/test-data/MaxMind-DB-test-decoder.mmdb +0 -0
- data/test/data/test-data/MaxMind-DB-test-ipv4-24.mmdb +0 -0
- data/test/data/test-data/MaxMind-DB-test-ipv4-28.mmdb +0 -0
- data/test/data/test-data/MaxMind-DB-test-ipv4-32.mmdb +0 -0
- data/test/data/test-data/MaxMind-DB-test-ipv6-24.mmdb +0 -0
- data/test/data/test-data/MaxMind-DB-test-ipv6-28.mmdb +0 -0
- data/test/data/test-data/MaxMind-DB-test-ipv6-32.mmdb +0 -0
- data/test/data/test-data/MaxMind-DB-test-metadata-pointers.mmdb +0 -0
- data/test/data/test-data/MaxMind-DB-test-mixed-24.mmdb +0 -0
- data/test/data/test-data/MaxMind-DB-test-mixed-28.mmdb +0 -0
- data/test/data/test-data/MaxMind-DB-test-mixed-32.mmdb +0 -0
- data/test/data/test-data/MaxMind-DB-test-nested.mmdb +0 -0
- data/test/test_reader.rb +23 -0
- metadata +12 -9
- data/test/data/LICENSE +0 -4
- data/test/data/perltidyrc +0 -18
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/test/test_reader.rb
CHANGED
@@ -37,6 +37,29 @@ class ReaderTest < Minitest::Test
|
|
37
37
|
reader.close
|
38
38
|
end
|
39
39
|
|
40
|
+
def test_anonymous_plus
|
41
|
+
reader = MaxMind::GeoIP2::Reader.new(
|
42
|
+
'test/data/test-data/GeoIP-Anonymous-Plus-Test.mmdb',
|
43
|
+
)
|
44
|
+
ip = '1.2.0.1'
|
45
|
+
record = reader.anonymous_plus(ip)
|
46
|
+
|
47
|
+
assert_equal(30, record.anonymizer_confidence)
|
48
|
+
assert_equal(true, record.anonymous?)
|
49
|
+
assert_equal(true, record.anonymous_vpn?)
|
50
|
+
assert_equal(false, record.hosting_provider?)
|
51
|
+
assert_equal(Date.new(2025, 4, 14), record.network_last_seen)
|
52
|
+
assert_equal('foo', record.provider_name)
|
53
|
+
assert_equal(false, record.public_proxy?)
|
54
|
+
assert_equal(false, record.residential_proxy?)
|
55
|
+
assert_equal(false, record.tor_exit_node?)
|
56
|
+
|
57
|
+
assert_equal(ip, record.ip_address)
|
58
|
+
assert_equal('1.2.0.1/32', record.network)
|
59
|
+
|
60
|
+
reader.close
|
61
|
+
end
|
62
|
+
|
40
63
|
def test_asn
|
41
64
|
reader = MaxMind::GeoIP2::Reader.new(
|
42
65
|
'test/data/test-data/GeoLite2-ASN-Test.mmdb',
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: maxmind-geoip2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Storey
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: connection_pool
|
@@ -137,6 +136,7 @@ extra_rdoc_files: []
|
|
137
136
|
files:
|
138
137
|
- CHANGELOG.md
|
139
138
|
- Gemfile
|
139
|
+
- Gemfile.lock
|
140
140
|
- LICENSE-APACHE
|
141
141
|
- LICENSE-MIT
|
142
142
|
- README.dev.md
|
@@ -147,6 +147,7 @@ files:
|
|
147
147
|
- lib/maxmind/geoip2/errors.rb
|
148
148
|
- lib/maxmind/geoip2/model/abstract.rb
|
149
149
|
- lib/maxmind/geoip2/model/anonymous_ip.rb
|
150
|
+
- lib/maxmind/geoip2/model/anonymous_plus.rb
|
150
151
|
- lib/maxmind/geoip2/model/asn.rb
|
151
152
|
- lib/maxmind/geoip2/model/city.rb
|
152
153
|
- lib/maxmind/geoip2/model/connection_type.rb
|
@@ -169,7 +170,8 @@ files:
|
|
169
170
|
- lib/maxmind/geoip2/record/traits.rb
|
170
171
|
- lib/maxmind/geoip2/version.rb
|
171
172
|
- maxmind-geoip2.gemspec
|
172
|
-
- test/data/LICENSE
|
173
|
+
- test/data/LICENSE-APACHE
|
174
|
+
- test/data/LICENSE-MIT
|
173
175
|
- test/data/MaxMind-DB-spec.md
|
174
176
|
- test/data/README.md
|
175
177
|
- test/data/bad-data/README.md
|
@@ -185,13 +187,13 @@ files:
|
|
185
187
|
- test/data/cmd/write-test-data/main.go
|
186
188
|
- test/data/go.mod
|
187
189
|
- test/data/go.sum
|
188
|
-
- test/data/perltidyrc
|
189
190
|
- test/data/pkg/writer/decoder.go
|
190
191
|
- test/data/pkg/writer/geoip2.go
|
191
192
|
- test/data/pkg/writer/ip.go
|
192
193
|
- test/data/pkg/writer/maxmind.go
|
193
194
|
- test/data/pkg/writer/nestedstructures.go
|
194
195
|
- test/data/pkg/writer/writer.go
|
196
|
+
- test/data/source-data/GeoIP-Anonymous-Plus-Test.json
|
195
197
|
- test/data/source-data/GeoIP2-Anonymous-IP-Test.json
|
196
198
|
- test/data/source-data/GeoIP2-City-Test.json
|
197
199
|
- test/data/source-data/GeoIP2-Connection-Type-Test.json
|
@@ -199,6 +201,7 @@ files:
|
|
199
201
|
- test/data/source-data/GeoIP2-DensityIncome-Test.json
|
200
202
|
- test/data/source-data/GeoIP2-Domain-Test.json
|
201
203
|
- test/data/source-data/GeoIP2-Enterprise-Test.json
|
204
|
+
- test/data/source-data/GeoIP2-IP-Risk-Test.json
|
202
205
|
- test/data/source-data/GeoIP2-ISP-Test.json
|
203
206
|
- test/data/source-data/GeoIP2-Precision-Enterprise-Sandbox-Test.json
|
204
207
|
- test/data/source-data/GeoIP2-Precision-Enterprise-Test.json
|
@@ -207,6 +210,7 @@ files:
|
|
207
210
|
- test/data/source-data/GeoLite2-ASN-Test.json
|
208
211
|
- test/data/source-data/GeoLite2-City-Test.json
|
209
212
|
- test/data/source-data/GeoLite2-Country-Test.json
|
213
|
+
- test/data/test-data/GeoIP-Anonymous-Plus-Test.mmdb
|
210
214
|
- test/data/test-data/GeoIP2-Anonymous-IP-Test.mmdb
|
211
215
|
- test/data/test-data/GeoIP2-City-Test-Broken-Double-Format.mmdb
|
212
216
|
- test/data/test-data/GeoIP2-City-Test-Invalid-Node-Count.mmdb
|
@@ -216,6 +220,7 @@ files:
|
|
216
220
|
- test/data/test-data/GeoIP2-DensityIncome-Test.mmdb
|
217
221
|
- test/data/test-data/GeoIP2-Domain-Test.mmdb
|
218
222
|
- test/data/test-data/GeoIP2-Enterprise-Test.mmdb
|
223
|
+
- test/data/test-data/GeoIP2-IP-Risk-Test.mmdb
|
219
224
|
- test/data/test-data/GeoIP2-ISP-Test.mmdb
|
220
225
|
- test/data/test-data/GeoIP2-Precision-Enterprise-Test.mmdb
|
221
226
|
- test/data/test-data/GeoIP2-Static-IP-Score-Test.mmdb
|
@@ -258,7 +263,6 @@ metadata:
|
|
258
263
|
homepage_uri: https://github.com/maxmind/GeoIP2-ruby
|
259
264
|
rubygems_mfa_required: 'true'
|
260
265
|
source_code_uri: https://github.com/maxmind/GeoIP2-ruby
|
261
|
-
post_install_message:
|
262
266
|
rdoc_options: []
|
263
267
|
require_paths:
|
264
268
|
- lib
|
@@ -266,15 +270,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
266
270
|
requirements:
|
267
271
|
- - ">="
|
268
272
|
- !ruby/object:Gem::Version
|
269
|
-
version:
|
273
|
+
version: '3.0'
|
270
274
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
271
275
|
requirements:
|
272
276
|
- - ">="
|
273
277
|
- !ruby/object:Gem::Version
|
274
278
|
version: '0'
|
275
279
|
requirements: []
|
276
|
-
rubygems_version: 3.
|
277
|
-
signing_key:
|
280
|
+
rubygems_version: 3.6.7
|
278
281
|
specification_version: 4
|
279
282
|
summary: A gem for interacting with the GeoIP2 webservices and databases.
|
280
283
|
test_files: []
|
data/test/data/LICENSE
DELETED
@@ -1,4 +0,0 @@
|
|
1
|
-
This work is licensed under the Creative Commons Attribution-ShareAlike 3.0
|
2
|
-
Unported License. To view a copy of this license, visit
|
3
|
-
http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative
|
4
|
-
Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.
|
data/test/data/perltidyrc
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
--blank-lines-before-packages=0
|
2
|
-
--iterations=2
|
3
|
-
--no-outdent-long-comments
|
4
|
-
--weld-nested-containers
|
5
|
-
-b
|
6
|
-
-bar
|
7
|
-
-boc
|
8
|
-
-ci=4
|
9
|
-
-i=4
|
10
|
-
-l=78
|
11
|
-
-nolq
|
12
|
-
-se
|
13
|
-
-wbb="% + - * / x != == >= <= =~ !~ < > | & >= < = **= += *= &= <<= &&= -= /= |= >>= ||= .= %= ^= x="
|
14
|
-
--character-encoding=utf8
|
15
|
-
--valign-exclusion-list="q"
|
16
|
-
--want-trailing-commas=m
|
17
|
-
--add-trailing-commas
|
18
|
-
--delete-repeated-commas
|