module UIAutoMonkey::CommandHelper

Public Instance Methods

kill_all(process_name, signal=nil) click to toggle source
# File lib/crash_monkey/command_helper.rb, line 18
def kill_all(process_name, signal=nil)
  signal = signal ? "-#{signal}" : ''
  Kernel.system("killall #{signal} '#{process_name}'")
end
run_process(cmds) click to toggle source
# File lib/crash_monkey/command_helper.rb, line 13
def run_process(cmds)
  puts "Run: #{cmds.inspect}"
  Kernel.system(cmds[0], *cmds[1..-1])
end
shell(cmds) click to toggle source
# File lib/crash_monkey/command_helper.rb, line 5
def shell(cmds)
  puts "Shell: #{cmds.inspect}"
  Open3.popen3(*cmds) do |stdin, stdout, stderr|
    stdin.close
    return stdout.read
  end
end
xcode_path() click to toggle source
# File lib/crash_monkey/command_helper.rb, line 23
def xcode_path
  @xcode_path ||= shell(%w(xcode-select -print-path)).strip
end