maxmind-geoip2 0.3.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +35 -0
  3. data/Gemfile +1 -7
  4. data/README.dev.md +1 -1
  5. data/README.md +37 -15
  6. data/lib/maxmind/geoip2/client.rb +48 -26
  7. data/lib/maxmind/geoip2/model/anonymous_ip.rb +8 -0
  8. data/lib/maxmind/geoip2/reader.rb +43 -18
  9. data/lib/maxmind/geoip2/record/traits.rb +12 -3
  10. data/maxmind-geoip2.gemspec +12 -5
  11. data/test/data/bad-data/maxminddb-python/bad-unicode-in-map-key.mmdb +0 -0
  12. data/test/data/source-data/GeoIP2-Anonymous-IP-Test.json +1 -0
  13. data/test/data/source-data/GeoIP2-ISP-Test.json +3 -1
  14. data/test/data/source-data/GeoIP2-Precision-Enterprise-Test.json +87 -0
  15. data/test/data/test-data/GeoIP2-Anonymous-IP-Test.mmdb +0 -0
  16. data/test/data/test-data/GeoIP2-City-Test-Broken-Double-Format.mmdb +0 -0
  17. data/test/data/test-data/GeoIP2-City-Test-Invalid-Node-Count.mmdb +0 -0
  18. data/test/data/test-data/GeoIP2-City-Test.mmdb +0 -0
  19. data/test/data/test-data/GeoIP2-Connection-Type-Test.mmdb +0 -0
  20. data/test/data/test-data/GeoIP2-Country-Test.mmdb +0 -0
  21. data/test/data/test-data/GeoIP2-DensityIncome-Test.mmdb +0 -0
  22. data/test/data/test-data/GeoIP2-Domain-Test.mmdb +0 -0
  23. data/test/data/test-data/GeoIP2-Enterprise-Test.mmdb +0 -0
  24. data/test/data/test-data/GeoIP2-ISP-Test.mmdb +0 -0
  25. data/test/data/test-data/GeoIP2-Precision-Enterprise-Test.mmdb +0 -0
  26. data/test/data/test-data/GeoIP2-Static-IP-Score-Test.mmdb +0 -0
  27. data/test/data/test-data/GeoIP2-User-Count-Test.mmdb +0 -0
  28. data/test/data/test-data/GeoLite2-ASN-Test.mmdb +0 -0
  29. data/test/data/test-data/MaxMind-DB-no-ipv4-search-tree.mmdb +0 -0
  30. data/test/data/test-data/MaxMind-DB-string-value-entries.mmdb +0 -0
  31. data/test/data/test-data/MaxMind-DB-test-broken-pointers-24.mmdb +0 -0
  32. data/test/data/test-data/MaxMind-DB-test-broken-search-tree-24.mmdb +0 -0
  33. data/test/data/test-data/MaxMind-DB-test-decoder.mmdb +0 -0
  34. data/test/data/test-data/MaxMind-DB-test-ipv4-24.mmdb +0 -0
  35. data/test/data/test-data/MaxMind-DB-test-ipv4-28.mmdb +0 -0
  36. data/test/data/test-data/MaxMind-DB-test-ipv4-32.mmdb +0 -0
  37. data/test/data/test-data/MaxMind-DB-test-ipv6-24.mmdb +0 -0
  38. data/test/data/test-data/MaxMind-DB-test-ipv6-28.mmdb +0 -0
  39. data/test/data/test-data/MaxMind-DB-test-ipv6-32.mmdb +0 -0
  40. data/test/data/test-data/MaxMind-DB-test-metadata-pointers.mmdb +0 -0
  41. data/test/data/test-data/MaxMind-DB-test-mixed-24.mmdb +0 -0
  42. data/test/data/test-data/MaxMind-DB-test-mixed-28.mmdb +0 -0
  43. data/test/data/test-data/MaxMind-DB-test-mixed-32.mmdb +0 -0
  44. data/test/data/test-data/MaxMind-DB-test-nested.mmdb +0 -0
  45. data/test/data/test-data/MaxMind-DB-test-pointer-decoder.mmdb +0 -0
  46. data/test/data/test-data/write-test-data.pl +68 -18
  47. data/test/test_client.rb +4 -2
  48. data/test/test_model_country.rb +16 -0
  49. data/test/test_reader.rb +59 -0
  50. metadata +100 -10
  51. data/Gemfile.lock +0 -70
