lib/ADB.rb in ADB-0.5.1 vs lib/ADB.rb in ADB-0.5.2
- old
+ new
@@ -92,11 +92,11 @@
# :emulator, and :serial.
# @param timeout value for the command to complete. Defaults to 30
# seconds.
#
def install(installable, options=nil, target={}, timeout=30)
- execute_adb_with(timeout, "#{which_one(target)} wait-for-device install #{options} #{installable}")
+ execute_adb_with_exactly(timeout, *"#{which_one(target)} wait-for-device install #{options}".split, installable)
raise ADBError, "Could not install #{installable}" unless stdout_contains "Success"
end
#
# uninstall an apk file to a device
@@ -202,10 +202,14 @@
private
def execute_adb_with(timeout, arguments)
args = arguments.split
- process = ChildProcess.build('adb', *args)
+ execute_adb_with_exactly timeout, *args
+ end
+
+ def execute_adb_with_exactly(timeout, *arguments)
+ process = ChildProcess.build('adb', *arguments)
process.io.stdout, process.io.stderr = std_out_err
process.start
kill_if_longer_than(process, timeout)
@last_stdout = output(process.io.stdout)
@last_stderr = output(process.io.stderr)