ksconnect 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ksconnect/helpers.rb +4 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1d91fc4dd993ead89d5e76a124852edf2a6090b8
4
- data.tar.gz: e4af39026299c2e5652396a489c7c0c373d7f87c
3
+ metadata.gz: a505bbbcecb0dd7e64773f05cd2ebd1c0c8a8ca8
4
+ data.tar.gz: 627e5470e67045f5b80e4348246e1096739e90c6
5
5
  SHA512:
6
- metadata.gz: 1aef855195621760ce29beb37fb2f8c383877fc5a770c3627b98b2c67e87da71931803948def0791199efcd00b4b6346b78bb6f53f34d4f3850c2da33eee5288
7
- data.tar.gz: 863962b0a6c006e814dd5b6d810222be3541db1804f4c1b027a2cf50cdcf546b0e10085292b5b4875f8368fdd0503462a93d649780560e600a50b462e950b271
6
+ metadata.gz: 2329d4fa03f93cc92ec997b9640b3c8a982d115543dd7d775e2ba081f784ba70154a7ea1f1700b02eda5a23173f20df59719861a4fc582086de5dfa122a5ecff
7
+ data.tar.gz: 4fe484ed83632293487e7bc7c4ba987cdd6648bcb0e68e5e50df083dbd05cef5dbbcae3ab9b1d7e0d797586c6443572ab3b53807a97b289ac1e507303bf3475c
@@ -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 ip is invalid
11
+ "kloudsec.com" # go to something safe if domain is missing
10
12
  end
11
13
  end
12
14
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ksconnect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Poon