geoip 0.8.4 → 0.8.5

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.
Files changed (3) hide show
  1. data/README.rdoc +16 -22
  2. data/lib/geoip.rb +4 -3
  3. metadata +2 -2
data/README.rdoc CHANGED
@@ -40,25 +40,19 @@ sudo gem install geoip
40
40
 
41
41
  == LICENSE:
42
42
 
43
- (The MIT License)
44
-
45
- Copyright (c) 2009 Clifford Heath
46
-
47
- Permission is hereby granted, free of charge, to any person obtaining
48
- a copy of this software and associated documentation files (the
49
- 'Software'), to deal in the Software without restriction, including
50
- without limitation the rights to use, copy, modify, merge, publish,
51
- distribute, sublicense, and/or sell copies of the Software, and to
52
- permit persons to whom the Software is furnished to do so, subject to
53
- the following conditions:
54
-
55
- The above copyright notice and this permission notice shall be
56
- included in all copies or substantial portions of the Software.
57
-
58
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
59
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
60
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
61
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
62
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
63
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
64
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
43
+ This version Copyright (C) 2005 Clifford Heath
44
+ Derived from the C version, Copyright (C) 2003 MaxMind LLC
45
+
46
+ This library is free software; you can redistribute it and/or
47
+ modify it under the terms of the GNU General Public
48
+ License as published by the Free Software Foundation; either
49
+ version 2.1 of the License, or (at your option) any later version.
50
+
51
+ This library is distributed in the hope that it will be useful,
52
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
53
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
54
+ General Public License for more details.
55
+
56
+ You should have received a copy of the GNU General Public
57
+ License along with this library; if not, write to the Free Software
58
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
data/lib/geoip.rb CHANGED
@@ -45,7 +45,7 @@ require 'thread' # Needed for Mutex
45
45
  require 'socket'
46
46
 
47
47
  class GeoIP
48
- VERSION = "0.8.4"
48
+ VERSION = "0.8.5"
49
49
  private
50
50
  CountryCode = [
51
51
  "--","AP","EU","AD","AE","AF","AG","AI","AL","AM","AN",
@@ -633,6 +633,7 @@ class GeoIP
633
633
  throw "Invalid GeoIP database type, can't look up City by IP"
634
634
  end
635
635
  pos = seek_record(ipnum);
636
+ return nil if pos == @databaseSegments[0]
636
637
  read_city(pos, hostname, ip)
637
638
  end
638
639
 
@@ -660,7 +661,7 @@ class GeoIP
660
661
  @file.seek(pos + (2*@record_length-1) * @databaseSegments[0])
661
662
  record = @file.read(MAX_ORG_RECORD_LENGTH)
662
663
  }
663
- record = record.sub(/\000.*/, '')
664
+ record = record.sub(/\000.*/n, '')
664
665
  record
665
666
  end
666
667
 
@@ -691,7 +692,7 @@ class GeoIP
691
692
  @file.seek(pos + (2*@record_length-1) * @databaseSegments[0])
692
693
  record = @file.read(MAX_ASN_RECORD_LENGTH)
693
694
  }
694
- record = record.sub(/\000.*/, '')
695
+ record = record.sub(/\000.*/n, '')
695
696
 
696
697
  if record =~ /^(AS\d+)\s(.*)$/
697
698
  # AS####, Description
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
4
+ version: 0.8.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Clifford Heath
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-09-04 00:00:00 +10:00
13
+ date: 2009-11-09 00:00:00 +00:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency