Class: Ductwork::MachineIdentifier

Inherits:
Object
  • Object
show all
Defined in:
lib/ductwork/machine_identifier.rb

Class Method Summary collapse

Class Method Details

.fetchObject



5
6
7
8
9
# File 'lib/ductwork/machine_identifier.rb', line 5

def self.fetch
  File.read("/etc/machine-id").strip.presence || Socket.gethostname
rescue Errno::ENOENT
  Socket.gethostname
end