nx-real-ip 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nx/real-ip.rb +7 -1
- data/lib/nx/version.rb +1 -1
- data/nx-real-ip-0.1.3.gem +0 -0
- data/package.json +24 -0
- metadata +3 -2
- data/nx-real-ip-0.1.2.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcf5c22f2009789090e6e52d6046a871b7917e8e341f698d7a2ff43024839132
|
4
|
+
data.tar.gz: 3a61e74bdcf0bb9ce8ef71d13bd6e090d689730f03fbe3263a45770ef445445c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a11fb0894a94e8f96f229793251cea81db1cd7366e9e7319e6211da8e5e543a3c560698535dbc874d9c6c03e1f43dcd27d2b8e6313b8fdd83020fe8fa02e0776
|
7
|
+
data.tar.gz: 9c7e497623d1becbeba9c2f83a4a8dbdd18a09646d1aeeefd0a009017ac360a229114912f617d9b00d30d42e1b630596558eb42519099eaed69fa2fc40718de3
|
data/lib/nx/real-ip.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
require "open-uri"
|
2
2
|
|
3
|
+
RE_IP_ADDRESS = /\b\d+\.\d+\.\d+\.\d+\b/
|
4
|
+
|
3
5
|
module Nx
|
4
6
|
class RealIp
|
5
7
|
def self.get(args = { timeout: 5, proxy: nil })
|
@@ -10,7 +12,11 @@ module Nx
|
|
10
12
|
proxy: args[:proxy],
|
11
13
|
).read
|
12
14
|
|
13
|
-
real_ip
|
15
|
+
if RE_IP_ADDRESS.match? real_ip
|
16
|
+
real_ip.strip
|
17
|
+
else
|
18
|
+
nil
|
19
|
+
end
|
14
20
|
end
|
15
21
|
end
|
16
22
|
end
|
data/lib/nx/version.rb
CHANGED
Binary file
|
data/package.json
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
{
|
2
|
+
"name": "nx-real-ip",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "> Get real ip address.",
|
5
|
+
"directories": {
|
6
|
+
"lib": "lib"
|
7
|
+
},
|
8
|
+
"scripts": {
|
9
|
+
"clean": "rm -rf *.gem",
|
10
|
+
"build": "gem build *.gemspec",
|
11
|
+
"pubpush": "gem push *.gem"
|
12
|
+
},
|
13
|
+
"repository": {
|
14
|
+
"type": "git",
|
15
|
+
"url": "git+https://github.com/afeiship/nx-real-ip.git"
|
16
|
+
},
|
17
|
+
"keywords": [],
|
18
|
+
"author": "",
|
19
|
+
"license": "ISC",
|
20
|
+
"bugs": {
|
21
|
+
"url": "https://github.com/afeiship/nx-real-ip/issues"
|
22
|
+
},
|
23
|
+
"homepage": "https://github.com/afeiship/nx-real-ip#readme"
|
24
|
+
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nx-real-ip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- afeiship
|
@@ -60,8 +60,9 @@ files:
|
|
60
60
|
- lib/nx-real-ip.rb
|
61
61
|
- lib/nx/real-ip.rb
|
62
62
|
- lib/nx/version.rb
|
63
|
-
- nx-real-ip-0.1.
|
63
|
+
- nx-real-ip-0.1.3.gem
|
64
64
|
- nx-real-ip.gemspec
|
65
|
+
- package.json
|
65
66
|
homepage: https://github.com/afeiship/nx-real-ip
|
66
67
|
licenses:
|
67
68
|
- MIT
|
data/nx-real-ip-0.1.2.gem
DELETED
Binary file
|