ip2location_ruby 8.0.2 → 8.2.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/LICENSE.txt +1 -1
- data/README.md +70 -0
- data/VERSION +1 -1
- data/example.rb +41 -0
- data/ip2location_ruby.gemspec +9 -7
- data/lib/ip2location_ruby.rb +510 -119
- data/rb/data/IP2LOCATION-LITE-DB1.IPV6.BIN +0 -0
- metadata +9 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87b2d8b319cb9e62e4d99875d0f01dc5043d9f3bbc7556488efcb9b7091d656e
|
4
|
+
data.tar.gz: b3166341ec4b79588c683611ca24b5019052258f2fab60a8d74029de52d6f5c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 888a244c319e9fb212cd0c1343261035e37c03e24bfe27e71940cf6673b8525661ac7e577159585f3abe78a2a566d10499826232cd6e960634b8dce8d64bc4ab
|
7
|
+
data.tar.gz: ef010901688b3d4da4fc161ad0a162f109bf0323f382542b2d7ab4afc4e522185b08d6fd1da93d51fef5f37631c9a74c2e9a56b0156b7651d489f8599eeea144
|
data/LICENSE.txt
CHANGED
data/README.md
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
[](https://rubygems.org/gems/ip2location_ruby)
|
2
|
+
[](https://rubygems.org/gems/ip2location_ruby)
|
3
|
+
|
4
|
+
# IP2Location Ruby Library
|
5
|
+
This is IP2Location Ruby library that enables the user to find the country, region or state, city, latitude and longitude, US ZIP code, time zone, Internet Service Provider (ISP) or company name, domain name, net speed, area code, weather station code, weather station name, mobile country code (MCC), mobile network code (MNC) and carrier brand, elevation, and usage type by IP address or hostname originates from. The library reads the geo location information from **IP2Location BIN data** file or web service.
|
6
|
+
|
7
|
+
Supported IPv4 and IPv6 address.
|
8
|
+
|
9
|
+
For more details, please visit:
|
10
|
+
[https://www.ip2location.com/developers/ruby](https://www.ip2location.com/developers/ruby)
|
11
|
+
|
12
|
+
# Usage
|
13
|
+
You can check the **example.rb** file to learn more about usage.
|
14
|
+
|
15
|
+
## BIN Database
|
16
|
+
Below is the description of the functions available in the **BIN Database** lookup.
|
17
|
+
|
18
|
+
| Function Name | Description |
|
19
|
+
|---|---|
|
20
|
+
| open | Open the IP2Location BIN data for lookup. |
|
21
|
+
| close | Close and clean up the file pointer. |
|
22
|
+
| get_all | Return the geolocation information in array. |
|
23
|
+
| get_country_short | Return the ISO3166-1 country code (2-digits) of the IP address. |
|
24
|
+
| get_country_long | Return the ISO3166-1 country name of the IP address. |
|
25
|
+
| get_region | Return the ISO3166-2 region name of the IP address. Please visit [ISO3166-2 Subdivision Code](https://www.ip2location.com/free/iso3166-2) for the information of ISO3166-2 supported |
|
26
|
+
| get_city | Return the city name of the IP address. |
|
27
|
+
| get_latitude | Return the city latitude of the IP address. |
|
28
|
+
| get_longitude | Return the city longtitude of the IP address. |
|
29
|
+
| get_isp | Return the ISP name of the IP address. |
|
30
|
+
| get_domain | Return the domain name of IP address. |
|
31
|
+
| get_zipcode | Return the zipcode of the city. |
|
32
|
+
| get_timezone | Return the UTC time zone (with DST supported). |
|
33
|
+
| get_netspeed | Return the Internet connection type. |
|
34
|
+
| get_iddcode | Return the IDD prefix to call the city from another country. |
|
35
|
+
| get_areacode | Return the area code of the city. |
|
36
|
+
| get_weathercode | Return the nearest weather observation station code. |
|
37
|
+
| get_weathername | Return the nearest weather observation station name. |
|
38
|
+
| get_mcc | Return the Mobile Country Codes (MCC). |
|
39
|
+
| get_mnc | Return the Mobile Network Code (MNC). |
|
40
|
+
| get_mobilebrand | Commercial brand associated with the mobile carrier. |
|
41
|
+
| get_elevation | Return average height of city above sea level in meters (m). |
|
42
|
+
| get_usagetype | Return the ISP's usage type of IP address. |
|
43
|
+
|
44
|
+
|
45
|
+
## Web Service
|
46
|
+
Below is the description of the functions available in the **Web Service** lookup.
|
47
|
+
|
48
|
+
| Function Name | Description |
|
49
|
+
|---|---|
|
50
|
+
| Constructor | Expect 3 input parameters:<ol><li>IP2Location API Key.</li><li>Package (WS1 - WS24)</li></li><li>Use HTTPS or HTTP</li></ol> |
|
51
|
+
| lookup | Return the IP information in array.<ul><li>country_code</li><li>country_name</li><li>region_name</li><li>city_name</li><li>latitude</li><li>longitude</li><li>zip_code</li><li>time_zone</li><li>isp</li><li>domain</li><li>net_speed</li><li>idd_code</li><li>area_code</li><li>weather_station_code</li><li>weather_station_name</li><li>mcc</li><li>mnc</li><li>mobile_brand</li><li>elevation</li><li>usage_type</li><li>continent<ul><li>name</li><li>code</li><li>hemisphere</li><li>translations</li></ul></li><li>country<ul><li>name</li><li>alpha3_code</li><li>numeric_code</li><li>demonym</li><li>flag</li><li>capital</li><li>total_area</li><li>population</li><li>currency<ul><li>code</li><li>name</li><li>symbol</li></ul></li><li>language<ul><li>code</li><li>name</li></ul></li><li>idd_code</li><li>tld</li><li>translations</li></ul></li><li>region<ul><li>name</li><li>code</li><li>translations</li></ul></li><li>city<ul><li>name</li><li>translations</li></ul></li><li>geotargeting<ul><li>metro</li></ul></li><li>country_groupings</li><li>time_zone_info<ul><li>olson</li><li>current_time</li><li>gmt_offset</li><li>is_dst</li><li>sunrise</li><li>sunset</li></ul></li><ul> |
|
52
|
+
| get_credit | Return remaining credit of the web service account. |
|
53
|
+
|
54
|
+
# Dependencies
|
55
|
+
This library requires IP2Location BIN data file to function. You may download the BIN data file at
|
56
|
+
* IP2Location LITE BIN Data (Free): https://lite.ip2location.com
|
57
|
+
* IP2Location Commercial BIN Data (Comprehensive): https://www.ip2location.com
|
58
|
+
|
59
|
+
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.
|
60
|
+
|
61
|
+
You can also sign up for [IP2Location Web Service](https://www.ip2location.com/web-service/ip2location) to lookup by IP2Location API.
|
62
|
+
|
63
|
+
# IPv4 BIN vs IPv6 BIN
|
64
|
+
* Use the IPv4 BIN file if you just need to query IPv4 addresses.
|
65
|
+
* Use the IPv6 BIN file if you need to query BOTH IPv4 and IPv6 addresses.
|
66
|
+
|
67
|
+
# Support
|
68
|
+
|
69
|
+
Email: support@ip2location.com
|
70
|
+
URL: [https://www.ip2location.com](https://www.ip2location.com)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
8.
|
1
|
+
8.2.1
|
data/example.rb
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'ip2location_ruby'
|
2
|
+
|
3
|
+
# BIN Database
|
4
|
+
i2l = Ip2location.new.open("./data/IP2LOCATION-LITE-DB1.IPV6.BIN")
|
5
|
+
record = i2l.get_all('8.8.8.8')
|
6
|
+
|
7
|
+
print 'Country Code: ' + record['country_short'] + "\n"
|
8
|
+
print 'Country Name: ' + record['country_long'] + "\n"
|
9
|
+
print 'Region Name: ' + record['region'] + "\n"
|
10
|
+
print 'City Name: ' + record['city'] + "\n"
|
11
|
+
print 'Latitude: '
|
12
|
+
print record['latitude']
|
13
|
+
print "\n"
|
14
|
+
print 'Longitude: '
|
15
|
+
print record['longitude']
|
16
|
+
print "\n"
|
17
|
+
print 'ISP: ' + record['isp'] + "\n"
|
18
|
+
print 'Domain: ' + record['domain'] + "\n"
|
19
|
+
print 'Net Speed: ' + record['netspeed'] + "\n"
|
20
|
+
print 'Area Code: ' + record['areacode'] + "\n"
|
21
|
+
print 'IDD Code: ' + record['iddcode'] + "\n"
|
22
|
+
print 'Time Zone: ' + record['timezone'] + "\n"
|
23
|
+
print 'ZIP Code: ' + record['zipcode'] + "\n"
|
24
|
+
print 'Weather Station Code: ' + record['weatherstationname'] + "\n"
|
25
|
+
print 'Weather Station Name: ' + record['weatherstationcode'] + "\n"
|
26
|
+
print 'MCC: ' + record['mcc'] + "\n"
|
27
|
+
print 'MNC: ' + record['mnc'] + "\n"
|
28
|
+
print 'Mobile Name: ' + record['mobilebrand'] + "\n"
|
29
|
+
print 'Elevation: '
|
30
|
+
print record['elevation']
|
31
|
+
print "\n"
|
32
|
+
print 'Usage Type: ' + record['usagetype'] + "\n"
|
33
|
+
|
34
|
+
i2l.close()
|
35
|
+
|
36
|
+
# Web Service
|
37
|
+
ws = Ip2locationWebService.new('demo', 'WS24', true)
|
38
|
+
record = ws.lookup('8.8.8.8', 'continent,country,region,city,geotargeting,country_groupings,time_zone_info', 'en')
|
39
|
+
print record
|
40
|
+
print "\n"
|
41
|
+
print ws.get_credit()
|
data/ip2location_ruby.gemspec
CHANGED
@@ -2,20 +2,20 @@
|
|
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: ip2location_ruby 8.0.2 ruby lib
|
6
5
|
|
7
6
|
Gem::Specification.new do |s|
|
8
7
|
s.name = "ip2location_ruby"
|
9
|
-
s.version = "8.
|
8
|
+
s.version = "8.2.1"
|
10
9
|
|
11
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
11
|
s.require_paths = ["lib"]
|
13
|
-
s.authors
|
14
|
-
s.
|
12
|
+
s.authors = ["ip2location"]
|
13
|
+
s.email = ["support@ip2location.com"]
|
15
14
|
s.description = "The official IP2Location Ruby library to geolocate an IP address. You can lookup for country, region, city, latitude, longitude, zip code, time zone, ISP, domain, area code, usage type, mobile data, weather data and elevation from an IP address. Supported both IPv4 and IPv6 lookup."
|
16
15
|
s.email = "support@ip2location.com"
|
17
16
|
s.extra_rdoc_files = [
|
18
|
-
"LICENSE.txt"
|
17
|
+
"LICENSE.txt",
|
18
|
+
"README.md"
|
19
19
|
]
|
20
20
|
s.files = [
|
21
21
|
".document",
|
@@ -26,6 +26,7 @@ Gem::Specification.new do |s|
|
|
26
26
|
"Rakefile",
|
27
27
|
"VERSION",
|
28
28
|
"ip2location_ruby.gemspec",
|
29
|
+
"example.rb",
|
29
30
|
"lib/ip2location_ruby.rb",
|
30
31
|
"lib/ip2location_ruby/database_config.rb",
|
31
32
|
"lib/ip2location_ruby/i2l_float_data.rb",
|
@@ -37,16 +38,17 @@ Gem::Specification.new do |s|
|
|
37
38
|
"spec/assets/DB24.DEMO6.BIN",
|
38
39
|
"spec/assets/IP-COUNTRY-SAMPLE.BIN",
|
39
40
|
"spec/ip2location_ruby_spec.rb",
|
40
|
-
"spec/spec_helper.rb"
|
41
|
+
"spec/spec_helper.rb",
|
42
|
+
"rb/data/IP2LOCATION-LITE-DB1.IPV6.BIN"
|
41
43
|
]
|
42
44
|
s.homepage = "https://github.com/ip2location/ip2location-ruby"
|
43
45
|
s.licenses = ["MIT"]
|
44
|
-
s.rubygems_version = "2.4.1"
|
45
46
|
s.summary = "the ip2location ruby library"
|
46
47
|
|
47
48
|
if s.respond_to?(:metadata=)
|
48
49
|
s.metadata = {
|
49
50
|
"bug_tracker_uri" => "https://github.com/ip2location/ip2location-ruby/issues",
|
51
|
+
"documentation_uri" => "https://www.rubydoc.info/gems/ip2location_ruby",
|
50
52
|
"homepage_uri" => "https://www.ip2location.com",
|
51
53
|
"source_code_uri" => "https://github.com/ip2location/ip2location-ruby",
|
52
54
|
}
|
data/lib/ip2location_ruby.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
require 'bindata'
|
3
3
|
require 'ipaddr'
|
4
|
+
require 'net/http'
|
5
|
+
require 'json'
|
4
6
|
require 'ip2location_ruby/ip2location_config'
|
5
7
|
require 'ip2location_ruby/database_config'
|
6
8
|
require 'ip2location_ruby/i2l_float_data'
|
@@ -10,7 +12,10 @@ require 'ip2location_ruby/ip2location_record'
|
|
10
12
|
|
11
13
|
class Ip2location
|
12
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
|
13
|
-
|
15
|
+
|
16
|
+
FIELD_NOT_SUPPORTED = 'NOT SUPPORTED'
|
17
|
+
INVALID_IP_ADDRESS = 'INVALID IP ADDRESS'
|
18
|
+
|
14
19
|
def open(url)
|
15
20
|
self.file = File.open(File.expand_path url, 'rb')
|
16
21
|
i2l = Ip2locationConfig.read(file)
|
@@ -23,178 +28,564 @@ class Ip2location
|
|
23
28
|
self.ipv6databaseaddr = i2l.ipv6databaseaddr
|
24
29
|
self.ipv4indexbaseaddr = i2l.ipv4indexbaseaddr
|
25
30
|
self.ipv6indexbaseaddr = i2l.ipv6indexbaseaddr
|
26
|
-
|
27
|
-
|
31
|
+
self.record_class4 = (Ip2LocationRecord.init database, 4)
|
32
|
+
self.record_class6 = (Ip2LocationRecord.init database, 6)
|
28
33
|
self
|
29
34
|
end
|
30
|
-
|
31
|
-
def
|
35
|
+
|
36
|
+
def close()
|
37
|
+
self.file.close
|
38
|
+
end
|
39
|
+
|
40
|
+
def get_record(ip)
|
32
41
|
ipno = IPAddr.new(ip, Socket::AF_UNSPEC)
|
33
|
-
self.ip_version = ipno
|
34
|
-
self.v4 =
|
35
|
-
self.count =
|
36
|
-
self.base_addr = (
|
37
|
-
|
38
|
-
ipnum = ipno.to_i + 0
|
42
|
+
self.ip_version, ipnum = validateip(ipno)
|
43
|
+
self.v4 = ip_version == 4 ? true : false
|
44
|
+
self.count = v4 ? self.ipv4databasecount + 0 : self.ipv6databasecount + 0
|
45
|
+
self.base_addr = (v4 ? self.ipv4databaseaddr - 1 : self.ipv6databaseaddr - 1)
|
39
46
|
col_length = columns * 4
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
47
|
+
if ipv4indexbaseaddr > 0 || ipv6indexbaseaddr > 0
|
48
|
+
indexpos = 0
|
49
|
+
case ip_version
|
50
|
+
when 4
|
51
|
+
indexpos = ipv4indexbaseaddr + ((ipnum >> 16) << 3)
|
52
|
+
realipno = ipnum
|
53
|
+
# if ipnum reach MAX_IPV4_RANGE
|
54
|
+
if realipno == 4294967295
|
55
|
+
ipnum = realipno - 1
|
56
|
+
end
|
57
|
+
when 6
|
58
|
+
indexpos = ipv6indexbaseaddr + ((ipnum >> 112) << 3)
|
59
|
+
realipno = ipnum
|
60
|
+
# if ipnum reach MAX_IPV6_RANGE
|
61
|
+
if realipno == 340282366920938463463374607431768211455
|
62
|
+
ipnum = realipno - 1
|
63
|
+
end
|
64
|
+
end
|
65
|
+
low = read32(indexpos)
|
66
|
+
high = read32(indexpos + 4)
|
67
|
+
return self.record = bsearch(low, high, ipnum, self.base_addr, col_length)
|
68
|
+
else
|
69
|
+
return self.record = bsearch(0, self.count, ipnum, self.base_addr, col_length)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
def get_all(ip)
|
74
|
+
valid = !(IPAddr.new(ip) rescue nil).nil?
|
75
|
+
if valid
|
76
|
+
rec = get_record(ip)
|
77
|
+
if !(rec.nil?)
|
78
|
+
country_short = (defined?(rec.country_short) && rec.country_short != '') ? rec.country_short : FIELD_NOT_SUPPORTED
|
79
|
+
country_long = (defined?(rec.country_long) && rec.country_long != '') ? rec.country_long : FIELD_NOT_SUPPORTED
|
80
|
+
region = (defined?(rec.region) && rec.region != '') ? rec.region : FIELD_NOT_SUPPORTED
|
81
|
+
city = (defined?(rec.city) && rec.city != '') ? rec.city : FIELD_NOT_SUPPORTED
|
82
|
+
latitude = (defined?(rec.latitude) && rec.latitude != '') ? rec.latitude : FIELD_NOT_SUPPORTED
|
83
|
+
longitude = (defined?(rec.longitude) && rec.longitude != '') ? rec.longitude : FIELD_NOT_SUPPORTED
|
84
|
+
isp = (defined?(rec.isp) && rec.isp != '') ? rec.isp : FIELD_NOT_SUPPORTED
|
85
|
+
domain = (defined?(rec.domain) && rec.domain != '') ? rec.domain : FIELD_NOT_SUPPORTED
|
86
|
+
netspeed = (defined?(rec.netspeed) && rec.netspeed != '') ? rec.netspeed : FIELD_NOT_SUPPORTED
|
87
|
+
areacode = (defined?(rec.areacode) && rec.areacode != '') ? rec.areacode : FIELD_NOT_SUPPORTED
|
88
|
+
iddcode = (defined?(rec.iddcode) && rec.iddcode != '') ? rec.iddcode : FIELD_NOT_SUPPORTED
|
89
|
+
timezone = (defined?(rec.timezone) && rec.timezone != '') ? rec.timezone : FIELD_NOT_SUPPORTED
|
90
|
+
zipcode = (defined?(rec.zipcode) && rec.zipcode != '') ? rec.zipcode : FIELD_NOT_SUPPORTED
|
91
|
+
weatherstationname = (defined?(rec.weatherstationname) && rec.weatherstationname != '') ? rec.weatherstationname : FIELD_NOT_SUPPORTED
|
92
|
+
weatherstationcode = (defined?(rec.weatherstationcode) && rec.weatherstationcode != '') ? rec.weatherstationcode : FIELD_NOT_SUPPORTED
|
93
|
+
mcc = (defined?(rec.mcc) && rec.mcc != '') ? rec.mcc : FIELD_NOT_SUPPORTED
|
94
|
+
mnc = (defined?(rec.mnc) && rec.mnc != '') ? rec.mnc : FIELD_NOT_SUPPORTED
|
95
|
+
mobilebrand = (defined?(rec.mobilebrand) && rec.mobilebrand != '') ? rec.mobilebrand : FIELD_NOT_SUPPORTED
|
96
|
+
elevation = (defined?(rec.elevation) && rec.elevation != '') ? rec.elevation : FIELD_NOT_SUPPORTED
|
97
|
+
usagetype = (defined?(rec.usagetype) && rec.usagetype != '') ? rec.usagetype : FIELD_NOT_SUPPORTED
|
98
|
+
else
|
99
|
+
country_short = INVALID_IP_ADDRESS
|
100
|
+
country_long = INVALID_IP_ADDRESS
|
101
|
+
region = INVALID_IP_ADDRESS
|
102
|
+
city = INVALID_IP_ADDRESS
|
103
|
+
latitude = INVALID_IP_ADDRESS
|
104
|
+
longitude = INVALID_IP_ADDRESS
|
105
|
+
isp = INVALID_IP_ADDRESS
|
106
|
+
domain = INVALID_IP_ADDRESS
|
107
|
+
netspeed = INVALID_IP_ADDRESS
|
108
|
+
areacode = INVALID_IP_ADDRESS
|
109
|
+
iddcode = INVALID_IP_ADDRESS
|
110
|
+
timezone = INVALID_IP_ADDRESS
|
111
|
+
zipcode = INVALID_IP_ADDRESS
|
112
|
+
weatherstationname = INVALID_IP_ADDRESS
|
113
|
+
weatherstationcode = INVALID_IP_ADDRESS
|
114
|
+
mcc = INVALID_IP_ADDRESS
|
115
|
+
mnc = INVALID_IP_ADDRESS
|
116
|
+
mobilebrand = INVALID_IP_ADDRESS
|
117
|
+
elevation = INVALID_IP_ADDRESS
|
118
|
+
usagetype = INVALID_IP_ADDRESS
|
119
|
+
end
|
120
|
+
else
|
121
|
+
country_short = INVALID_IP_ADDRESS
|
122
|
+
country_long = INVALID_IP_ADDRESS
|
123
|
+
region = INVALID_IP_ADDRESS
|
124
|
+
city = INVALID_IP_ADDRESS
|
125
|
+
latitude = INVALID_IP_ADDRESS
|
126
|
+
longitude = INVALID_IP_ADDRESS
|
127
|
+
isp = INVALID_IP_ADDRESS
|
128
|
+
domain = INVALID_IP_ADDRESS
|
129
|
+
netspeed = INVALID_IP_ADDRESS
|
130
|
+
areacode = INVALID_IP_ADDRESS
|
131
|
+
iddcode = INVALID_IP_ADDRESS
|
132
|
+
timezone = INVALID_IP_ADDRESS
|
133
|
+
zipcode = INVALID_IP_ADDRESS
|
134
|
+
weatherstationname = INVALID_IP_ADDRESS
|
135
|
+
weatherstationcode = INVALID_IP_ADDRESS
|
136
|
+
mcc = INVALID_IP_ADDRESS
|
137
|
+
mnc = INVALID_IP_ADDRESS
|
138
|
+
mobilebrand = INVALID_IP_ADDRESS
|
139
|
+
elevation = INVALID_IP_ADDRESS
|
140
|
+
usagetype = INVALID_IP_ADDRESS
|
141
|
+
end
|
142
|
+
results = {}
|
143
|
+
results['country_short'] = country_short
|
144
|
+
results['country_long'] = country_long
|
145
|
+
results['region'] = region
|
146
|
+
results['city'] = city
|
147
|
+
results['latitude'] = latitude
|
148
|
+
results['longitude'] = longitude
|
149
|
+
results['isp'] = isp
|
150
|
+
results['domain'] = domain
|
151
|
+
results['netspeed'] = netspeed
|
152
|
+
results['areacode'] = areacode
|
153
|
+
results['iddcode'] = iddcode
|
154
|
+
results['timezone'] = timezone
|
155
|
+
results['zipcode'] = zipcode
|
156
|
+
results['weatherstationname'] = weatherstationname
|
157
|
+
results['weatherstationcode'] = weatherstationcode
|
158
|
+
results['mcc'] = mcc
|
159
|
+
results['mnc'] = mnc
|
160
|
+
results['mobilebrand'] = mobilebrand
|
161
|
+
results['elevation'] = elevation
|
162
|
+
results['usagetype'] = usagetype
|
163
|
+
return results
|
164
|
+
end
|
165
|
+
|
59
166
|
def get_country_short(ip)
|
60
|
-
|
61
|
-
|
167
|
+
valid = !(IPAddr.new(ip) rescue nil).nil?
|
168
|
+
if valid
|
169
|
+
rec = get_record(ip)
|
170
|
+
if !(rec.nil?)
|
171
|
+
country_short = (defined?(rec.country_short) && rec.country_short != '') ? rec.country_short : FIELD_NOT_SUPPORTED
|
172
|
+
else
|
173
|
+
country_short = INVALID_IP_ADDRESS
|
174
|
+
end
|
175
|
+
else
|
176
|
+
country_short = INVALID_IP_ADDRESS
|
177
|
+
end
|
178
|
+
return country_short
|
62
179
|
end
|
63
|
-
|
180
|
+
|
64
181
|
def get_country_long(ip)
|
65
|
-
|
66
|
-
|
182
|
+
valid = !(IPAddr.new(ip) rescue nil).nil?
|
183
|
+
if valid
|
184
|
+
rec = get_record(ip)
|
185
|
+
if !(rec.nil?)
|
186
|
+
country_long = (defined?(rec.country_long) && rec.country_long != '') ? rec.country_long : FIELD_NOT_SUPPORTED
|
187
|
+
else
|
188
|
+
country_long = INVALID_IP_ADDRESS
|
189
|
+
end
|
190
|
+
else
|
191
|
+
country_long = INVALID_IP_ADDRESS
|
192
|
+
end
|
193
|
+
return country_long
|
67
194
|
end
|
68
|
-
|
195
|
+
|
69
196
|
def get_region(ip)
|
70
|
-
|
71
|
-
|
197
|
+
valid = !(IPAddr.new(ip) rescue nil).nil?
|
198
|
+
if valid
|
199
|
+
rec = get_record(ip)
|
200
|
+
if !(rec.nil?)
|
201
|
+
region = (defined?(rec.region) && rec.region != '') ? rec.region : FIELD_NOT_SUPPORTED
|
202
|
+
else
|
203
|
+
region = INVALID_IP_ADDRESS
|
204
|
+
end
|
205
|
+
else
|
206
|
+
region = INVALID_IP_ADDRESS
|
207
|
+
end
|
208
|
+
return region
|
72
209
|
end
|
73
|
-
|
210
|
+
|
74
211
|
def get_city(ip)
|
75
|
-
|
76
|
-
|
212
|
+
valid = !(IPAddr.new(ip) rescue nil).nil?
|
213
|
+
if valid
|
214
|
+
rec = get_record(ip)
|
215
|
+
if !(rec.nil?)
|
216
|
+
city = (defined?(rec.city) && rec.city != '') ? rec.city : FIELD_NOT_SUPPORTED
|
217
|
+
else
|
218
|
+
city = INVALID_IP_ADDRESS
|
219
|
+
end
|
220
|
+
else
|
221
|
+
city = INVALID_IP_ADDRESS
|
222
|
+
end
|
223
|
+
return city
|
77
224
|
end
|
78
|
-
|
225
|
+
|
79
226
|
def get_latitude(ip)
|
80
|
-
|
81
|
-
|
227
|
+
valid = !(IPAddr.new(ip) rescue nil).nil?
|
228
|
+
if valid
|
229
|
+
rec = get_record(ip)
|
230
|
+
if !(rec.nil?)
|
231
|
+
latitude = (defined?(rec.latitude) && rec.latitude != '') ? rec.latitude : FIELD_NOT_SUPPORTED
|
232
|
+
else
|
233
|
+
latitude = INVALID_IP_ADDRESS
|
234
|
+
end
|
235
|
+
else
|
236
|
+
latitude = INVALID_IP_ADDRESS
|
237
|
+
end
|
238
|
+
return latitude
|
82
239
|
end
|
83
|
-
|
240
|
+
|
84
241
|
def get_longitude(ip)
|
85
|
-
|
86
|
-
|
242
|
+
valid = !(IPAddr.new(ip) rescue nil).nil?
|
243
|
+
if valid
|
244
|
+
rec = get_record(ip)
|
245
|
+
if !(rec.nil?)
|
246
|
+
longitude = (defined?(rec.longitude) && rec.longitude != '') ? rec.longitude : FIELD_NOT_SUPPORTED
|
247
|
+
else
|
248
|
+
longitude = INVALID_IP_ADDRESS
|
249
|
+
end
|
250
|
+
else
|
251
|
+
longitude = INVALID_IP_ADDRESS
|
252
|
+
end
|
253
|
+
return longitude
|
87
254
|
end
|
88
|
-
|
255
|
+
|
89
256
|
def get_isp(ip)
|
90
|
-
|
91
|
-
|
257
|
+
valid = !(IPAddr.new(ip) rescue nil).nil?
|
258
|
+
if valid
|
259
|
+
rec = get_record(ip)
|
260
|
+
if !(rec.nil?)
|
261
|
+
isp = (defined?(rec.isp) && rec.isp != '') ? rec.isp : FIELD_NOT_SUPPORTED
|
262
|
+
else
|
263
|
+
isp = INVALID_IP_ADDRESS
|
264
|
+
end
|
265
|
+
else
|
266
|
+
isp = INVALID_IP_ADDRESS
|
267
|
+
end
|
268
|
+
return isp
|
92
269
|
end
|
93
|
-
|
270
|
+
|
94
271
|
def get_domain(ip)
|
95
|
-
|
96
|
-
|
272
|
+
valid = !(IPAddr.new(ip) rescue nil).nil?
|
273
|
+
if valid
|
274
|
+
rec = get_record(ip)
|
275
|
+
if !(rec.nil?)
|
276
|
+
domain = (defined?(rec.domain) && rec.domain != '') ? rec.domain : FIELD_NOT_SUPPORTED
|
277
|
+
else
|
278
|
+
domain = INVALID_IP_ADDRESS
|
279
|
+
end
|
280
|
+
else
|
281
|
+
domain = INVALID_IP_ADDRESS
|
282
|
+
end
|
283
|
+
return domain
|
97
284
|
end
|
98
|
-
|
285
|
+
|
99
286
|
def get_zipcode(ip)
|
100
|
-
|
101
|
-
|
287
|
+
valid = !(IPAddr.new(ip) rescue nil).nil?
|
288
|
+
if valid
|
289
|
+
rec = get_record(ip)
|
290
|
+
if !(rec.nil?)
|
291
|
+
zipcode = (defined?(rec.zipcode) && rec.zipcode != '') ? rec.zipcode : FIELD_NOT_SUPPORTED
|
292
|
+
else
|
293
|
+
zipcode = INVALID_IP_ADDRESS
|
294
|
+
end
|
295
|
+
else
|
296
|
+
zipcode = INVALID_IP_ADDRESS
|
297
|
+
end
|
298
|
+
return zipcode
|
102
299
|
end
|
103
|
-
|
300
|
+
|
104
301
|
def get_timezone(ip)
|
105
|
-
|
106
|
-
|
302
|
+
valid = !(IPAddr.new(ip) rescue nil).nil?
|
303
|
+
if valid
|
304
|
+
rec = get_record(ip)
|
305
|
+
if !(rec.nil?)
|
306
|
+
timezone = (defined?(rec.timezone) && rec.timezone != '') ? rec.timezone : FIELD_NOT_SUPPORTED
|
307
|
+
else
|
308
|
+
timezone = INVALID_IP_ADDRESS
|
309
|
+
end
|
310
|
+
else
|
311
|
+
timezone = INVALID_IP_ADDRESS
|
312
|
+
end
|
313
|
+
return timezone
|
107
314
|
end
|
108
|
-
|
315
|
+
|
109
316
|
def get_netspeed(ip)
|
110
|
-
|
111
|
-
|
317
|
+
valid = !(IPAddr.new(ip) rescue nil).nil?
|
318
|
+
if valid
|
319
|
+
rec = get_record(ip)
|
320
|
+
if !(rec.nil?)
|
321
|
+
netspeed = (defined?(rec.netspeed) && rec.netspeed != '') ? rec.netspeed : FIELD_NOT_SUPPORTED
|
322
|
+
else
|
323
|
+
netspeed = INVALID_IP_ADDRESS
|
324
|
+
end
|
325
|
+
else
|
326
|
+
netspeed = INVALID_IP_ADDRESS
|
327
|
+
end
|
328
|
+
return netspeed
|
112
329
|
end
|
113
|
-
|
330
|
+
|
114
331
|
def get_iddcode(ip)
|
115
|
-
|
116
|
-
|
332
|
+
valid = !(IPAddr.new(ip) rescue nil).nil?
|
333
|
+
if valid
|
334
|
+
rec = get_record(ip)
|
335
|
+
if !(rec.nil?)
|
336
|
+
iddcode = (defined?(rec.iddcode) && rec.iddcode != '') ? rec.iddcode : FIELD_NOT_SUPPORTED
|
337
|
+
else
|
338
|
+
iddcode = INVALID_IP_ADDRESS
|
339
|
+
end
|
340
|
+
else
|
341
|
+
iddcode = INVALID_IP_ADDRESS
|
342
|
+
end
|
343
|
+
return iddcode
|
117
344
|
end
|
118
|
-
|
345
|
+
|
119
346
|
def get_areacode(ip)
|
120
|
-
|
121
|
-
|
347
|
+
valid = !(IPAddr.new(ip) rescue nil).nil?
|
348
|
+
if valid
|
349
|
+
rec = get_record(ip)
|
350
|
+
if !(rec.nil?)
|
351
|
+
areacode = (defined?(rec.areacode) && rec.areacode != '') ? rec.areacode : FIELD_NOT_SUPPORTED
|
352
|
+
else
|
353
|
+
areacode = INVALID_IP_ADDRESS
|
354
|
+
end
|
355
|
+
else
|
356
|
+
areacode = INVALID_IP_ADDRESS
|
357
|
+
end
|
358
|
+
return areacode
|
122
359
|
end
|
123
|
-
|
360
|
+
|
124
361
|
def get_weatherstationcode(ip)
|
125
|
-
|
126
|
-
|
362
|
+
valid = !(IPAddr.new(ip) rescue nil).nil?
|
363
|
+
if valid
|
364
|
+
rec = get_record(ip)
|
365
|
+
if !(rec.nil?)
|
366
|
+
weatherstationcode = (defined?(rec.weatherstationcode) && rec.weatherstationcode != '') ? rec.weatherstationcode : FIELD_NOT_SUPPORTED
|
367
|
+
else
|
368
|
+
weatherstationcode = INVALID_IP_ADDRESS
|
369
|
+
end
|
370
|
+
else
|
371
|
+
weatherstationcode = INVALID_IP_ADDRESS
|
372
|
+
end
|
373
|
+
return weatherstationcode
|
127
374
|
end
|
128
|
-
|
375
|
+
|
129
376
|
def get_weatherstationname(ip)
|
130
|
-
|
131
|
-
|
377
|
+
valid = !(IPAddr.new(ip) rescue nil).nil?
|
378
|
+
if valid
|
379
|
+
rec = get_record(ip)
|
380
|
+
if !(rec.nil?)
|
381
|
+
weatherstationname = (defined?(rec.weatherstationname) && rec.weatherstationname != '') ? rec.weatherstationname : FIELD_NOT_SUPPORTED
|
382
|
+
else
|
383
|
+
weatherstationname = INVALID_IP_ADDRESS
|
384
|
+
end
|
385
|
+
else
|
386
|
+
weatherstationname = INVALID_IP_ADDRESS
|
387
|
+
end
|
388
|
+
return weatherstationname
|
132
389
|
end
|
133
|
-
|
390
|
+
|
134
391
|
def get_mcc(ip)
|
135
|
-
|
136
|
-
|
392
|
+
valid = !(IPAddr.new(ip) rescue nil).nil?
|
393
|
+
if valid
|
394
|
+
rec = get_record(ip)
|
395
|
+
if !(rec.nil?)
|
396
|
+
mcc = (defined?(rec.mcc) && rec.mcc != '') ? rec.mcc : FIELD_NOT_SUPPORTED
|
397
|
+
else
|
398
|
+
mcc = INVALID_IP_ADDRESS
|
399
|
+
end
|
400
|
+
else
|
401
|
+
mcc = INVALID_IP_ADDRESS
|
402
|
+
end
|
403
|
+
return mcc
|
137
404
|
end
|
138
|
-
|
405
|
+
|
139
406
|
def get_mnc(ip)
|
140
|
-
|
141
|
-
|
407
|
+
valid = !(IPAddr.new(ip) rescue nil).nil?
|
408
|
+
if valid
|
409
|
+
rec = get_record(ip)
|
410
|
+
if !(rec.nil?)
|
411
|
+
mnc = (defined?(mnc) && rec.mnc != '') ? rec.mnc : FIELD_NOT_SUPPORTED
|
412
|
+
else
|
413
|
+
mnc = INVALID_IP_ADDRESS
|
414
|
+
end
|
415
|
+
else
|
416
|
+
mnc = INVALID_IP_ADDRESS
|
417
|
+
end
|
418
|
+
return mnc
|
142
419
|
end
|
143
|
-
|
420
|
+
|
144
421
|
def get_mobilebrand(ip)
|
145
|
-
|
146
|
-
|
422
|
+
valid = !(IPAddr.new(ip) rescue nil).nil?
|
423
|
+
if valid
|
424
|
+
rec = get_record(ip)
|
425
|
+
if !(rec.nil?)
|
426
|
+
mobilebrand = (defined?(rec.mobilebrand) && rec.mobilebrand != '') ? rec.mobilebrand : FIELD_NOT_SUPPORTED
|
427
|
+
else
|
428
|
+
mobilebrand = INVALID_IP_ADDRESS
|
429
|
+
end
|
430
|
+
else
|
431
|
+
mobilebrand = INVALID_IP_ADDRESS
|
432
|
+
end
|
433
|
+
return mobilebrand
|
147
434
|
end
|
148
|
-
|
435
|
+
|
149
436
|
def get_elevation(ip)
|
150
|
-
|
151
|
-
|
437
|
+
valid = !(IPAddr.new(ip) rescue nil).nil?
|
438
|
+
if valid
|
439
|
+
rec = get_record(ip)
|
440
|
+
if !(rec.nil?)
|
441
|
+
elevation = (defined?(rec.elevation) && rec.elevation != '') ? rec.elevation : FIELD_NOT_SUPPORTED
|
442
|
+
else
|
443
|
+
elevation = INVALID_IP_ADDRESS
|
444
|
+
end
|
445
|
+
else
|
446
|
+
elevation = INVALID_IP_ADDRESS
|
447
|
+
end
|
448
|
+
return elevation
|
152
449
|
end
|
153
|
-
|
450
|
+
|
154
451
|
def get_usagetype(ip)
|
155
|
-
|
156
|
-
|
452
|
+
valid = !(IPAddr.new(ip) rescue nil).nil?
|
453
|
+
if valid
|
454
|
+
rec = get_record(ip)
|
455
|
+
if !(rec.nil?)
|
456
|
+
usagetype = (defined?(rec.usagetype) && rec.usagetype != '') ? rec.usagetype : FIELD_NOT_SUPPORTED
|
457
|
+
else
|
458
|
+
usagetype = INVALID_IP_ADDRESS
|
459
|
+
end
|
460
|
+
else
|
461
|
+
usagetype = INVALID_IP_ADDRESS
|
462
|
+
end
|
463
|
+
return usagetype
|
157
464
|
end
|
158
|
-
|
465
|
+
|
159
466
|
def bsearch(low, high, ipnum, base_addr, col_length)
|
160
467
|
while low <= high do
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
end
|
180
|
-
|
468
|
+
mid = (low + high) >> 1
|
469
|
+
ip_from, ip_to = get_from_to(mid, base_addr, col_length)
|
470
|
+
if ipnum >= ip_from && ipnum < ip_to
|
471
|
+
from_base = ( base_addr + mid * (col_length + (self.v4 ? 0 : 12)))
|
472
|
+
file.seek(from_base)
|
473
|
+
if v4
|
474
|
+
return self.record_class4.read(file)
|
475
|
+
else
|
476
|
+
return self.record_class6.read(file)
|
477
|
+
end
|
478
|
+
else
|
479
|
+
if ipnum < ip_from
|
480
|
+
high = mid - 1
|
481
|
+
else
|
482
|
+
low = mid + 1
|
483
|
+
end
|
484
|
+
end
|
485
|
+
end
|
486
|
+
end
|
487
|
+
|
181
488
|
def get_from_to(mid, base_addr, col_length)
|
182
489
|
from_base = ( base_addr + mid * (col_length + (v4 ? 0 : 12)))
|
183
490
|
file.seek(from_base)
|
184
|
-
|
491
|
+
ip_from = v4 ? file.read(4).unpack('V').first : readipv6(file)
|
185
492
|
file.seek(from_base + col_length + (v4 ? 0 : 12))
|
186
|
-
|
493
|
+
ip_to = v4 ? file.read(4).unpack('V').first : readipv6(file)
|
187
494
|
[ip_from, ip_to]
|
188
495
|
end
|
189
|
-
|
496
|
+
|
497
|
+
def validateip(ip)
|
498
|
+
if ip.ipv4?
|
499
|
+
ipv = 4
|
500
|
+
ipnum = ip.to_i + 0
|
501
|
+
else
|
502
|
+
ipv = 6
|
503
|
+
ipnum = ip.to_i + 0
|
504
|
+
#reformat ipv4 address in ipv6
|
505
|
+
if ipnum >= 281470681743360 && ipnum <= 281474976710655
|
506
|
+
ipv = 4
|
507
|
+
ipnum = ipnum - 281470681743360
|
508
|
+
end
|
509
|
+
#reformat 6to4 address to ipv4 address 2002:: to 2002:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF
|
510
|
+
if ipnum >= 42545680458834377588178886921629466624 && ipnum <= 42550872755692912415807417417958686719
|
511
|
+
ipv = 4
|
512
|
+
#bitshift right 80 bits
|
513
|
+
ipnum = ipnum >> 80
|
514
|
+
#bitwise modulus to get the last 32 bit
|
515
|
+
ipnum = ipnum % 4294967296
|
516
|
+
end
|
517
|
+
#reformat Teredo address to ipv4 address 2001:0000:: to 2001:0000:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:
|
518
|
+
if ipnum >= 42540488161975842760550356425300246528 && ipnum <= 42540488241204005274814694018844196863
|
519
|
+
ipv = 4
|
520
|
+
#bitwise not to invert binary
|
521
|
+
ipnum = ~ipnum
|
522
|
+
#bitwise modulus to get the last 32 bit
|
523
|
+
ipnum = ipnum % 4294967296
|
524
|
+
end
|
525
|
+
end
|
526
|
+
[ipv, ipnum]
|
527
|
+
end
|
528
|
+
|
190
529
|
def read32(indexp)
|
191
|
-
|
192
|
-
|
530
|
+
file.seek(indexp - 1)
|
531
|
+
return file.read(4).unpack('V').first
|
193
532
|
end
|
194
|
-
|
533
|
+
|
195
534
|
def readipv6(filer)
|
196
|
-
|
197
|
-
|
535
|
+
parts = filer.read(16).unpack('V*')
|
536
|
+
return parts[0] + parts[1] * 4294967296 + parts[2] * 4294967296**2 + parts[3] * 4294967296**3
|
537
|
+
end
|
538
|
+
|
539
|
+
private :get_record, :bsearch, :get_from_to, :read32, :readipv6
|
540
|
+
end
|
541
|
+
|
542
|
+
class Ip2locationWebService
|
543
|
+
attr_accessor :ws_api_key, :ws_package, :ws_use_ssl
|
544
|
+
|
545
|
+
def initialize(api_key, package, use_ssl)
|
546
|
+
if !api_key.match(/^[0-9A-Z]{10}$/) && api_key != 'demo'
|
547
|
+
raise Exception.new "Please provide a valid IP2Location web service API key."
|
548
|
+
end
|
549
|
+
if !package.match(/^WS[0-9]+$/)
|
550
|
+
package = 'WS1'
|
551
|
+
end
|
552
|
+
if use_ssl == ''
|
553
|
+
use_ssl = true
|
554
|
+
end
|
555
|
+
self.ws_api_key = api_key
|
556
|
+
self.ws_package = package
|
557
|
+
self.ws_use_ssl = use_ssl
|
558
|
+
end
|
559
|
+
|
560
|
+
def lookup(ip, add_ons, language)
|
561
|
+
if self.ws_use_ssl
|
562
|
+
response = Net::HTTP.get(URI("https://api.ip2location.com/v2/?key=" + self.ws_api_key + "&ip=" + ip + "&package=" + self.ws_package + "&format=json&addon=" + add_ons + "&lang=" + language))
|
563
|
+
else
|
564
|
+
response = Net::HTTP.get(URI("http://api.ip2location.com/v2/?key=" + self.ws_api_key + "&ip=" + ip + "&package=" + self.ws_package + "&format=json&addon=" + add_ons + "&lang=" + language))
|
565
|
+
end
|
566
|
+
parsed_response = JSON.parse(response)
|
567
|
+
if parsed_response.nil?
|
568
|
+
return false
|
569
|
+
end
|
570
|
+
if !parsed_response["response"].nil?
|
571
|
+
raise Exception.new "Error: " + parsed_response["response"]
|
572
|
+
end
|
573
|
+
return parsed_response
|
574
|
+
end
|
575
|
+
|
576
|
+
def get_credit()
|
577
|
+
if self.ws_use_ssl
|
578
|
+
response = Net::HTTP.get(URI("https://api.ip2location.com/v2/?key=" + self.ws_api_key + "&check=true"))
|
579
|
+
else
|
580
|
+
response = Net::HTTP.get(URI("http://api.ip2location.com/v2/?key=" + self.ws_api_key + "&check=true"))
|
581
|
+
end
|
582
|
+
parsed_response = JSON.parse(response)
|
583
|
+
if parsed_response.nil?
|
584
|
+
return 0
|
585
|
+
end
|
586
|
+
if parsed_response["response"].nil?
|
587
|
+
return 0
|
588
|
+
end
|
589
|
+
return parsed_response["response"]
|
198
590
|
end
|
199
|
-
|
200
591
|
end
|
Binary 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.
|
4
|
+
version: 8.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- ip2location
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bindata
|
@@ -117,14 +117,17 @@ executables: []
|
|
117
117
|
extensions: []
|
118
118
|
extra_rdoc_files:
|
119
119
|
- LICENSE.txt
|
120
|
+
- README.md
|
120
121
|
files:
|
121
122
|
- ".document"
|
122
123
|
- ".rspec"
|
123
124
|
- Gemfile
|
124
125
|
- Gemfile.lock
|
125
126
|
- LICENSE.txt
|
127
|
+
- README.md
|
126
128
|
- Rakefile
|
127
129
|
- VERSION
|
130
|
+
- example.rb
|
128
131
|
- ip2location_ruby.gemspec
|
129
132
|
- lib/ip2location_ruby.rb
|
130
133
|
- lib/ip2location_ruby/database_config.rb
|
@@ -133,6 +136,7 @@ files:
|
|
133
136
|
- lib/ip2location_ruby/i2l_string_data.rb
|
134
137
|
- lib/ip2location_ruby/ip2location_config.rb
|
135
138
|
- lib/ip2location_ruby/ip2location_record.rb
|
139
|
+
- rb/data/IP2LOCATION-LITE-DB1.IPV6.BIN
|
136
140
|
- spec/assets/DB24.DEMO4.BIN
|
137
141
|
- spec/assets/DB24.DEMO6.BIN
|
138
142
|
- spec/assets/IP-COUNTRY-SAMPLE.BIN
|
@@ -143,6 +147,7 @@ licenses:
|
|
143
147
|
- MIT
|
144
148
|
metadata:
|
145
149
|
bug_tracker_uri: https://github.com/ip2location/ip2location-ruby/issues
|
150
|
+
documentation_uri: https://www.rubydoc.info/gems/ip2location_ruby
|
146
151
|
homepage_uri: https://www.ip2location.com
|
147
152
|
source_code_uri: https://github.com/ip2location/ip2location-ruby
|
148
153
|
post_install_message:
|
@@ -161,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
161
166
|
version: '0'
|
162
167
|
requirements: []
|
163
168
|
rubyforge_project:
|
164
|
-
rubygems_version: 2.7.
|
169
|
+
rubygems_version: 2.7.6.2
|
165
170
|
signing_key:
|
166
171
|
specification_version: 4
|
167
172
|
summary: the ip2location ruby library
|