Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/core.rb

Instance Method Summary collapse

Instance Method Details

#replace_with_ip!Object



27
28
29
30
31
32
33
34
35
36
# File 'lib/core.rb', line 27

def replace_with_ip!
  host = self.split(/:/).first

  ip = timeout(5) { Resolv.getaddress(host) }

  self.replace(self.gsub(host, ip))
rescue Exception
  puts "Error resolving #{host}"
  exit
end