(#24) Improve 'get' output

This commit updates how hosts are formated when shown to the user. It
applies a domain to each hostname instead of being a different key.
This commit is contained in:
Brian Cain 2016-07-02 11:39:19 -07:00
parent 06206456c7
commit a6c5f1dceb
4 changed files with 13 additions and 6 deletions

View file

@ -8,10 +8,15 @@ class Utils
host_hash = {}
hostname_hash.delete("ok")
domain = hostname_hash["domain"]
hostname_hash.each do |type, hosts|
if type == "domain"
host_hash[type] = hosts
else
if type != "domain"
if hosts["hostname"].kind_of?(Array)
hosts["hostname"].map!{|host| host + "." + domain }
else
hosts["hostname"] = hosts["hostname"] + "." + domain
end
host_hash[type] = hosts["hostname"]
end
end

View file

@ -1,6 +1,6 @@
class Version
@version = '0.3.1'
@version = '0.4.0'
def self.get
@version