Class: RhoDevelopment::Network
- Defined in:
- lib/build/development/network.rb
Overview
Returns available network interfaces
Class Method Summary collapse
-
.available_addresses ⇒ Array
Returns array with available network interfaces on the machine.
Class Method Details
.available_addresses ⇒ Array
Returns array with available network interfaces on the machine. IPV6, loopback and multicast interfaces are excepted.
9 10 11 12 |
# File 'lib/build/development/network.rb', line 9 def self.available_addresses addresses = (Socket.ip_address_list.select { |each| each.ipv4? and !each.ipv4_loopback? and !each.ipv4_multicast? }.map { |each| each.ip_address }.uniq) return addresses end |