geoip 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/geoip.gemspec +7 -15
  2. data/lib/geoip.rb +4 -2
  3. metadata +30 -47
@@ -4,16 +4,13 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{geoip}
8
- s.version = "1.1.1"
7
+ s.name = "geoip"
8
+ s.version = "1.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Clifford Heath", "Roland Moriz"]
12
- s.date = %q{2011-05-06}
13
- s.default_executable = %q{geoip}
14
- s.description = %q{GeoIP searches a GeoIP database for a given host or IP address, and
15
- returns information about the country where the IP address is allocated,
16
- and the city, ISP and other information, if you have that database version.}
12
+ s.date = "2012-01-26"
13
+ s.description = "GeoIP searches a GeoIP database for a given host or IP address, and\nreturns information about the country where the IP address is allocated,\nand the city, ISP and other information, if you have that database version."
17
14
  s.email = ["clifford.heath@gmail.com", "rmoriz@gmail.com"]
18
15
  s.executables = ["geoip"]
19
16
  s.extra_rdoc_files = [
@@ -42,18 +39,13 @@ and the city, ISP and other information, if you have that database version.}
42
39
  "website/stylesheets/screen.css",
43
40
  "website/template.rhtml"
44
41
  ]
45
- s.homepage = %q{http://github.com/cjheath/geoip}
42
+ s.homepage = "http://github.com/cjheath/geoip"
46
43
  s.licenses = ["MIT"]
47
44
  s.require_paths = ["lib"]
48
- s.rubygems_version = %q{1.3.7}
49
- s.summary = %q{GeoIP searches a GeoIP database for a given host or IP address, and returns information about the country where the IP address is allocated, and the city, ISP and other information, if you have that database version.}
50
- s.test_files = [
51
- "test/test_geoip.rb",
52
- "test/test_helper.rb"
53
- ]
45
+ s.rubygems_version = "1.8.10"
46
+ s.summary = "GeoIP searches a GeoIP database for a given host or IP address, and returns information about the country where the IP address is allocated, and the city, ISP and other information, if you have that database version."
54
47
 
55
48
  if s.respond_to? :specification_version then
56
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
57
49
  s.specification_version = 3
58
50
 
59
51
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
@@ -54,7 +54,7 @@ require 'yaml'
54
54
  class GeoIP
55
55
 
56
56
  # The GeoIP GEM version number
57
- VERSION = "1.1.1"
57
+ VERSION = "1.1.2"
58
58
 
59
59
  # The +data/+ directory for geoip
60
60
  DATA_DIR = File.expand_path(File.join(File.dirname(__FILE__),'..','data','geoip'))
@@ -487,7 +487,7 @@ class GeoIP
487
487
  end
488
488
 
489
489
  def lookup_ip(ip_or_hostname) # :nodoc:
490
- return ip_or_hostname unless (ip_or_hostname.kind_of?(String) && ip_or_hostname !~ /^[0-9.]*$/)
490
+ return ip_or_hostname unless (ip_or_hostname.kind_of?(String) && ip_or_hostname !~ /^[0-9.]+$/)
491
491
 
492
492
  # Lookup IP address, we were given a name
493
493
  ip = IPSocket.getaddress(ip_or_hostname)
@@ -500,6 +500,8 @@ class GeoIP
500
500
  if (ip.kind_of?(String) &&
501
501
  ip =~ /^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)$/)
502
502
  ip = be_to_ui(Regexp.last_match().to_a.slice(1..4))
503
+ else
504
+ ip = ip.to_i
503
505
  end
504
506
 
505
507
  return ip
metadata CHANGED
@@ -1,39 +1,31 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: geoip
3
- version: !ruby/object:Gem::Version
4
- hash: 17
5
- prerelease: false
6
- segments:
7
- - 1
8
- - 1
9
- - 1
10
- version: 1.1.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.2
5
+ prerelease:
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Clifford Heath
14
9
  - Roland Moriz
15
10
  autorequire:
16
11
  bindir: bin
17
12
  cert_chain: []
18
-
19
- date: 2011-05-06 00:00:00 +10:00
20
- default_executable: geoip
13
+ date: 2012-01-26 00:00:00.000000000 Z
21
14
  dependencies: []
15
+ description: ! 'GeoIP searches a GeoIP database for a given host or IP address, and
22
16
 
23
- description: |-
24
- GeoIP searches a GeoIP database for a given host or IP address, and
25
17
  returns information about the country where the IP address is allocated,
26
- and the city, ISP and other information, if you have that database version.
27
- email:
18
+
19
+ and the city, ISP and other information, if you have that database version.'
20
+ email:
28
21
  - clifford.heath@gmail.com
29
22
  - rmoriz@gmail.com
30
- executables:
23
+ executables:
31
24
  - geoip
32
25
  extensions: []
33
-
34
- extra_rdoc_files:
26
+ extra_rdoc_files:
35
27
  - README.rdoc
36
- files:
28
+ files:
37
29
  - History.rdoc
38
30
  - README.rdoc
39
31
  - Rakefile
@@ -55,40 +47,31 @@ files:
55
47
  - website/javascripts/rounded_corners_lite.inc.js
56
48
  - website/stylesheets/screen.css
57
49
  - website/template.rhtml
58
- has_rdoc: true
59
50
  homepage: http://github.com/cjheath/geoip
60
- licenses:
51
+ licenses:
61
52
  - MIT
62
53
  post_install_message:
63
54
  rdoc_options: []
64
-
65
- require_paths:
55
+ require_paths:
66
56
  - lib
67
- required_ruby_version: !ruby/object:Gem::Requirement
57
+ required_ruby_version: !ruby/object:Gem::Requirement
68
58
  none: false
69
- requirements:
70
- - - ">="
71
- - !ruby/object:Gem::Version
72
- hash: 3
73
- segments:
74
- - 0
75
- version: "0"
76
- required_rubygems_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ! '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ required_rubygems_version: !ruby/object:Gem::Requirement
77
64
  none: false
78
- requirements:
79
- - - ">="
80
- - !ruby/object:Gem::Version
81
- hash: 3
82
- segments:
83
- - 0
84
- version: "0"
65
+ requirements:
66
+ - - ! '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
85
69
  requirements: []
86
-
87
70
  rubyforge_project:
88
- rubygems_version: 1.3.7
71
+ rubygems_version: 1.8.10
89
72
  signing_key:
90
73
  specification_version: 3
91
- summary: GeoIP searches a GeoIP database for a given host or IP address, and returns information about the country where the IP address is allocated, and the city, ISP and other information, if you have that database version.
92
- test_files:
93
- - test/test_geoip.rb
94
- - test/test_helper.rb
74
+ summary: GeoIP searches a GeoIP database for a given host or IP address, and returns
75
+ information about the country where the IP address is allocated, and the city, ISP
76
+ and other information, if you have that database version.
77
+ test_files: []