Sha256: 968a478e6076f07180bcd01e69ecb30819f272860c24b0d096fdf1a113879887

Contents?: true

Size: 356 Bytes

Versions: 3

Compression:

Stored size: 356 Bytes

Contents

# -*- coding: utf-8 -*-
module Keystone
  module Os
    class Osx < Darwin
      def ip_address
        ifconfig = `/sbin/ifconfig`
        ips = []

        # TODO mac
        ifconfig.gsub(/inet (\d+\.\d+\.\d+\.\d+) netmask/){|ip|
          if $1 != '127.0.0.1'
            ips << $1
          end
        }
        return ips
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
keystone-0.0.32 lib/keystone/os/osx.rb
keystone-0.0.31 lib/keystone/os/osx.rb
keystone-0.0.30 lib/keystone/os/osx.rb