320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
|
# File 'lib/crash_monkey/monkey_runner.rb', line 320
def decode_latest(num=10)
hash = {}
ret = []
@log_list.reverse.each do |log|
break if num == 0
if log[LOG_TYPE] == 'Screenshot'
if log[MESSAGE] =~ /^action/
hash[:action_image] = log[MESSAGE]
elsif log[MESSAGE] =~ /^screen/
hash[:screen_image] = log[MESSAGE]
hash[:timestamp] = log[TIMESTAMP]
if block_given?
yield(hash)
else
ret << hash
end
hash = {}
num -= 1
end
elsif log[LOG_TYPE] == 'Debug' && log[MESSAGE] =~ /^target./
hash[:message] = log[MESSAGE] unless log[MESSAGE] =~ /^target.captureRectWithName/ && log[MESSAGE] =~ /switcherScrollView/
end
end
ret
end
|