This commit also moves out the ipv4_interfaces method to be a util method, so that the port checker can also access it as a class mehtod
14 lines
290 B
Ruby
14 lines
290 B
Ruby
module Vagrant
|
|
module Util
|
|
module IPv4Interfaces
|
|
def self.ipv4_interfaces
|
|
Socket.getifaddrs.select do |ifaddr|
|
|
ifaddr.addr && ifaddr.addr.ipv4?
|
|
end.map do |ifaddr|
|
|
[ifaddr.name, ifaddr.addr.ip_address]
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|