geoip 0.8.0 → 0.8.1
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/History.txt +4 -0
- data/lib/geoip.rb +5 -0
- data/lib/geoip/version.rb +1 -1
- data/website/index.html +26 -58
- metadata +17 -6
data/History.txt
CHANGED
data/lib/geoip.rb
CHANGED
@@ -473,6 +473,11 @@ class GeoIP
|
|
473
473
|
end
|
474
474
|
end
|
475
475
|
|
476
|
+
# Close the file handle for the GeoIP data file.
|
477
|
+
def close
|
478
|
+
@file.close
|
479
|
+
end
|
480
|
+
|
476
481
|
# Search the GeoIP database for the specified host, returning country info
|
477
482
|
#
|
478
483
|
# +hostname+ is a String holding the host's DNS name or numeric IP address.
|
data/lib/geoip/version.rb
CHANGED
data/website/index.html
CHANGED
@@ -33,69 +33,37 @@
|
|
33
33
|
<h1>geoip</h1>
|
34
34
|
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/geoip"; return false'>
|
35
35
|
<p>Get Version</p>
|
36
|
-
<a href="http://rubyforge.org/projects/geoip" class="numbers">0.8.
|
36
|
+
<a href="http://rubyforge.org/projects/geoip" class="numbers">0.8.1</a>
|
37
37
|
</div>
|
38
|
-
<h2
|
39
|
-
|
40
|
-
|
41
|
-
<h2>What</h2>
|
42
|
-
|
43
|
-
|
44
|
-
<p>GeoIP searches a GeoIP database for a given host or IP address, and
|
38
|
+
<h2>&#x2192; ‘Geographic info for an IP address’</h2>
|
39
|
+
<h2>What</h2>
|
40
|
+
<p>GeoIP searches a GeoIP database for a given host or IP address, and<br />
|
45
41
|
returns information about the country where the IP address is allocated.</p>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
<h2>Prerequisites</h2>
|
55
|
-
|
56
|
-
|
57
|
-
<p>You need at least the free GeoIP.dat, for which the last known download
|
58
|
-
location is <a href="http://www.maxmind.com/download/geoip/database/GeoIP.dat.gz">http://www.maxmind.com/download/geoip/database/GeoIP.dat.gz</a>
|
59
|
-
This <span class="caps">API</span> requires the file to be decompressed for searching. Other versions
|
60
|
-
of this database are available for purchase which contain more detailed
|
61
|
-
information, but this information is not returned by this implementation.
|
42
|
+
<h2>Installing</h2>
|
43
|
+
<p><pre class='syntax'><span class="ident">sudo</span> <span class="ident">gem</span> <span class="ident">install</span> <span class="ident">geoip</span></pre></p>
|
44
|
+
<h2>Prerequisites</h2>
|
45
|
+
<p>You need at least the free GeoIP.dat, for which the last known download<br />
|
46
|
+
location is <a href="http://www.maxmind.com/download/geoip/database/GeoIP.dat.gz">http://www.maxmind.com/download/geoip/database/GeoIP.dat.gz</a><br />
|
47
|
+
This <span class="caps">API</span> requires the file to be decompressed for searching. Other versions<br />
|
48
|
+
of this database are available for purchase which contain more detailed<br />
|
49
|
+
information, but this information is not returned by this implementation.<br />
|
62
50
|
See www.maxmind.com for more information.</p>
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
<p>Read the <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/">8 steps for fixing other people’s code</a> and for section <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8z-email">8z: Submit patch</a>, email me on the link below.</p>
|
77
|
-
|
78
|
-
|
79
|
-
<p>The trunk repository is <code>svn://rubyforge.org/var/svn/geoip/trunk</code> for anonymous access.</p>
|
80
|
-
|
81
|
-
|
82
|
-
<p>Read the <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/">8 steps for fixing other people’s code</a> and for section <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups">8b: Submit patch to Google Groups</a>, use the Google Group above.</p>
|
83
|
-
|
84
|
-
|
85
|
-
<h2>License</h2>
|
86
|
-
|
87
|
-
|
88
|
-
<p>This code is free to use under the terms of the <span class="caps">GPL</span> license.
|
89
|
-
I don’t normally use the <span class="caps">GPL</span> license, but this one is derived
|
51
|
+
<h2>Example</h2>
|
52
|
+
require ‘geoip’
|
53
|
+
GeoIP.new(‘GeoIP.dat’).country(“www.netscape.sk”)
|
54
|
+
=> [“www.netscape.sk”, “217.67.16.35”, 196, “SK”, “<span class="caps">SVK</span>”, “Slovakia”, “EU”]
|
55
|
+
<h2>How to submit patches</h2>
|
56
|
+
<p>Read the <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/">8 steps for fixing other people’s code</a> and for section <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8z-email">8z: Submit patch</a>, email me on the link below.</p>
|
57
|
+
<p>The trunk repository is <code>svn://rubyforge.org/var/svn/geoip/trunk</code> for anonymous access.</p>
|
58
|
+
<p>Read the <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/">8 steps for fixing other people’s code</a> and for section <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups">8b: Submit patch to Google Groups</a>, use the Google Group above.</p>
|
59
|
+
<h2>License</h2>
|
60
|
+
<p>This code is free to use under the terms of the <span class="caps">GPL</span> license.<br />
|
61
|
+
I don’t normally use the <span class="caps">GPL</span> license, but this one is derived<br />
|
90
62
|
from Maxmind’s code, so I use the license they use.</p>
|
91
|
-
|
92
|
-
|
93
|
-
<h2>Contact</h2>
|
94
|
-
|
95
|
-
|
96
|
-
<p>Comments are welcome. Send an email to <a href="mailto:cjheath@rubyforge.org">Clifford Heath</a> .</p>
|
63
|
+
<h2>Contact</h2>
|
64
|
+
<p>Comments are welcome. Send an email to <a href="mailto:cjheath@rubyforge.org">Clifford Heath</a> .</p>
|
97
65
|
<p class="coda">
|
98
|
-
<a href="cjheath@rubyforge.org">Clifford Heath</a>,
|
66
|
+
<a href="cjheath@rubyforge.org">Clifford Heath</a>, 25th May 2009<br>
|
99
67
|
Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
|
100
68
|
</p>
|
101
69
|
</div>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geoip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Clifford Heath
|
@@ -9,10 +9,19 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2009-06-04 00:00:00 +10:00
|
13
13
|
default_executable:
|
14
|
-
dependencies:
|
15
|
-
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: hoe
|
17
|
+
type: :development
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 1.8.0
|
24
|
+
version:
|
16
25
|
description: description of gem
|
17
26
|
email: cjheath@rubyforge.org
|
18
27
|
executables: []
|
@@ -52,6 +61,8 @@ files:
|
|
52
61
|
- website/template.rhtml
|
53
62
|
has_rdoc: true
|
54
63
|
homepage: http://geoip.rubyforge.org
|
64
|
+
licenses: []
|
65
|
+
|
55
66
|
post_install_message:
|
56
67
|
rdoc_options:
|
57
68
|
- --main
|
@@ -73,9 +84,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
73
84
|
requirements: []
|
74
85
|
|
75
86
|
rubyforge_project: geoip
|
76
|
-
rubygems_version: 1.
|
87
|
+
rubygems_version: 1.3.3
|
77
88
|
signing_key:
|
78
|
-
specification_version:
|
89
|
+
specification_version: 3
|
79
90
|
summary: description of gem
|
80
91
|
test_files:
|
81
92
|
- test/test_geoip.rb
|