geoipdb 0.5.6 → 0.5.7

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: bd4014a1f5219ad80dcc4edf0f2676cfe6a25c15
4
- data.tar.gz: 9023e01afee88c14087ce533ba53a835db050153
3
+ metadata.gz: d6346f44fdad8a9c40860fef386280a5e6d0310b
4
+ data.tar.gz: b83da9ad90a5c1f29ef08f33cfc274caf4231cdf
5
5
  SHA512:
6
- metadata.gz: 051bf0ed38ea950a7ac3d738cbbce26f5dfa13d748c5d56a80676124ac8c82c950265bc937cffafcb615c84bc8a096aca2225ffa2625d14927a878ad8d822431
7
- data.tar.gz: a86a82c253f1f1521adfc046765d3b3b6b57dec78ee9990d8f8666534c9db82a0faf99da8bdb58720cd2b4ce1802e74e38a72db2325859bfa03e68e3f01ae1c6
6
+ metadata.gz: ee363cdee0f01b932afd3b652ca880d57d8f7be829bbb10ef714f0bd9ce632b88c7473328b85d4d9f1a267b62806d57ae003a21f8cb6c932df344752b3aa57b0
7
+ data.tar.gz: 36cd22d6292ceee0eda0849eb7159b5fc26a9a969fb28df5b0bb5418baf16547504a60e1d5c43e3cebe9b336527461d6ee57b33ca379f090aeb05bcd2b311063
@@ -74,7 +74,7 @@ VALUE build_ip_information_object(IpRange *range, City *city, char* isp) {
74
74
  rb_ivar_set(ip_information, rb_intern("@lng"), rb_float_new(city->lng) );
75
75
  rb_ivar_set(ip_information, rb_intern("@lat"), rb_float_new(city->lat) );
76
76
  rb_ivar_set(ip_information, rb_intern("@is_mobile"), range->is_mobile == 1 ? Qtrue : Qfalse );
77
- rb_ivar_set(ip_information, rb_intern("@isp_name"), isp == NULL || strcmp(isp, "?") == 0 ? Qnil : ID2SYM( rb_intern(isp) ) );
77
+ rb_ivar_set(ip_information, rb_intern("@isp_name"), isp == NULL ? Qnil : ID2SYM( rb_intern(isp) ) );
78
78
 
79
79
  return ip_information;
80
80
  }
@@ -12,11 +12,8 @@ public class IpRange implements Comparable<IpRange>
12
12
  this.to = ipToLong(rangeValues[1]);
13
13
  this.isMobile = conTypeToBool(rangeValues[2]);
14
14
  this.cityCode = Integer.parseInt(rangeValues[3]);
15
-
16
- if (!rangeValues[4].equals("?")) {
17
- // Use only the first 100 chars to be compliant with the c implementation
18
- this.ispName = rangeValues[4].length() > 100 ? rangeValues[4].substring(0, 100) : rangeValues[4];
19
- }
15
+ // Use only the first 100 chars to be compliant with the c implementation
16
+ this.ispName = rangeValues[4].length() > 100 ? rangeValues[4].substring(0, 100) : rangeValues[4];
20
17
  }
21
18
 
22
19
  public IpRange(String from, String to)
data/geoipdb.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "geoipdb"
5
- spec.version = "0.5.6"
5
+ spec.version = "0.5.7"
6
6
  spec.authors = ["LiquidM, Inc."]
7
7
  spec.email = ["opensource@liquidm.com"]
8
8
  spec.description = "Fast GeoIpDb implementation for Ruby"
data/lib/cgeoipdb.rb CHANGED
@@ -1,2 +1 @@
1
- require 'rbconfig'
2
1
  require File.expand_path('../geoipdb.so', __FILE__)
data/lib/jgeoipdb.rb CHANGED
@@ -1,4 +1,3 @@
1
- require 'rbconfig'
2
1
  require 'java'
3
2
  require File.expand_path('../geoipdb.jar', __FILE__)
4
3
 
@@ -6,7 +5,7 @@ class GeoIpDb
6
5
 
7
6
  def self.init(cities_file, ranges_file, cache_file)
8
7
  self.new(cities_file, ranges_file, cache_file)
9
- rescue java.io.FileNotFoundException => e
8
+ rescue java.io.FileNotFoundException
10
9
  return nil
11
10
  end
12
11
 
@@ -35,7 +34,7 @@ class GeoIpDb
35
34
  info.lng = city.lng
36
35
  info.lat = city.lat
37
36
  info.is_mobile = range.is_mobile
38
- info.isp_name = isp ? isp.to_sym : :"?"
37
+ info.isp_name = isp && isp.to_sym
39
38
  info
40
39
  end
41
40
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geoipdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - LiquidM, Inc.