metadata CHANGED
@@ -1,29 +1,49 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maxmind-geoip2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Storey
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-04 00:00:00.000000000 Z
11
+ date: 2021-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: http
14
+ name: connection_pool
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '4.3'
19
+ version: '2.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: http
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '4.3'
34
+ - - "<"
35
+ - !ruby/object:Gem::Version
36
+ version: '6.0'
37
+ type: :runtime
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
25
42
  - !ruby/object:Gem::Version
26
43
  version: '4.3'
44
+ - - "<"
45
+ - !ruby/object:Gem::Version
46
+ version: '6.0'
27
47
  - !ruby/object:Gem::Dependency
28
48
  name: maxmind-db
29
49
  requirement: !ruby/object:Gem::Requirement
@@ -38,6 +58,76 @@ dependencies:
38
58
  - - "~>"
39
59
  - !ruby/object:Gem::Version
40
60
  version: '1.1'
61
+ - !ruby/object:Gem::Dependency
62
+ name: minitest
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ - !ruby/object:Gem::Dependency
76
+ name: rake
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ - !ruby/object:Gem::Dependency
90
+ name: rubocop
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ - !ruby/object:Gem::Dependency
104
+ name: rubocop-performance
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
117
+ - !ruby/object:Gem::Dependency
118
+ name: webmock
119
+ requirement: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: '0'
124
+ type: :development
125
+ prerelease: false
126
+ version_requirements: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - ">="
129
+ - !ruby/object:Gem::Version
130
+ version: '0'
41
131
  description: A gem for interacting with the GeoIP2 webservices and databases. MaxMind
42
132
  provides geolocation data as downloadable databases as well as through a webservice.
43
133
  email: support@maxmind.com
@@ -47,7 +137,6 @@ extra_rdoc_files: []
47
137
  files:
48
138
  - CHANGELOG.md
49
139
  - Gemfile
50
- - Gemfile.lock
51
140
  - LICENSE-APACHE
52
141
  - LICENSE-MIT
53
142
  - README.dev.md
@@ -92,6 +181,7 @@ files:
92
181
  - test/data/bad-data/maxminddb-golang/invalid-string-length.mmdb
93
182
  - test/data/bad-data/maxminddb-golang/metadata-is-an-uint128.mmdb
94
183
  - test/data/bad-data/maxminddb-golang/unexpected-bytes.mmdb
184
+ - test/data/bad-data/maxminddb-python/bad-unicode-in-map-key.mmdb
95
185
  - test/data/perltidyrc
96
186
  - test/data/source-data/GeoIP2-Anonymous-IP-Test.json
97
187
  - test/data/source-data/GeoIP2-City-Test.json
@@ -136,6 +226,7 @@ files:
136
226
  - test/data/test-data/MaxMind-DB-test-mixed-28.mmdb
137
227
  - test/data/test-data/MaxMind-DB-test-mixed-32.mmdb
138
228
  - test/data/test-data/MaxMind-DB-test-nested.mmdb
229
+ - test/data/test-data/MaxMind-DB-test-pointer-decoder.mmdb
139
230
  - test/data/test-data/README.md
140
231
  - test/data/test-data/maps-with-pointers.raw
141
232
  - test/data/test-data/write-test-data.pl
@@ -150,8 +241,8 @@ licenses:
150
241
  - MIT
151
242
  metadata:
152
243
  bug_tracker_uri: https://github.com/maxmind/GeoIP2-ruby/issues
