geoip 0.8.7 → 0.8.8
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.
- data/lib/geoip.rb +2 -2
- metadata +25 -9
data/lib/geoip.rb
CHANGED
|
@@ -50,7 +50,7 @@ rescue LoadError
|
|
|
50
50
|
end
|
|
51
51
|
|
|
52
52
|
class GeoIP
|
|
53
|
-
VERSION = "0.8.
|
|
53
|
+
VERSION = "0.8.8"
|
|
54
54
|
private
|
|
55
55
|
CountryCode = [
|
|
56
56
|
"--","AP","EU","AD","AE","AF","AG","AI","AL","AM","AN",
|
|
@@ -669,7 +669,7 @@ class GeoIP
|
|
|
669
669
|
@file = File.open(filename, 'rb')
|
|
670
670
|
@file.seek(-3, IO::SEEK_END)
|
|
671
671
|
0.upto(STRUCTURE_INFO_MAX_SIZE-1) { |i|
|
|
672
|
-
if @file.read(3) ==
|
|
672
|
+
if @file.read(3).bytes.all?{|byte| 255 == byte}
|
|
673
673
|
@databaseType = @file.respond_to?(:getbyte) ? @file.getbyte : @file.getc
|
|
674
674
|
@databaseType -= 105 if @databaseType >= 106
|
|
675
675
|
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: geoip
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 47
|
|
5
5
|
prerelease: false
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 8
|
|
9
|
-
-
|
|
10
|
-
version: 0.8.
|
|
9
|
+
- 8
|
|
10
|
+
version: 0.8.8
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Clifford Heath
|
|
@@ -16,25 +16,41 @@ autorequire:
|
|
|
16
16
|
bindir: bin
|
|
17
17
|
cert_chain: []
|
|
18
18
|
|
|
19
|
-
date: 2010-
|
|
19
|
+
date: 2010-12-23 00:00:00 +11:00
|
|
20
20
|
default_executable:
|
|
21
21
|
dependencies:
|
|
22
22
|
- !ruby/object:Gem::Dependency
|
|
23
|
-
name:
|
|
23
|
+
name: rubyforge
|
|
24
24
|
prerelease: false
|
|
25
25
|
requirement: &id001 !ruby/object:Gem::Requirement
|
|
26
26
|
none: false
|
|
27
27
|
requirements:
|
|
28
28
|
- - ">="
|
|
29
29
|
- !ruby/object:Gem::Version
|
|
30
|
-
hash:
|
|
30
|
+
hash: 7
|
|
31
31
|
segments:
|
|
32
32
|
- 2
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
version: 2.
|
|
33
|
+
- 0
|
|
34
|
+
- 4
|
|
35
|
+
version: 2.0.4
|
|
36
36
|
type: :development
|
|
37
37
|
version_requirements: *id001
|
|
38
|
+
- !ruby/object:Gem::Dependency
|
|
39
|
+
name: hoe
|
|
40
|
+
prerelease: false
|
|
41
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
|
42
|
+
none: false
|
|
43
|
+
requirements:
|
|
44
|
+
- - ">="
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
hash: 19
|
|
47
|
+
segments:
|
|
48
|
+
- 2
|
|
49
|
+
- 6
|
|
50
|
+
- 2
|
|
51
|
+
version: 2.6.2
|
|
52
|
+
type: :development
|
|
53
|
+
version_requirements: *id002
|
|
38
54
|
description: |-
|
|
39
55
|
GeoIP searches a GeoIP database for a given host or IP address, and
|
|
40
56
|
returns information about the country where the IP address is allocated,
|