Module: Skylight::Util::Hostname Private

Defined in:
lib/skylight/util/hostname.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Class Method Summary collapse

Class Method Details

.default_hostnameObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



7
8
9
10
11
12
13
14
# File 'lib/skylight/util/hostname.rb', line 7

def self.default_hostname
  if hostname = Socket.gethostname
    hostname.strip!
    hostname = nil if hostname == ''
  end

  hostname || "gen-#{SecureRandom.uuid}"
end