class AdbSdkLib::CommandCapture
@private
Public Class Methods
new(line_receiver = nil)
click to toggle source
# File lib/adb_sdklib/common.rb, line 34 def initialize(line_receiver = nil) @output = '' @line_receiver = line_receiver end
Public Instance Methods
addOutput(data, offset, length)
click to toggle source
Override
# File lib/adb_sdklib/common.rb, line 40 def addOutput(data, offset, length) out = data[offset..(offset + length - 1)] # -1 for ¥x00 @output << out.force_encoding('UTF-8') unless @line_receiver.nil? lines = @output.split("\n") @output = (@output[-1] != "\n") ? lines.pop : '' lines.each { |line| @line_receiver.call(line.chomp) } end end
flush()
click to toggle source
Override
# File lib/adb_sdklib/common.rb, line 53 def flush if !@line_receiver.nil? && !@output.empty? @line_receiver.call(@output) @output = '' end end
isCancelled()
click to toggle source
Override
# File lib/adb_sdklib/common.rb, line 61 def isCancelled; false end
to_s()
click to toggle source
# File lib/adb_sdklib/common.rb, line 63 def to_s; @output end