maxminddb 0.1.15 → 0.1.16
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 +4 -0
- data/README.md +4 -0
- data/lib/maxminddb/result/named_location.rb +4 -0
- data/lib/maxminddb/version.rb +1 -1
- data/spec/maxminddb_spec.rb +11 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de3d917a3dc6c98952db3093c0b757f0118e214f
|
4
|
+
data.tar.gz: 825e4a603556972cb5455530b8961bdf55a3d9fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa879149d7c2a6ed871bcf35a460b02267147a00a64f1c9c3facc5f8b1876aedeccb5cb1ab186e20c220906a051678736c1a5c429048b49fe907c4dfb07f8666
|
7
|
+
data.tar.gz: 3a7b04887875dad51eda9a3f1e670df59de0fe6d55a1bb823011214a4e098e7225c84726068e785dbb208e3defcff911418463de0f93cc3901844f3be5e331f2
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -39,6 +39,7 @@ ret.country.name # => 'United States'
|
|
39
39
|
ret.country.name('zh-CN') # => '美国'
|
40
40
|
ret.country.iso_code # => 'US'
|
41
41
|
ret.city.name(:fr) # => 'Mountain View'
|
42
|
+
ret.subdivisions.most_specific.name # => 'California'
|
42
43
|
ret.location.latitude # => -122.0574
|
43
44
|
ret.to_hash # => {"city"=>{"geoname_id"=>5375480, "names"=>{"de"=>"Mountain View", "en"=>"Mountain View", "fr"=>"Mountain View", "ja"=>"マウンテンビュー", "ru"=>"Маунтин-Вью", "zh-CN"=>"芒廷维尤"}}, "continent"=>{"code"=>"NA", "geoname_id"=>6255149, "names"=>{"de"=>"Nordamerika", "en"=>"North America", "es"=>"Norteamérica", "fr"=>"Amérique du Nord", "ja"=>"北アメリカ", "pt-BR"=>"América do Norte", "ru"=>"Северная Америка", "zh-CN"=>"北美洲"}}, "country"=>{"geoname_id"=>6252001, "iso_code"=>"US", "names"=>{"de"=>"USA", "en"=>"United States", "es"=>"Estados Unidos", "fr"=>"États-Unis", "ja"=>"アメリカ合衆国", "pt-BR"=>"Estados Unidos", "ru"=>"Сша", "zh-CN"=>"美国"}}, "location"=>{"latitude"=>37.419200000000004, "longitude"=>-122.0574, "metro_code"=>807, "time_zone"=>"America/Los_Angeles"}, "postal"=>{"code"=>"94043"}, "registered_country"=>{"geoname_id"=>6252001, "iso_code"=>"US", "names"=>{"de"=>"USA", "en"=>"United States", "es"=>"Estados Unidos", "fr"=>"États-Unis", "ja"=>"アメリカ合衆国", "pt-BR"=>"Estados Unidos", "ru"=>"Сша", "zh-CN"=>"美国"}}, "subdivisions"=>[{"geoname_id"=>5332921, "iso_code"=>"CA", "names"=>{"de"=>"Kalifornien", "en"=>"California", "es"=>"California", "fr"=>"Californie", "ja"=>"カリフォルニア州", "pt-BR"=>"Califórnia", "ru"=>"Калифорния", "zh-CN"=>"加利福尼亚州"}}]}
|
44
45
|
```
|
@@ -61,6 +62,9 @@ db.metadata['build_epoch'] # => 1493762948
|
|
61
62
|
db.metadata # => {"binary_format_major_version"=>2, "binary_format_minor_version"=>0, "build_epoch"=>1493762948, "database_type"=>"GeoLite2-City", "description"=>{"en"=>"GeoLite2 City database"}, "ip_version"=>6, "languages"=>["de", "en", "es", "fr", "ja", "pt-BR", "ru", "zh-CN"], "node_count"=>3678850, "record_size"=>28}
|
62
63
|
```
|
63
64
|
|
65
|
+
### Regarding thread safety
|
66
|
+
|
67
|
+
A MaxMindDB instance doesn't do any write operation after it is created. So we can consider it as an immutable object which is 'thread-safe'.
|
64
68
|
|
65
69
|
## Contributing
|
66
70
|
|
data/lib/maxminddb/version.rb
CHANGED
data/spec/maxminddb_spec.rb
CHANGED
@@ -17,11 +17,11 @@ describe MaxMindDB do
|
|
17
17
|
end
|
18
18
|
|
19
19
|
it 'returns Mountain View as the English name' do
|
20
|
-
expect(city_db.lookup(ip).city.name).to eq('
|
20
|
+
expect(city_db.lookup(ip).city.name).to eq('Alameda')
|
21
21
|
end
|
22
22
|
|
23
23
|
it 'returns -122.0574 as the longitude' do
|
24
|
-
expect(city_db.lookup(ip).location.longitude).to eq(-122.
|
24
|
+
expect(city_db.lookup(ip).location.longitude).to eq(-122.2788)
|
25
25
|
end
|
26
26
|
|
27
27
|
it 'returns nil for is_anonymous_proxy' do
|
@@ -32,6 +32,10 @@ describe MaxMindDB do
|
|
32
32
|
expect(country_db.lookup(ip).country.name).to eq('United States')
|
33
33
|
end
|
34
34
|
|
35
|
+
it 'returns false for the is_in_european_union' do
|
36
|
+
expect(country_db.lookup(ip).country.is_in_european_union).to eq(nil)
|
37
|
+
end
|
38
|
+
|
35
39
|
it 'returns US as the country iso code' do
|
36
40
|
expect(country_db.lookup(ip).country.iso_code).to eq('US')
|
37
41
|
end
|
@@ -44,7 +48,7 @@ describe MaxMindDB do
|
|
44
48
|
end
|
45
49
|
|
46
50
|
it 'returns Mountain View as the English name' do
|
47
|
-
expect(city_db.lookup(integer_ip).city.name).to eq('
|
51
|
+
expect(city_db.lookup(integer_ip).city.name).to eq('Alameda')
|
48
52
|
end
|
49
53
|
|
50
54
|
it 'returns United States as the English country name' do
|
@@ -60,6 +64,10 @@ describe MaxMindDB do
|
|
60
64
|
expect(city_db.lookup(ip)).to be_found
|
61
65
|
end
|
62
66
|
|
67
|
+
it 'returns false for the is_in_european_union' do
|
68
|
+
expect(country_db.lookup(ip).country.is_in_european_union).to eq(true)
|
69
|
+
end
|
70
|
+
|
63
71
|
it 'returns FI as the country iso code' do
|
64
72
|
expect(country_db.lookup(ip).country.iso_code).to eq('FI')
|
65
73
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: maxminddb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yhirose
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|