IPinfo 2.4.0 → 2.5.0
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/lib/ipinfo/version.rb +1 -1
- data/lib/ipinfo.rb +17 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7fdee7360c5440bb6a71dcfca62b1b006688952535a1f594c3b9c3105505665b
|
|
4
|
+
data.tar.gz: a177efbb1348e47dfe3ea6c1cdaef9327a33db6b0233db1884b1b27379ed49b5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b4f01041c106a9c69d155ab4981090b94d14cc1637dc2bd522920defb87552640bf8b5e9c540b43e221a76bab8ba961ac7241fe9b602de44167606409440d8c4
|
|
7
|
+
data.tar.gz: 9f7d2ecce9daf619edf12564690a0281f49f8152b1e3159e34d2e43048862cecae4b55c87baae79e21a3b0371d4cbc2ecdeb3549ec6ee16f18f7327a122e401a
|
data/lib/ipinfo/version.rb
CHANGED
data/lib/ipinfo.rb
CHANGED
|
@@ -54,6 +54,23 @@ class IPinfo::IPinfo
|
|
|
54
54
|
details_base(ip_address, :v6)
|
|
55
55
|
end
|
|
56
56
|
|
|
57
|
+
def resproxy(ip_address)
|
|
58
|
+
cache_key_str = "resproxy:#{ip_address}"
|
|
59
|
+
res = @cache.get(cache_key(cache_key_str))
|
|
60
|
+
return Response.new(res) unless res.nil?
|
|
61
|
+
|
|
62
|
+
response = @httpc.get("/resproxy/#{CGI.escape(ip_address)}", :v4)
|
|
63
|
+
|
|
64
|
+
if response.status.eql?(429)
|
|
65
|
+
raise RateLimitError,
|
|
66
|
+
RATE_LIMIT_MESSAGE
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
details = JSON.parse(response.body, symbolize_names: true)
|
|
70
|
+
@cache.set(cache_key(cache_key_str), details)
|
|
71
|
+
Response.new(details)
|
|
72
|
+
end
|
|
73
|
+
|
|
57
74
|
def get_map_url(ips)
|
|
58
75
|
if !ips.kind_of?(Array)
|
|
59
76
|
return JSON.generate({:error => 'Invalid input. Array required!'})
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: IPinfo
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- IPinfo releases
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-01-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|