lib/snapshot/collector.rb in snapshot-1.1.1 vs lib/snapshot/collector.rb in snapshot-1.2.0

- old
+ new

@@ -44,12 +44,12 @@ (summary["Tests"] || []).each do |test| (test["Subtests"] || []).each do |subtest| (subtest["Subtests"] || []).each do |subtest2| (subtest2["Subtests"] || []).each do |subtest3| (subtest3["ActivitySummaries"] || []).each do |activity| - # We now check if it's the drag gesture with a negative value - was_snapshot = activity["Title"].match(/Press and drag from Target Application.*\[32.10.*\].*/) + # We now check if it's the rotation gesture, because that's the only thing we care about + was_snapshot = activity["Title"] == "Set device orientation to Unknown" activities << activity if was_snapshot end end end end @@ -59,10 +59,10 @@ Helper.log.info "Found #{activities.count} screenshots..." to_store = [] # contains the names of all the attachments we want to use activities.each do |activity| # We do care about this, all "Long press Target" events mean screenshots - attachment_entry = activity["SubActivities"].last # the latest event is fine + attachment_entry = activity to_store << attachment_entry["Attachments"].last["FileName"] end Helper.log.info "Found #{to_store.join(', ')}" if $verbose return to_store