ksconnect 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ksconnect/helpers.rb +4 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a505bbbcecb0dd7e64773f05cd2ebd1c0c8a8ca8
|
4
|
+
data.tar.gz: 627e5470e67045f5b80e4348246e1096739e90c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2329d4fa03f93cc92ec997b9640b3c8a982d115543dd7d775e2ba081f784ba70154a7ea1f1700b02eda5a23173f20df59719861a4fc582086de5dfa122a5ecff
|
7
|
+
data.tar.gz: 4fe484ed83632293487e7bc7c4ba987cdd6648bcb0e68e5e50df083dbd05cef5dbbcae3ab9b1d7e0d797586c6443572ab3b53807a97b289ac1e507303bf3475c
|
data/lib/ksconnect/helpers.rb
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
require 'active_support/core_ext/object/try'
|
2
|
+
require 'resolv'
|
2
3
|
|
3
4
|
class KSConnect
|
4
5
|
module Helpers
|
5
6
|
def ip_address_for(domain_name)
|
6
7
|
if all_domains[domain_name]
|
7
|
-
all_domains[domain_name].ip_address
|
8
|
+
ip = all_domains[domain_name].ip_address
|
9
|
+
Resolv::IPv4::Regex.match(ip) ? ip : "kloudsec.com" # go to something safe if ip is invalid
|
8
10
|
else
|
9
|
-
"kloudsec.com" # go to something safe if
|
11
|
+
"kloudsec.com" # go to something safe if domain is missing
|
10
12
|
end
|
11
13
|
end
|
12
14
|
|