Sha256: 80f64ee26f2ff66efb740c7d38d96fc33158aa62bf4e76ba392d8b0ebf85d292

Contents?: true

Size: 197 Bytes

Versions: 10

Compression:

Stored size: 197 Bytes

Contents

class Socket
  def self.ipaddress
    hostname = %x(hostname).chomp
    getaddrinfo(hostname, nil).first[3]
  end

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
liquid-ext-3.3.10 lib/liquid/ext/socket.rb
liquid-ext-3.3.9 lib/liquid/ext/socket.rb
liquid-ext-3.3.8 lib/liquid/ext/socket.rb
liquid-ext-3.3.7 lib/liquid/ext/socket.rb
liquid-ext-3.3.6 lib/liquid/ext/socket.rb
liquid-ext-3.3.5 lib/liquid/ext/socket.rb
liquid-ext-3.3.4 lib/liquid/ext/socket.rb
liquid-ext-3.3.3 lib/liquid/ext/socket.rb
liquid-ext-3.3.2 lib/liquid/ext/socket.rb
liquid-ext-3.3.0 lib/liquid/ext/socket.rb