Class: String

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

Instance Method Summary collapse

Instance Method Details

#replace_with_ip!Object



32
33
34
35
36
37
38
39
40
41
# File 'lib/core.rb', line 32

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}"
  raise
end