Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
skylight / lib / skylight / util / hostname.rb
Size: Mime:
require 'socket'
require 'securerandom'

module Skylight
  module Util
    module Hostname
      def self.default_hostname
        if hostname = Socket.gethostname
          hostname.strip!
          hostname = nil if hostname == ''
        end

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