maxminddb 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/maxminddb/result.rb +4 -0
- data/lib/maxminddb/version.rb +1 -1
- data/spec/maxminddb/result_spec.rb +19 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90230fd8cd541962af966e81554cb3cda637cb81
|
4
|
+
data.tar.gz: 6c4ce02d833d223f205b360d4d3456bbab02759b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 584fea3d8f68cd1a93bb63eb53d4167bfad0564b2c5df88513d44887aa603c89eb406dfdc5440a60ddfe9046c6b4c069fa1cdb88b6b5144b9f2e33686838e90f
|
7
|
+
data.tar.gz: 594c12759914f798db59c7fe2d30c1933bcdc9986b361c0b563487c517000a493ad80d735d801bcaf4b62f58d3a7d5171e7469f73834b353e1a43dafe7e05c2f
|
data/lib/maxminddb/result.rb
CHANGED
@@ -40,6 +40,10 @@ module MaxMindDB
|
|
40
40
|
@_registered_country ||= NamedLocation.new(raw['registered_country'])
|
41
41
|
end
|
42
42
|
|
43
|
+
def represented_country
|
44
|
+
@_represented_country ||= NamedLocation.new(raw['represented_country'])
|
45
|
+
end
|
46
|
+
|
43
47
|
def subdivisions
|
44
48
|
@_subdivisions ||= Array(raw['subdivisions']).map { |hash| NamedLocation.new(hash) }
|
45
49
|
end
|
data/lib/maxminddb/version.rb
CHANGED
@@ -32,6 +32,11 @@ describe MaxMindDB::Result do
|
|
32
32
|
"iso_code"=>"US",
|
33
33
|
"names"=>{"de"=>"USA", "en"=>"United States", "es"=>"Estados Unidos", "fr"=>"États-Unis", "ja"=>"アメリカ合衆国", "pt-BR"=>"Estados Unidos", "ru"=>"США", "zh-CN"=>"美国"}
|
34
34
|
},
|
35
|
+
"represented_country"=>{
|
36
|
+
"geoname_id"=>6252001,
|
37
|
+
"iso_code"=>"US",
|
38
|
+
"names"=>{"de"=>"USA", "en"=>"United States", "es"=>"Estados Unidos", "fr"=>"États-Unis", "ja"=>"アメリカ合衆国", "pt-BR"=>"Estados Unidos", "ru"=>"США", "zh-CN"=>"美国"}
|
39
|
+
},
|
35
40
|
"subdivisions"=>[
|
36
41
|
{
|
37
42
|
"geoname_id"=>5332921,
|
@@ -187,6 +192,20 @@ describe MaxMindDB::Result do
|
|
187
192
|
end
|
188
193
|
end
|
189
194
|
|
195
|
+
describe '#represented_country' do
|
196
|
+
context 'with a result' do
|
197
|
+
it 'should be a kind of MaxMindDB::Result::NamedLocation' do
|
198
|
+
expect(result.represented_country).to be_kind_of(MaxMindDB::Result::NamedLocation)
|
199
|
+
end
|
200
|
+
|
201
|
+
it 'should initialize the location with the represented_country attributes' do
|
202
|
+
expect(MaxMindDB::Result::NamedLocation).to receive(:new).with(raw_result['represented_country'])
|
203
|
+
|
204
|
+
result.represented_country
|
205
|
+
end
|
206
|
+
end
|
207
|
+
end
|
208
|
+
|
190
209
|
describe '#subdivisions' do
|
191
210
|
context 'with a result' do
|
192
211
|
it 'should be a kind of Array' do
|
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.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yhirose
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -113,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
113
113
|
version: '0'
|
114
114
|
requirements: []
|
115
115
|
rubyforge_project:
|
116
|
-
rubygems_version: 2.
|
116
|
+
rubygems_version: 2.4.2
|
117
117
|
signing_key:
|
118
118
|
specification_version: 4
|
119
119
|
summary: MaxMind DB binary file reader.
|