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 +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: d6346f44fdad8a9c40860fef386280a5e6d0310b
|
4
|
+
data.tar.gz: b83da9ad90a5c1f29ef08f33cfc274caf4231cdf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee363cdee0f01b932afd3b652ca880d57d8f7be829bbb10ef714f0bd9ce632b88c7473328b85d4d9f1a267b62806d57ae003a21f8cb6c932df344752b3aa57b0
|
7
|
+
data.tar.gz: 36cd22d6292ceee0eda0849eb7159b5fc26a9a969fb28df5b0bb5418baf16547504a60e1d5c43e3cebe9b336527461d6ee57b33ca379f090aeb05bcd2b311063
|
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
|
|