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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 060a8073660803af80c0e767c46b8e0206ec20b9
4
- data.tar.gz: 6360690707519d82e97f0b6b79d81ca189d05b51
3
+ metadata.gz: 5a6f5ba73422ebfe6973bc700356c193e38c0c9b
4
+ data.tar.gz: 45c7e665af9e5dadf354bb073ae603aa37603252
5
5
  SHA512:
6
- metadata.gz: 51a624b1d899191fbc61bfb76bb75e5d26fb421320bf37a12396661ae85208b33c16be00090228eb7a6d96daf7a5baf59bf81ce2ca4fd3d294d2422a6fc4ff9a
7
- data.tar.gz: 3de3d8614f824ea706a459163fce9019b90d10fbdf825a5a39178c6c91ea2b54034a3e96beaebdfa20b3ccbd81ab392363235d7f823e8f238bf9dccc0eceac9e
6
+ metadata.gz: d61c9dee82554e8b3e5e5c6a373110a46e195c833b523b4d17ddf2bdc66f056b7bc446c8bd3b38fc8296e8ff7d3e429db22873ceee361df6a3a2de007d3a8704
7
+ data.tar.gz: 22d61b2d469069f52dfa11b0dc8e90a13f95f4c9668f06fbcd3df5fa4fc072bef872741480f359037eac98b6a19891c97199aa383ff0cb460dcbd79d94788289
@@ -1,12 +1,13 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - 1.9.3
4
- - 2.0.0
4
+ - 2.0
5
5
  - 2.1
6
6
  - 2.2
7
- - 2.3.0
7
+ - 2.3
8
+ - 2.4
8
9
  - jruby-19mode
9
- - rbx-2
10
+ - rbx
10
11
 
11
12
  script: bundle exec rake
12
13
 
@@ -159,13 +159,13 @@ module MaxMindDB
159
159
 
160
160
  def addr_from_ip(ip)
161
161
  klass = ip.class
162
- if klass == Fixnum || klass == Bignum
163
- ip
164
- else
165
- addr = IPAddr.new(ip)
166
- addr = addr.ipv4_compat if addr.ipv4?
167
- addr.to_i
168
- end
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
@@ -1,3 +1,3 @@
1
1
  module MaxMindDB
2
- VERSION = "0.1.11"
2
+ VERSION = "0.1.12"
3
3
  end
@@ -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 Fixnum' do
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(true)
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.11
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: 2016-03-07 00:00:00.000000000 Z
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.5.1
119
+ rubygems_version: 2.6.8
120
120
  signing_key:
121
121
  specification_version: 4
122
122
  summary: MaxMind DB binary file reader.