153
- changelog_uri: https://github.com/maxmind/GeoIP2-ruby/blob/master/CHANGELOG.md
154
- documentation_uri: https://github.com/maxmind/GeoIP2-ruby
244
+ changelog_uri: https://github.com/maxmind/GeoIP2-ruby/blob/main/CHANGELOG.md
245
+ documentation_uri: https://www.rubydoc.info/gems/maxmind-geoip2
155
246
  homepage_uri: https://github.com/maxmind/GeoIP2-ruby
156
247
  source_code_uri: https://github.com/maxmind/GeoIP2-ruby
157
248
  post_install_message:
@@ -162,15 +253,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
162
253
  requirements:
163
254
  - - ">="
164
255
  - !ruby/object:Gem::Version
165
- version: 2.4.0
256
+ version: 2.5.0
166
257
  required_rubygems_version: !ruby/object:Gem::Requirement
167
258
  requirements:
168
259
  - - ">="
169
260
  - !ruby/object:Gem::Version
170
261
  version: '0'
171
262
  requirements: []
172
- rubyforge_project:
173
- rubygems_version: 2.7.6
263
+ rubygems_version: 3.2.15
174
264
  signing_key:
175
265
  specification_version: 4
176
266
  summary: A gem for interacting with the GeoIP2 webservices and databases.
data/Gemfile.lock DELETED
@@ -1,70 +0,0 @@
1
- GEM
2
- remote: https://rubygems.org/
3
- specs:
4
- addressable (2.7.0)
5
- public_suffix (>= 2.0.2, < 5.0)
6
- ast (2.4.0)
7
- crack (0.4.3)
8
- safe_yaml (~> 1.0.0)
9
- domain_name (0.5.20190701)
10
- unf (>= 0.0.5, < 1.0.0)
11
- ffi (1.12.2)
12
- ffi-compiler (1.0.1)
13
- ffi (>= 1.0.0)
14
- rake
15
- hashdiff (1.0.1)
16
- http (4.3.0)
17
- addressable (~> 2.3)
18
- http-cookie (~> 1.0)
19
- http-form_data (~> 2.2)
20
- http-parser (~> 1.2.0)
21
- http-cookie (1.0.3)
22
- domain_name (~> 0.5)
23
- http-form_data (2.2.0)
24
- http-parser (1.2.1)
25
- ffi-compiler (>= 1.0, < 2.0)
26
- jaro_winkler (1.5.4)
27
- maxmind-db (1.1.0)
28
- minitest (5.14.0)
29
- parallel (1.19.1)
30
- parser (2.7.0.4)
31
- ast (~> 2.4.0)
32
- public_suffix (4.0.3)
33
- rainbow (3.0.0)
34
- rake (13.0.1)
35
- rexml (3.2.4)
36
- rubocop (0.80.1)
37
- jaro_winkler (~> 1.5.1)
38
- parallel (~> 1.10)
39
- parser (>= 2.7.0.1)
40
- rainbow (>= 2.2.2, < 4.0)
41
- rexml
42
- ruby-progressbar (~> 1.7)
43
- unicode-display_width (>= 1.4.0, < 1.7)
44
- rubocop-performance (1.5.2)
45
- rubocop (>= 0.71.0)
46
- ruby-progressbar (1.10.1)
47
- safe_yaml (1.0.5)
48
- unf (0.1.4)
49
- unf_ext
50
- unf_ext (0.0.7.6)
51
- unicode-display_width (1.6.1)
52
- webmock (3.8.2)
53
- addressable (>= 2.3.6)
54
- crack (>= 0.3.2)
55
- hashdiff (>= 0.4.0, < 2.0.0)
56
-
57
- PLATFORMS
58
- ruby
59
-
60
- DEPENDENCIES
61
- http
62
- maxmind-db
63
- minitest
64
- rake
65
- rubocop
66
- rubocop-performance
67
- webmock
68
-
69
- BUNDLED WITH
70
- 2.1.4