Sha256: 03eae9c7cd77bebdc75f56ccda1c4d9496da82f9ee8934fcd2291848f9e46299

Contents?: true

Size: 541 Bytes

Versions: 13

Compression:

Stored size: 541 Bytes

Contents

module Unix::Exec
  include Beaker::CommandFactory

  def echo(msg, abs=true)
    (abs ? '/bin/echo' : 'echo') + " #{msg}"
  end

  def touch(file, abs=true)
    (abs ? '/bin/touch' : 'touch') + " #{file}"
  end

  def path
    '/bin:/usr/bin'
  end

  def get_ip
    if self['platform'].include?('solaris') || self['platform'].include?('osx')
      execute("ifconfig -a inet| awk '/broadcast/ {print $2}' | cut -d/ -f1 | head -1").strip
    else
      execute("ip a|awk '/global/{print$2}' | cut -d/ -f1 | head -1").strip
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
beaker-2.9.0 lib/beaker/host/unix/exec.rb
beaker-2.8.0 lib/beaker/host/unix/exec.rb
beaker-2.7.1 lib/beaker/host/unix/exec.rb
beaker-2.7.0 lib/beaker/host/unix/exec.rb
beaker-2.6.0 lib/beaker/host/unix/exec.rb
beaker-2.5.1 lib/beaker/host/unix/exec.rb
beaker-2.5.0 lib/beaker/host/unix/exec.rb
beaker-2.4.1 lib/beaker/host/unix/exec.rb
beaker-2.4.0 lib/beaker/host/unix/exec.rb
beaker-2.3.0 lib/beaker/host/unix/exec.rb
beaker-2.2.0 lib/beaker/host/unix/exec.rb
beaker-2.1.0 lib/beaker/host/unix/exec.rb
beaker-2.0.0 lib/beaker/host/unix/exec.rb