Sha256: d08b377cfcda73cfdba47ac912daca77ed34917fadf88115601e40e382681237

Contents?: true

Size: 177 Bytes

Versions: 4

Compression:

Stored size: 177 Bytes

Contents

require 'ipaddr'

class Socket
  def self.ipaddress
    getaddrinfo(gethostname, nil).first[3]
  end

  def self.fqdn
    gethostbyaddr(IPAddr.new(ipaddress).hton)[0]
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
liquid-ext-3.5.3 lib/liquid/ext/socket.rb
liquid-ext-3.5.2 lib/liquid/ext/socket.rb
liquid-ext-3.5.0 lib/liquid/ext/socket.rb
liquid-ext-3.4.2 lib/liquid/ext/socket.rb