geoip 1.6.3 → 1.6.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/geoip.gemspec +4 -5
  3. data/lib/geoip.rb +3 -2
  4. metadata +4 -5
  5. data/Rakefile +0 -58
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c3520d7b15c106de43cc9c269bcec4cb371016f9
4
- data.tar.gz: 0e88256388fb9550337811db7662a8c3bec6a57d
3
+ metadata.gz: ab8190ee1b2fa79345b98fa3f2f5c3be8cbc9d8c
4
+ data.tar.gz: c26e4ce7bbf543fdf07dae5dd3675fd6753ccd36
5
5
  SHA512:
6
- metadata.gz: f583b543af13df3e630880c81be10f7a958e2fcd91aab4d7b1842b6322104c35bd60abb9c124b03fb8202a55ee0c5817505890dd22d5f633fe420a097aab6393
7
- data.tar.gz: 3a32e4572920f66b226ec59f9fd997271d6ba92faadc08fbcd3b12a6eb62c412610fd1a4427766582e2c14abc15b0c8911d5e9e8377b1c2b291115ee6964e391
6
+ metadata.gz: e52b4d618ec4d514998cbfc6da3839ca8673fa456aca66738eb53c833b78ebda5b1373228e329f5a2603f4148ac00a60deba4a23d1e2a1fd15d0d9350e2d19ff
7
+ data.tar.gz: a5fdc6e0b9a48294f24932efb376be7ffe7e4624f161ed50ced01c685f37005669e2149384f765bb0f9cba4de9736b59c58887793bc9dab5226025e8a7ac06c3
@@ -2,11 +2,11 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: geoip 1.6.2 ruby lib
5
+ # stub: geoip 1.6.4 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "geoip"
9
- s.version = "1.6.2"
9
+ s.version = "1.6.4"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
@@ -23,7 +23,6 @@ Gem::Specification.new do |s|
23
23
  "History.rdoc",
24
24
  "LICENSE",
25
25
  "README.rdoc",
26
- "Rakefile",
27
26
  "bin/geoip",
28
27
  "data/geoip/country_code.yml",
29
28
  "data/geoip/country_code3.yml",
@@ -41,8 +40,8 @@ Gem::Specification.new do |s|
41
40
  "test/test_helper.rb"
42
41
  ]
43
42
  s.homepage = "http://github.com/cjheath/geoip"
44
- s.licenses = ["LGPL"]
45
- s.rubygems_version = "2.4.5"
43
+ s.licenses = ["LGPL-2.1"]
44
+ s.rubygems_version = "2.6.13"
46
45
  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."
47
46
  end
48
47
 
@@ -58,7 +58,7 @@ require 'yaml'
58
58
  class GeoIP
59
59
 
60
60
  # The GeoIP GEM version number
61
- VERSION = "1.6.3"
61
+ VERSION = "1.6.4"
62
62
 
63
63
  # The +data/+ directory for geoip
64
64
  DATA_DIR = File.expand_path(File.join(File.dirname(__FILE__),'..','data','geoip'))
@@ -734,6 +734,7 @@ class GeoIP
734
734
  def read_isp offset
735
735
  record = atomic_read(MAX_ORG_RECORD_LENGTH, index_size+offset)
736
736
  record = record.sub(/\000.*/n, '')
737
+ record = record.force_encoding('iso-8859-1').encode('utf-8') if record.respond_to?(:force_encoding)
737
738
  record.start_with?('*') ? nil : ISP.new(record)
738
739
  end
739
740
 
@@ -884,7 +885,7 @@ class GeoIP
884
885
  @ip_bits.downto(1) do |depth|
885
886
  go_right = (ipnum & mask) != 0
886
887
  off = @record_length * (2 * offset + (go_right ? 1 : 0))
887
- offset = le_to_ui(r2 = atomic_read(@record_length, off).unpack('C*'))
888
+ offset = le_to_ui(atomic_read(@record_length, off).unpack('C*'))
888
889
 
889
890
  return offset if offset >= @database_segments[0]
890
891
  mask >>= 1
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: 1.6.3
4
+ version: 1.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Clifford Heath
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-01-07 00:00:00.000000000 Z
12
+ date: 2016-08-03 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: |-
15
15
  GeoIP searches a GeoIP database for a given host or IP address, and
@@ -28,7 +28,6 @@ files:
28
28
  - History.rdoc
29
29
  - LICENSE
30
30
  - README.rdoc
31
- - Rakefile
32
31
  - bin/geoip
33
32
  - data/geoip/country_code.yml
34
33
  - data/geoip/country_code3.yml
@@ -46,7 +45,7 @@ files:
46
45
  - test/test_helper.rb
47
46
  homepage: http://github.com/cjheath/geoip
48
47
  licenses:
49
- - LGPL
48
+ - LGPL-2.1
50
49
  metadata: {}
51
50
  post_install_message:
52
51
  rdoc_options: []
@@ -64,7 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
64
63
  version: '0'
65
64
  requirements: []
66
65
  rubyforge_project:
67
- rubygems_version: 2.4.5
66
+ rubygems_version: 2.6.13
68
67
  signing_key:
69
68
  specification_version: 4
70
69
  summary: GeoIP searches a GeoIP database for a given host or IP address, and returns
data/Rakefile DELETED
@@ -1,58 +0,0 @@
1
- require 'rubygems'
2
- require 'rake'
3
-
4
- require 'jeweler'
5
- require './lib/geoip'
6
-
7
- Jeweler::Tasks.new do |gem|
8
- # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
9
- gem.name = "geoip"
10
- gem.version = GeoIP::VERSION
11
- gem.homepage = "http://github.com/cjheath/geoip"
12
- gem.license = "LGPL"
13
- gem.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.}
14
- gem.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.}
17
- gem.email = %w[clifford.heath@gmail.com rmoriz@gmail.com]
18
- gem.authors = ["Clifford Heath", "Roland Moriz"]
19
- # Include your dependencies below. Runtime dependencies are required when using your gem,
20
- # and development dependencies are only needed for development (ie running rake tasks, tests, etc)
21
- # gem.add_runtime_dependency 'jabber4r', '> 0.1'
22
- # gem.add_development_dependency 'rspec', '> 1.2.3'
23
- gem.files.exclude "website/**/*.*", "script/*", "config/*"
24
- end
25
- Jeweler::RubygemsDotOrgTasks.new
26
-
27
- require 'rake/testtask'
28
- Rake::TestTask.new(:test) do |test|
29
- test.libs << 'lib' << 'test'
30
- test.pattern = 'test/**/test_*.rb'
31
- test.verbose = true
32
- end
33
- task :default => :test
34
-
35
- require 'rdoc/task'
36
- Rake::RDocTask.new do |rdoc|
37
- rdoc.rdoc_dir = 'rdoc'
38
- rdoc.title = "geoip #{GeoIP::VERSION}"
39
- rdoc.rdoc_files.include('README.rdoc')
40
- rdoc.rdoc_files.include('History.rdoc')
41
- rdoc.rdoc_files.include('lib/**/*.rb')
42
- end
43
-
44
- desc 'Generate website files'
45
- task :website_generate do
46
- sh %q{ruby script/txt2html website/index.txt > website/index.html}
47
- end
48
-
49
- desc 'Upload website files via rsync'
50
- task :website_upload do
51
- local_dir = 'website'
52
- website_config = YAML.load(File.read("config/website.yml"))
53
- host = website_config["host"]
54
- host = host ? "#{host}:" : ""
55
- remote_dir = website_config["remote_dir"]
56
- sh %{rsync -aCv #{local_dir}/ #{host}#{remote_dir}}
57
- end
58
-