geoip 0.9.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.rdoc +17 -10
  2. data/lib/geoip.rb +2 -2
  3. metadata +4 -4
@@ -18,16 +18,24 @@ This release adds support for timezone names, thanks to Tonni Aagesen.
18
18
  require 'geoip'
19
19
 
20
20
  # Use the country database:
21
- GeoIP.new('GeoIP.dat').country('www.atlantis.sk')
22
- => ["www.atlantis.sk", "217.67.18.26", 196, "SK", "SVK", "Slovakia", "EU"]
21
+ c = GeoIP.new('GeoIP.dat').country('www.nokia.com')
22
+ => ["www.nokia.com", "147.243.3.83", 69, "FI", "FIN", "Finland", "EU"]
23
+ c.country_code3
24
+ => "FIN"
25
+ c.to_hash
26
+ => {:country_code3=>"FIN", :country_name=>"Finland", :continent_code=>"EU", :request=>"www.nokia.com", :country_code=>69, :country_code2=>"FI", :ip=>"147.243.3.83"}
23
27
 
24
28
  Returned values are the requested hostname, the IP address as a dotted quad,
25
29
  Maxmind's country code, the ISO3166-1 alpha-2 country code, the ISO3166-2 alpha-3
26
30
  country code, the ISO3166 country name, and the continent code.
27
31
 
28
32
  # Use the city database:
29
- GeoIP.new('GeoLiteCity.dat').country('www.atlantis.sk')
30
- => ["www.atlantis.sk", "217.67.18.26", "SK", "SVK", "Slovakia", "EU", "02", "Bratislava", "", 48.15, 17.1167, nil, nil, "Europe/Bratislava"]
33
+ c = GeoIP.new('GeoLiteCity.dat').city('github.com')
34
+ => ["github.com", "207.97.227.239", "US", "USA", "United States", "NA", "CA", "San Francisco", "94110", 37.7484, -122.4156, 807, 415, "America/Los_Angeles"]
35
+ >> c.longitude
36
+ => -122.4156
37
+ >> c.timezone
38
+ => "America/Los_Angeles"
31
39
 
32
40
  GeoIP.new('GeoCity.dat').city('github.com')
33
41
  => ["github.com", "207.97.227.239", "US", "USA", "United States", "NA", "CA", "San Francisco", "94110", 37.7484, -122.4156, 807, 415, "America/Los_Angeles"]
@@ -38,7 +46,7 @@ This release adds support for timezone names, thanks to Tonni Aagesen.
38
46
  city name, postal_code/zipcode, latitude, longitude, USA DMA code, USA area code,
39
47
  timezone name.
40
48
 
41
- Result arrays from both city and country also contain accessor methods as appropriate:
49
+ Result arrays from both city and country have mixed-in accessor methods as appropriate:
42
50
  request, ip, country_code, country_code2, country_code3, country_name, continent_code,
43
51
  region_name, city_name, postal_code, latitude, longitude, dma_code, area_code, timezone
44
52
 
@@ -47,11 +55,10 @@ This release adds support for timezone names, thanks to Tonni Aagesen.
47
55
 
48
56
  == REQUIREMENTS:
49
57
 
50
- You need at least the free GeoLiteCity.dat, for which the last known download
51
- location is <http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz>,
52
- or the city database from <http://www.maxmind.com/app/geolitecity>.
53
-
54
- The ASN database location is
58
+ You need one of the free GeoLite country, city or ASN databases, or a subscription database version.
59
+ The last known download locations for the GeoLite database versions are
60
+ <http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz>,
61
+ <http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz>,
55
62
  <http://geolite.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz>.
56
63
 
57
64
  This API requires the file to be decompressed for searching. Other versions
@@ -51,7 +51,7 @@ end
51
51
 
52
52
  class GeoIP
53
53
  # The GeoIP GEM version number
54
- VERSION = "0.9.0"
54
+ VERSION = "1.0.0"
55
55
 
56
56
  private
57
57
  # Ordered list of the ISO3166 2-character country codes, ordered by GeoIP ID
@@ -1064,7 +1064,7 @@ class GeoIP
1064
1064
  end
1065
1065
 
1066
1066
  module ASNAccessors #:nodoc:
1067
- def ip
1067
+ def as_num
1068
1068
  self[0]
1069
1069
  end
1070
1070
 
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: 59
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
+ - 1
7
8
  - 0
8
- - 9
9
9
  - 0
10
- version: 0.9.0
10
+ version: 1.0.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Clifford Heath
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-02-07 00:00:00 +11:00
19
+ date: 2011-02-08 00:00:00 +11:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency