ip2location_ruby 8.3.1 → 8.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +10 -3
- data/VERSION +1 -1
- data/ip2location_ruby.gemspec +4 -4
- data/lib/ip2location_ruby.rb +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f65c7c4cdd394a27ed94056f2b040291f5728c074cac760222a323746821d050
|
4
|
+
data.tar.gz: 73afe05c310a00fe285c5c92b7c8d305ca7d360f223731ae52a1fc26f40ce308
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3a4ef0bbefe2bdd34ec42da052dd0358e45165432ef46bf988649931c78df4e6b37c985f916b3905025a1c51f53050b57e457cbaab476a68af51bde6ba89b53
|
7
|
+
data.tar.gz: 55926d42c6326264454762933b14b43036d3d9834641e88dd1d27f924b02e462eed2f206706b8e359a8c01ac1351f135a2b7096c249c48a90ac31532988604ee
|
data/Gemfile.lock
CHANGED
@@ -4,7 +4,7 @@ GEM
|
|
4
4
|
bindata (2.4.10)
|
5
5
|
diff-lcs (1.1.3)
|
6
6
|
json (>= 2.3.0)
|
7
|
-
rdoc (3.
|
7
|
+
rdoc (>= 6.3.1)
|
8
8
|
json (~> 1.4)
|
9
9
|
rspec (2.8.0)
|
10
10
|
rspec-core (~> 2.8.0)
|
@@ -21,5 +21,5 @@ PLATFORMS
|
|
21
21
|
DEPENDENCIES
|
22
22
|
bindata
|
23
23
|
bundler (>= 1.2.0)
|
24
|
-
rdoc (
|
24
|
+
rdoc (>= 6.3.1)
|
25
25
|
rspec (~> 2.8.0)
|
data/README.md
CHANGED
@@ -9,10 +9,19 @@ Supported IPv4 and IPv6 address.
|
|
9
9
|
For more details, please visit:
|
10
10
|
[https://www.ip2location.com/developers/ruby](https://www.ip2location.com/developers/ruby)
|
11
11
|
|
12
|
+
# INSTALLATION
|
13
|
+
Install this package using the command as below:
|
14
|
+
|
15
|
+
```
|
16
|
+
gem install ip2location_ruby
|
17
|
+
```
|
18
|
+
|
12
19
|
# Usage
|
13
20
|
You can check the **example.rb** file to learn more about usage.
|
14
21
|
|
15
22
|
## BIN Database
|
23
|
+
An outdated BIN database was provided in the library for your testing. You are recommended to visit the [links](#dependencies) to download the latest BIN database and save it in the ```rb``` folder.
|
24
|
+
|
16
25
|
Below is the description of the functions available in the **BIN Database** lookup.
|
17
26
|
|
18
27
|
| Function Name | Description |
|
@@ -45,7 +54,7 @@ Below is the description of the functions available in the **BIN Database** look
|
|
45
54
|
| get_elevation | Return average height of city above sea level in meters (m). |
|
46
55
|
| get_usagetype | Return the ISP's usage type of IP address. |
|
47
56
|
| get_addresstype | Returns the IP address type (A-Anycast, B-Broadcast, M-Multicast & U-Unicast) of IP address or domain name. |
|
48
|
-
|
|
57
|
+
| get_category | Returns the IAB content taxonomy category of IP address or domain name. |
|
49
58
|
|
50
59
|
|
51
60
|
## Web Service
|
@@ -62,8 +71,6 @@ This library requires IP2Location BIN data file to function. You may download th
|
|
62
71
|
* IP2Location LITE BIN Data (Free): https://lite.ip2location.com
|
63
72
|
* IP2Location Commercial BIN Data (Comprehensive): https://www.ip2location.com
|
64
73
|
|
65
|
-
An outdated BIN database was provided in the library for your testing. You are recommended to visit the above links to download the latest BIN database.
|
66
|
-
|
67
74
|
You can also sign up for [IP2Location Web Service](https://www.ip2location.com/web-service/ip2location) to lookup by IP2Location API.
|
68
75
|
|
69
76
|
# IPv4 BIN vs IPv6 BIN
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
8.3.
|
1
|
+
8.3.2
|
data/ip2location_ruby.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "ip2location_ruby"
|
3
|
-
s.version = "8.3.
|
3
|
+
s.version = "8.3.2"
|
4
4
|
|
5
5
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
6
6
|
s.require_paths = ["lib"]
|
@@ -54,18 +54,18 @@ Gem::Specification.new do |s|
|
|
54
54
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
55
55
|
s.add_runtime_dependency(%q<bindata>, [">= 0"])
|
56
56
|
s.add_development_dependency(%q<rspec>, ["~> 2.8.0"])
|
57
|
-
s.add_development_dependency(%q<rdoc>, ["
|
57
|
+
s.add_development_dependency(%q<rdoc>, [">= 6.3.1"])
|
58
58
|
s.add_development_dependency(%q<bundler>, [">= 1.2.0"])
|
59
59
|
else
|
60
60
|
s.add_dependency(%q<bindata>, [">= 0"])
|
61
61
|
s.add_dependency(%q<rspec>, ["~> 2.8.0"])
|
62
|
-
s.add_dependency(%q<rdoc>, ["
|
62
|
+
s.add_dependency(%q<rdoc>, [">= 6.3.1"])
|
63
63
|
s.add_dependency(%q<bundler>, [">= 1.2.0"])
|
64
64
|
end
|
65
65
|
else
|
66
66
|
s.add_dependency(%q<bindata>, [">= 0"])
|
67
67
|
s.add_dependency(%q<rspec>, ["~> 2.8.0"])
|
68
|
-
s.add_dependency(%q<rdoc>, ["
|
68
|
+
s.add_dependency(%q<rdoc>, [">= 6.3.1"])
|
69
69
|
s.add_dependency(%q<bundler>, [">= 1.2.0"])
|
70
70
|
end
|
71
71
|
end
|
data/lib/ip2location_ruby.rb
CHANGED
@@ -13,7 +13,7 @@ require 'ip2location_ruby/ip2location_record'
|
|
13
13
|
class Ip2location
|
14
14
|
attr_accessor :record_class4, :record_class6, :v4, :file, :db_index, :count, :base_addr, :ipno, :count, :record, :database, :columns, :ip_version, :ipv4databasecount, :ipv4databaseaddr, :ipv4indexbaseaddr, :ipv6databasecount, :ipv6databaseaddr, :ipv6indexbaseaddr, :databaseyear, :databasemonth, :databaseday, :last_err_msg
|
15
15
|
|
16
|
-
VERSION = '8.3.
|
16
|
+
VERSION = '8.3.2'
|
17
17
|
FIELD_NOT_SUPPORTED = 'NOT SUPPORTED'
|
18
18
|
INVALID_IP_ADDRESS = 'INVALID IP ADDRESS'
|
19
19
|
INVALID_BIN_DATABASE = 'Incorrect IP2Location BIN file format. Please make sure that you are using the latest IP2Location BIN file.'
|
@@ -29,7 +29,7 @@ class Ip2location
|
|
29
29
|
self.file = File.open(File.expand_path url, 'rb')
|
30
30
|
rescue
|
31
31
|
self.last_err_msg = 'Ip2location.new.open() error in opening ' + url +'.'
|
32
|
-
abort('Ip2location.new.open() error in opening ' + url +'.')
|
32
|
+
abort('Ip2location.new.open() error in opening ' + url + '. No such file in the /your_ip2location_ruby_library_path/rb/ folder.')
|
33
33
|
else
|
34
34
|
end
|
35
35
|
i2l = Ip2locationConfig.read(file)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ip2location_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 8.3.
|
4
|
+
version: 8.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ip2location
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-07
|
11
|
+
date: 2021-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bindata
|
@@ -42,16 +42,16 @@ dependencies:
|
|
42
42
|
name: rdoc
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 6.3.1
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 6.3.1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|