module GV::Common::HostHelper
Public Instance Methods
external_ip(interface = "eth0")
click to toggle source
Several configuration helpers
# File lib/gv/common/host_helper.rb, line 14 def external_ip interface = "eth0" @external_ip ||= pipe("/sbin/ifconfig #{interface} | grep 'inet addr' | awk -F: '{print $2}' | awk '{print $1}'") end
hostname()
click to toggle source
# File lib/gv/common/host_helper.rb, line 18 def hostname @hostname ||= pipe("hostname -f") end
port()
click to toggle source
# File lib/gv/common/host_helper.rb, line 22 def port @port ||= ENV['PORT'] end