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-0.8.0.beta.1 lib/skylight/util/hostname.rb
skylight-0.7.1 lib/skylight/util/hostname.rb
skylight-0.7.0.beta.3 lib/skylight/util/hostname.rb
truex-skylight-0.6.0 lib/skylight/util/hostname.rb
skylight-0.7.0.beta.2 lib/skylight/util/hostname.rb
skylight-0.7.0.beta.1 lib/skylight/util/hostname.rb
skylight-0.6.2.beta.2 lib/skylight/util/hostname.rb
skylight-0.6.1 lib/skylight/util/hostname.rb
skylight-0.6.0 lib/skylight/util/hostname.rb
skylight-0.6.0.beta.1 lib/skylight/util/hostname.rb
skylight-0.5.2 lib/skylight/util/hostname.rb
skylight-0.5.1 lib/skylight/util/hostname.rb
skylight-0.5.0 lib/skylight/util/hostname.rb
skylight-0.4.3 lib/skylight/util/hostname.rb
skylight-0.5.0.beta1 lib/skylight/util/hostname.rb
skylight-0.4.2 lib/skylight/util/hostname.rb
skylight-0.4.1 lib/skylight/util/hostname.rb
skylight-0.4.0 lib/skylight/util/hostname.rb
skylight-0.4.0.beta2 lib/skylight/util/hostname.rb
skylight-0.4.0.beta1 lib/skylight/util/hostname.rb