Sha256: 176e5a8b086e08c7e80360e58c913d05d23bfdb06136fc2c49ef3729256e781c

Contents?: true

Size: 323 Bytes

Versions: 52

Compression:

Stored size: 323 Bytes

Contents

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

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
skylight-6.1.0.beta lib/skylight/util/hostname.rb
skylight-6.0.4 lib/skylight/util/hostname.rb
skylight-6.0.3 lib/skylight/util/hostname.rb
skylight-5.3.5 lib/skylight/util/hostname.rb
skylight-6.0.2 lib/skylight/util/hostname.rb
skylight-6.0.1 lib/skylight/util/hostname.rb
skylight-6.0.0 lib/skylight/util/hostname.rb
skylight-6.0.0.beta2 lib/skylight/util/hostname.rb
skylight-6.0.0.beta lib/skylight/util/hostname.rb
skylight-5.3.4 lib/skylight/util/hostname.rb
skylight-5.3.3 lib/skylight/util/hostname.rb
skylight-5.3.2 lib/skylight/util/hostname.rb
skylight-5.3.1 lib/skylight/util/hostname.rb
skylight-5.3.0 lib/skylight/util/hostname.rb
skylight-5.2.0 lib/skylight/util/hostname.rb
skylight-5.2.0.beta2 lib/skylight/util/hostname.rb
skylight-5.2.0.beta lib/skylight/util/hostname.rb
skylight-5.1.1 lib/skylight/util/hostname.rb
skylight-5.1.0.beta3 lib/skylight/util/hostname.rb
skylight-5.1.0.beta2 lib/skylight/util/hostname.rb