ip2location_ruby 8.7.3 → 8.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.
- checksums.yaml +4 -4
- data/Gemfile +4 -4
- data/LICENSE.txt +1 -1
- data/VERSION +1 -1
- data/example.rb +3 -0
- data/ip2location_ruby.gemspec +12 -29
- data/lib/ip2location_ruby/database_config.rb +4 -1
- data/lib/ip2location_ruby/i2l_string_data.rb +14 -11
- data/lib/ip2location_ruby.rb +67 -1
- data/rb/data/IP2LOCATION-COUNTRY-INFORMATION-BASIC.CSV +249 -249
- data/rb/data/IP2LOCATION-ISO3166-2.CSV +3625 -3625
- data/spec/ip2location_ruby_database_spec.rb +18 -0
- data/spec/ip2location_ruby_iptools_spec.rb +1 -1
- metadata +10 -13
|
@@ -157,6 +157,24 @@ describe "Ip2location" do
|
|
|
157
157
|
expect(record).to eq 'NOT SUPPORTED'
|
|
158
158
|
end
|
|
159
159
|
|
|
160
|
+
it "work correctly with get_as_domain" do
|
|
161
|
+
i2l = Ip2location.new.open(File.dirname(__FILE__) + "/assets/IP2LOCATION-LITE-DB1.IPV6.BIN")
|
|
162
|
+
record = i2l.get_as_domain('8.8.8.8')
|
|
163
|
+
expect(record).to eq 'NOT SUPPORTED'
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
it "work correctly with get_as_usagetype" do
|
|
167
|
+
i2l = Ip2location.new.open(File.dirname(__FILE__) + "/assets/IP2LOCATION-LITE-DB1.IPV6.BIN")
|
|
168
|
+
record = i2l.get_as_usagetype('8.8.8.8')
|
|
169
|
+
expect(record).to eq 'NOT SUPPORTED'
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
it "work correctly with get_as_cidr" do
|
|
173
|
+
i2l = Ip2location.new.open(File.dirname(__FILE__) + "/assets/IP2LOCATION-LITE-DB1.IPV6.BIN")
|
|
174
|
+
record = i2l.get_as_cidr('8.8.8.8')
|
|
175
|
+
expect(record).to eq 'NOT SUPPORTED'
|
|
176
|
+
end
|
|
177
|
+
|
|
160
178
|
it "work correctly with ipv6" do
|
|
161
179
|
i2l = Ip2location.new.open(File.dirname(__FILE__) + "/assets/IP2LOCATION-LITE-DB1.IPV6.BIN")
|
|
162
180
|
record = i2l.get_all('2001:4860:4860::8888')
|
|
@@ -74,7 +74,7 @@ describe "Ip2location" do
|
|
|
74
74
|
iptool = Ip2locationIpTools.new()
|
|
75
75
|
record = iptool.cidr_to_ipv6('2002::1234:abcd:ffff:c0a8:101/64')
|
|
76
76
|
expect(record).to include(
|
|
77
|
-
"ip_start"=>"2002:0000:0000:1234:
|
|
77
|
+
"ip_start"=>"2002:0000:0000:1234:0000:0000:0000:0000",
|
|
78
78
|
"ip_end"=>"2002:0000:0000:1234:ffff:ffff:ffff:ffff"
|
|
79
79
|
)
|
|
80
80
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ip2location_ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 8.
|
|
4
|
+
version: 8.8.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ip2location
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: bindata
|
|
@@ -16,28 +15,28 @@ dependencies:
|
|
|
16
15
|
requirements:
|
|
17
16
|
- - "~>"
|
|
18
17
|
- !ruby/object:Gem::Version
|
|
19
|
-
version:
|
|
18
|
+
version: '3.0'
|
|
20
19
|
type: :runtime
|
|
21
20
|
prerelease: false
|
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
22
|
requirements:
|
|
24
23
|
- - "~>"
|
|
25
24
|
- !ruby/object:Gem::Version
|
|
26
|
-
version:
|
|
25
|
+
version: '3.0'
|
|
27
26
|
- !ruby/object:Gem::Dependency
|
|
28
27
|
name: rspec
|
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
|
30
29
|
requirements:
|
|
31
30
|
- - "~>"
|
|
32
31
|
- !ruby/object:Gem::Version
|
|
33
|
-
version:
|
|
32
|
+
version: '3.13'
|
|
34
33
|
type: :development
|
|
35
34
|
prerelease: false
|
|
36
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
36
|
requirements:
|
|
38
37
|
- - "~>"
|
|
39
38
|
- !ruby/object:Gem::Version
|
|
40
|
-
version:
|
|
39
|
+
version: '3.13'
|
|
41
40
|
- !ruby/object:Gem::Dependency
|
|
42
41
|
name: rdoc
|
|
43
42
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -58,14 +57,14 @@ dependencies:
|
|
|
58
57
|
requirements:
|
|
59
58
|
- - ">="
|
|
60
59
|
- !ruby/object:Gem::Version
|
|
61
|
-
version:
|
|
60
|
+
version: '2.4'
|
|
62
61
|
type: :development
|
|
63
62
|
prerelease: false
|
|
64
63
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
64
|
requirements:
|
|
66
65
|
- - ">="
|
|
67
66
|
- !ruby/object:Gem::Version
|
|
68
|
-
version:
|
|
67
|
+
version: '2.4'
|
|
69
68
|
description: The official IP2Location Ruby library to geolocate an IP address. You
|
|
70
69
|
can lookup for country, region, district, city, latitude and longitude, ZIP/Postal
|
|
71
70
|
code, time zone, Internet Service Provider (ISP) or company name, domain name, net
|
|
@@ -113,7 +112,6 @@ metadata:
|
|
|
113
112
|
documentation_uri: https://www.rubydoc.info/gems/ip2location_ruby
|
|
114
113
|
homepage_uri: https://www.ip2location.com
|
|
115
114
|
source_code_uri: https://github.com/ip2location/ip2location-ruby
|
|
116
|
-
post_install_message:
|
|
117
115
|
rdoc_options: []
|
|
118
116
|
require_paths:
|
|
119
117
|
- lib
|
|
@@ -121,15 +119,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
121
119
|
requirements:
|
|
122
120
|
- - ">="
|
|
123
121
|
- !ruby/object:Gem::Version
|
|
124
|
-
version: '0'
|
|
122
|
+
version: '3.0'
|
|
125
123
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
126
124
|
requirements:
|
|
127
125
|
- - ">="
|
|
128
126
|
- !ruby/object:Gem::Version
|
|
129
127
|
version: '0'
|
|
130
128
|
requirements: []
|
|
131
|
-
rubygems_version:
|
|
132
|
-
signing_key:
|
|
129
|
+
rubygems_version: 4.0.10
|
|
133
130
|
specification_version: 4
|
|
134
131
|
summary: the ip2location ruby library
|
|
135
132
|
test_files: []
|