geoip 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/geoip.rb +10 -11
- metadata +22 -20
data/lib/geoip.rb
CHANGED
@@ -104,8 +104,8 @@ class GeoIP
|
|
104
104
|
"Germany","Djibouti","Denmark","Dominica","Dominican Republic",
|
105
105
|
"Algeria","Ecuador","Estonia","Egypt","Western Sahara","Eritrea",
|
106
106
|
"Spain","Ethiopia","Finland","Fiji","Falkland Islands (Malvinas)",
|
107
|
-
"Micronesia, Federated States of","Faroe Islands","France",
|
108
|
-
Metropolitan","Gabon","United Kingdom","Grenada","Georgia",
|
107
|
+
"Micronesia, Federated States of","Faroe Islands","France",
|
108
|
+
"France, Metropolitan","Gabon","United Kingdom","Grenada","Georgia",
|
109
109
|
"French Guiana","Ghana","Gibraltar","Greenland","Gambia","Guinea",
|
110
110
|
"Guadeloupe","Equatorial Guinea","Greece",
|
111
111
|
"South Georgia and the South Sandwich Islands","Guatemala","Guam",
|
@@ -140,10 +140,11 @@ class GeoIP
|
|
140
140
|
"Trinidad and Tobago","Tuvalu","Taiwan","Tanzania, United Republic of",
|
141
141
|
"Ukraine","Uganda","United States Minor Outlying Islands",
|
142
142
|
"United States","Uruguay","Uzbekistan","Holy See (Vatican City State)",
|
143
|
-
"Saint Vincent and the Grenadines","Venezuela",
|
144
|
-
British","Virgin Islands, U.S.","Vietnam","Vanuatu",
|
145
|
-
"Samoa","Yemen","Mayotte","Yugoslavia",
|
146
|
-
"
|
143
|
+
"Saint Vincent and the Grenadines","Venezuela",
|
144
|
+
"Virgin Islands, British","Virgin Islands, U.S.","Vietnam","Vanuatu",
|
145
|
+
"Wallis and Futuna", "Samoa","Yemen","Mayotte","Yugoslavia",
|
146
|
+
"South Africa","Zambia","Zaire", "Zimbabwe","Anonymous Proxy",
|
147
|
+
"Satellite Provider","Other"]
|
147
148
|
|
148
149
|
CountryContinent = [
|
149
150
|
"--","AS","EU","EU","AS","AS","SA","SA","EU","AS","SA","AF","AN","SA",
|
@@ -211,10 +212,6 @@ class GeoIP
|
|
211
212
|
@databaseType = @file.getc
|
212
213
|
@databaseType -= 105 if @databaseType >= 106
|
213
214
|
|
214
|
-
if (@databaseType != GEOIP_CITY_EDITION_REV0)
|
215
|
-
puts "Old database file type #{@databaseType}, untested"
|
216
|
-
end
|
217
|
-
|
218
215
|
if (@databaseType == GEOIP_REGION_EDITION_REV0)
|
219
216
|
# Region Edition, pre June 2003
|
220
217
|
@databaseSegments = [ STATE_BEGIN_REV0 ]
|
@@ -439,7 +436,9 @@ public
|
|
439
436
|
end
|
440
437
|
|
441
438
|
if $0 == __FILE__
|
442
|
-
|
439
|
+
data = '/usr/share/GeoIP/GeoIP.dat'
|
440
|
+
data = ARGV.shift if ARGV[0] =~ /\.dat\Z/
|
441
|
+
g = GeoIP.new data
|
443
442
|
|
444
443
|
req = ([GeoIP::GEOIP_CITY_EDITION_REV1, GeoIP::GEOIP_CITY_EDITION_REV0].include?(g.databaseType)) ? :city : :country
|
445
444
|
ARGV.each { |a|
|
metadata
CHANGED
@@ -1,44 +1,46 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.
|
2
|
+
rubygems_version: 0.9.2
|
3
3
|
specification_version: 1
|
4
4
|
name: geoip
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.
|
7
|
-
date:
|
8
|
-
summary:
|
9
|
-
or Internet hostname. The free version of the GeoIP database available from
|
10
|
-
www.maxmind.com only contains country information. This library supports that
|
11
|
-
and the GeoIPCity file (both revisions). The data is much more reliable than
|
12
|
-
using the country codes at the end of the hosts' domain names."
|
6
|
+
version: 0.4.0
|
7
|
+
date: 2007-10-05 00:00:00 +10:00
|
8
|
+
summary: GeoIP looks up a GeoIP database to provide geographical data for an IP address or Internet hostname. The free version of the GeoIP database available from www.maxmind.com only contains country information. This library supports that and the GeoIPCity file (both revisions). The data is much more reliable than using the country codes at the end of the hosts' domain names.
|
13
9
|
require_paths:
|
14
|
-
|
10
|
+
- lib
|
15
11
|
email: cjh@polyplex.org
|
16
12
|
homepage: http://polyplex.org/cjh
|
17
13
|
rubyforge_project:
|
18
|
-
description:
|
19
|
-
library by Sean Chittenden. Given an IP address or hostname, it looks up the
|
20
|
-
country where that IP address is allocated."
|
14
|
+
description: GeoIP is a pure-Ruby replacement for some of the functionality in the wrapped C library by Sean Chittenden. Given an IP address or hostname, it looks up the country where that IP address is allocated.
|
21
15
|
autorequire: geoip
|
22
16
|
default_executable:
|
23
17
|
bindir: bin
|
24
18
|
has_rdoc: true
|
25
19
|
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
26
20
|
requirements:
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
version: 0.0.0
|
21
|
+
- - ">"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.0.0
|
31
24
|
version:
|
32
25
|
platform: ruby
|
26
|
+
signing_key:
|
27
|
+
cert_chain:
|
28
|
+
post_install_message:
|
33
29
|
authors:
|
34
|
-
|
30
|
+
- Clifford Heath
|
35
31
|
files:
|
36
|
-
|
32
|
+
- lib/geoip.rb
|
37
33
|
test_files: []
|
34
|
+
|
38
35
|
rdoc_options: []
|
36
|
+
|
39
37
|
extra_rdoc_files: []
|
38
|
+
|
40
39
|
executables: []
|
40
|
+
|
41
41
|
extensions: []
|
42
|
+
|
42
43
|
requirements:
|
43
|
-
|
44
|
-
dependencies: []
|
44
|
+
- The free GeoIP database or a GeoIP city database from www.maxmind.com
|
45
|
+
dependencies: []
|
46
|
+
|