Sha256: 67ec2ac49faea01da3dfca1bea7e4d38f9ff2d569d32f0084e06cd39ec97cecd

Contents?: true

Size: 606 Bytes

Versions: 9

Compression:

Stored size: 606 Bytes

Contents

module UIAutoMonkey
  module CommandHelper
    require 'open3'

    def shell(cmds)
      puts "Shell: #{cmds.inspect}"
      Open3.popen3(*cmds) do |stdin, stdout, stderr|
        stdin.close
        return stdout.read
      end
    end

    def run_process(cmds)
      puts "Run: #{cmds.inspect}"
      Kernel.system(cmds[0], *cmds[1..-1])
    end

    def kill_all(process_name, signal=nil)
      signal = signal ? "-#{signal}" : ''
      Kernel.system("killall #{signal} '#{process_name}'")
    end

    def xcode_path
      @xcode_path ||= shell(%w(xcode-select -print-path)).strip
    end

  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
crash_monkey-0.3.1 lib/crash_monkey/command_helper.rb
crash_monkey-0.3.0 lib/crash_monkey/command_helper.rb
crash_monkey-0.2.5 lib/crash_monkey/command_helper.rb
crash_monkey-0.2.3 lib/crash_monkey/command_helper.rb
crash_monkey-0.2.1 lib/crash_monkey/command_helper.rb
crash_monkey-0.2.0 lib/crash_monkey/command_helper.rb
crash_monkey-0.1.7 lib/crash_monkey/command_helper.rb
crash_monkey-0.1.6 lib/crash_monkey/command_helper.rb
crash_monkey-0.1.5 lib/crash_monkey/command_helper.rb