Sha256: f55aadbb02c4149f82d5ad109cae7091d60ddf13a6ef4bd641083bba22d286c5

Contents?: true

Size: 321 Bytes

Versions: 81

Compression:

Stored size: 321 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

81 entries across 81 versions & 2 rubygems

Version Path
skylight-1.6.1 lib/skylight/util/hostname.rb
skylight-2.0.0.beta3 lib/skylight/util/hostname.rb
skylight-1.6.0 lib/skylight/util/hostname.rb
skylight-1.5.1 lib/skylight/util/hostname.rb
skylight-2.0.0.beta2 lib/skylight/util/hostname.rb
skylight-2.0.0.beta1 lib/skylight/util/hostname.rb
skylight-1.5.0 lib/skylight/util/hostname.rb
skylight-1.4.4 lib/skylight/util/hostname.rb
skylight-1.4.3 lib/skylight/util/hostname.rb
skylight-1.4.2 lib/skylight/util/hostname.rb
skylight-1.4.1 lib/skylight/util/hostname.rb
skylight-1.4.0 lib/skylight/util/hostname.rb
skylight-1.4.0.beta.2 lib/skylight/util/hostname.rb
skylight-1.4.0.beta lib/skylight/util/hostname.rb
skylight-1.3.1 lib/skylight/util/hostname.rb
skylight-1.3.0 lib/skylight/util/hostname.rb
skylight-1.2.2 lib/skylight/util/hostname.rb
skylight-1.2.1 lib/skylight/util/hostname.rb
skylight-1.2.0 lib/skylight/util/hostname.rb
skylight-1.1.0 lib/skylight/util/hostname.rb