maxminddb 0.1.11 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -3
- data/lib/maxminddb.rb +7 -7
- data/lib/maxminddb/version.rb +1 -1
- data/spec/maxminddb_spec.rb +2 -2
- 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: 5a6f5ba73422ebfe6973bc700356c193e38c0c9b
|
4
|
+
data.tar.gz: 45c7e665af9e5dadf354bb073ae603aa37603252
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d61c9dee82554e8b3e5e5c6a373110a46e195c833b523b4d17ddf2bdc66f056b7bc446c8bd3b38fc8296e8ff7d3e429db22873ceee361df6a3a2de007d3a8704
|
7
|
+
data.tar.gz: 22d61b2d469069f52dfa11b0dc8e90a13f95f4c9668f06fbcd3df5fa4fc072bef872741480f359037eac98b6a19891c97199aa383ff0cb460dcbd79d94788289
|
data/.travis.yml
CHANGED
data/lib/maxminddb.rb
CHANGED
@@ -159,13 +159,13 @@ module MaxMindDB
|
|
159
159
|
|
160
160
|
def addr_from_ip(ip)
|
161
161
|
klass = ip.class
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
162
|
+
|
163
|
+
return ip if RUBY_VERSION.to_f < 2.4 && (klass == Fixnum || klass == Bignum)
|
164
|
+
return ip if RUBY_VERSION.to_f >= 2.4 && klass == Integer
|
165
|
+
|
166
|
+
addr = IPAddr.new(ip)
|
167
|
+
addr = addr.ipv4_compat if addr.ipv4?
|
168
|
+
addr.to_i
|
169
169
|
end
|
170
170
|
end
|
171
171
|
end
|
data/lib/maxminddb/version.rb
CHANGED
data/spec/maxminddb_spec.rb
CHANGED
@@ -36,7 +36,7 @@ describe MaxMindDB do
|
|
36
36
|
expect(country_db.lookup(ip).country.iso_code).to eq('US')
|
37
37
|
end
|
38
38
|
|
39
|
-
context 'as a
|
39
|
+
context 'as a Integer' do
|
40
40
|
let(:integer_ip) { IPAddr.new(ip).to_i }
|
41
41
|
|
42
42
|
it 'returns a MaxMindDB::Result' do
|
@@ -117,7 +117,7 @@ describe MaxMindDB do
|
|
117
117
|
let(:ip) { '41.194.0.1' }
|
118
118
|
|
119
119
|
it 'returns true for the is_satellite_provider trait' do
|
120
|
-
expect(city_db.lookup(ip).traits.is_satellite_provider).to eq(
|
120
|
+
expect(city_db.lookup(ip).traits.is_satellite_provider).to eq(nil)
|
121
121
|
end
|
122
122
|
|
123
123
|
# There are no false booleans in the database that we can test.
|
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.12
|
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: 2017-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
116
|
version: '0'
|
117
117
|
requirements: []
|
118
118
|
rubyforge_project:
|
119
|
-
rubygems_version: 2.
|
119
|
+
rubygems_version: 2.6.8
|
120
120
|
signing_key:
|
121
121
|
specification_version: 4
|
122
122
|
summary: MaxMind DB binary file reader.
|