dumper.rb
# Sort child threads to line up with parent thread
Sort child threads to line up with parent thread
Sort child threads to line up with parent thread
def reorder_logs
    @logs.reverse.each_with_object({}) { |message, hash|
      if parent_thread?(message)
        hash[message.ts] = [message, []]
      elsif child_thread?(message)
        hash[message.thread_ts][1].push(message)
      else
        hash[message.ts] = [message]
      end
    }.values.flatten
  end
def reorder_logs @logs . reverse . each_with_object ( { } ) { | message , hash | if parent_thread? ( message ) hash [ message . ts ] = [ message , [ ] ] elsif child_thread? ( message ) hash [ message . thread_ts ] [ 1 ] . push ( message ) else hash [ message . ts ] = [ message ] end } . values . flatten end
Sort child threads to line up with parent thread
Sort child threads to line up with parent thread