ip2region 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +14 -2
- data/lib/ip2region/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 422a1808047ab36a12a98064a2035d4c1a66e08f2cde1955827c0bbf3102967c
|
4
|
+
data.tar.gz: e187103a9d68a16cefaf892debc023f3bb7322ca7374851ba3ecc2146368ba57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e10fb1dbba9454c3ac98ee6534113d9fb3b944e2ea0b23524f05d9a1dc4c5ff3482cabb8adeed7aa655df49a6f4a53d08e345d09bd9152e84053c6df69fbfec5
|
7
|
+
data.tar.gz: df0cfd8d3eb1998b80064e378eb8766763f954164da4d7065451438bf0aad99d7f63d998ff60aa99b59ef7d46f7602cc03772e1d5b7c0f3d7b84605b1a8667cc
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
为了方便直接搞成 gem 包, 故单独开了个项目
|
10
10
|
|
11
11
|
## 安装
|
12
|
-
gem install ip2region
|
12
|
+
`gem install ip2region`
|
13
13
|
## 使用
|
14
14
|
|
15
15
|
**需要外挂 xdb 文件**
|
@@ -22,12 +22,24 @@ require 'ip2region'
|
|
22
22
|
Ip2region.ip_2_region_path="./ip2region.xdb"
|
23
23
|
|
24
24
|
# 查询
|
25
|
-
Ip2region.search("114.114.114.114
|
25
|
+
Ip2region.search("114.114.114.114")
|
26
26
|
# => "中国|0|江苏省|南京市|0"
|
27
27
|
|
28
28
|
Ip2region.search "127.0.0.1"
|
29
29
|
=> "0|0|0|内网IP|内网IP"
|
30
30
|
|
31
|
+
Ip2region.search("192.168.1.1")
|
32
|
+
=> "0|0|0|内网IP|内网IP"
|
33
|
+
|
34
|
+
|
35
|
+
Ip2region.search("114.114.114.333")
|
36
|
+
# IPAddr::InvalidAddressError: invalid address
|
37
|
+
|
38
|
+
|
39
|
+
# 不支持 ipv6
|
40
|
+
Ip2region.search("24ff:8262:c7f:4dea:81e0:2dff:6f9d:f300")
|
41
|
+
=> nil
|
42
|
+
|
31
43
|
```
|
32
44
|
|
33
45
|
## 如何下载外挂 xdb 文件
|
data/lib/ip2region/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ip2region
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- atpking
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: ip2region ruby version.
|
14
14
|
email:
|
@@ -43,7 +43,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
43
43
|
requirements:
|
44
44
|
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: 2.
|
46
|
+
version: 2.4.0
|
47
47
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
48
48
|
requirements:
|
49
49
|
- - ">="
|