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 +4 -4
- data/ext/geoipdb/geoipdb.c +1 -1
- data/ext/geoipdb/src/IpRange.java +2 -5
- data/geoipdb.gemspec +1 -1
- data/lib/cgeoipdb.rb +0 -1
- data/lib/jgeoipdb.rb +2 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04aed61b867c130f48ebdd7c29b2b3264a58fb4f
|
4
|
+
data.tar.gz: bbcfea82ac72215a26f7d9d5e4dabb39644f1999
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1090dc70e2660b9706ac3fb29376e97403425f9631852f9249576600709b2cf8d6cd943c64b7a33cc12a4ce52aa8c48c18b4b31440aa487446159f08c2b2078f
|
7
|
+
data.tar.gz: 87803d3ad3ae4d2bd0daaf59693913ba4b14328fb44140e9ea85e178887d2bc68adaa8ee61ebd767539cddc74b204f85537a74629d0501f7f19b7dcb29865270
|
data/ext/geoipdb/geoipdb.c
CHANGED
@@ -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
|
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
|
-
|
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
data/lib/cgeoipdb.rb
CHANGED
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
|
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
|
37
|
+
info.isp_name = isp && isp.to_sym
|
39
38
|
info
|
40
39
|
end
|
41
40
|
|