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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4cf7641a9cdffd70afad1721300c25a25e43aa60c4fc123be5bf3aa8d088f2a1
4
- data.tar.gz: 6449f691a5d3c7549b7373b39e6e65f59634bf612554f7fe05014b42e81fb0d8
3
+ metadata.gz: 422a1808047ab36a12a98064a2035d4c1a66e08f2cde1955827c0bbf3102967c
4
+ data.tar.gz: e187103a9d68a16cefaf892debc023f3bb7322ca7374851ba3ecc2146368ba57
5
5
  SHA512:
6
- metadata.gz: 6cad346e866c41bfaec9e776a82661f6fcd9530104427f22064ea21285ff318c45ea3a5a42b92e67ade6d04f83de5761cddc4dedec3edc420be9c85befc05792
7
- data.tar.gz: effd14501f9988ee5c5d2e5c00b059f73fd292429fb512a17c7f43542b9e3f032697cab8c00bf07ae7493c86ea5f186797cf214b11af47c1f4085e5f593e8e1c
6
+ metadata.gz: e10fb1dbba9454c3ac98ee6534113d9fb3b944e2ea0b23524f05d9a1dc4c5ff3482cabb8adeed7aa655df49a6f4a53d08e345d09bd9152e84053c6df69fbfec5
7
+ data.tar.gz: df0cfd8d3eb1998b80064e378eb8766763f954164da4d7065451438bf0aad99d7f63d998ff60aa99b59ef7d46f7602cc03772e1d5b7c0f3d7b84605b1a8667cc
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ip2region (0.1.0)
4
+ ip2region (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
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 文件
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ip2region
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
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.0
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-14 00:00:00.000000000 Z
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.6.0
46
+ version: 2.4.0
47
47
  required_rubygems_version: !ruby/object:Gem::Requirement
48
48
  requirements:
49
49
  - - ">="