Sha256: 5f4012e5f9d721075f20151cfcb29f5d724eac81e6ed141467544b7d0a23b41b

Contents?: true

Size: 496 Bytes

Versions: 5

Compression:

Stored size: 496 Bytes

Contents

module Landrush
  module Util
    def self.host_and_ip(machine)
      [hostname(machine), ip_address(machine)]
    end

    def self.hostname(machine)
      return nil unless machine

      machine.config.vm.hostname
    end

    def self.ip_address(machine)
      return nil unless machine

      machine.config.vm.networks.each do |type, options|
        if type == :private_network && options[:ip].is_a?(String)
          return options[:ip]
        end
      end

      nil
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
landrush-0.5.0 lib/landrush/util.rb
landrush-0.4.1 lib/landrush/util.rb
landrush-0.4.0 lib/landrush/util.rb
landrush-0.3.1 lib/landrush/util.rb
landrush-0.3.0 lib/landrush/util.rb