geoipdb 0.5.6-java → 0.5.7-java

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 132f6fde9a253cfc08c90276c6ff39a6b03ba48a
4
- data.tar.gz: 8abeb447c126c6011c817a34f6284fea52eb32db
3
+ metadata.gz: 04aed61b867c130f48ebdd7c29b2b3264a58fb4f
4
+ data.tar.gz: bbcfea82ac72215a26f7d9d5e4dabb39644f1999
5
5
  SHA512:
6
- metadata.gz: 70c1b265c2f42c0daf177b6c4f9c47e572f616fdc0ef63a30b558cdc1278d5100504b730770255c6534c250ffce8b567989ee0d5dc41d0740b0863ffd4f0a3df
7
- data.tar.gz: 751b2acfdbaa3864ea689624eab464fed95d2a00cf3dcb731e559f73b89f9c55ff6b5e1b31c8ee3e9ad84ff6fe9738c1068d574b78a078f3be985b801e621b8f
6
+ metadata.gz: 1090dc70e2660b9706ac3fb29376e97403425f9631852f9249576600709b2cf8d6cd943c64b7a33cc12a4ce52aa8c48c18b4b31440aa487446159f08c2b2078f
7
+ data.tar.gz: 87803d3ad3ae4d2bd0daaf59693913ba4b14328fb44140e9ea85e178887d2bc68adaa8ee61ebd767539cddc74b204f85537a74629d0501f7f19b7dcb29865270
@@ -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)
@@ -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"
@@ -1,2 +1 @@
1
- require 'rbconfig'
2
1
  require File.expand_path('../geoipdb.so', __FILE__)
@@ -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: java
6
6
  authors:
7
7
  - LiquidM, Inc.