Sha256: 149f9a704240012541d956104b11aecf022e6b37e4c513e075d76df5bb3aba58
Contents?: true
Size: 1.06 KB
Versions: 2
Compression:
Stored size: 1.06 KB
Contents
module Rake class ThreadHistoryDisplay attr_reader :stats, :items, :threads private :stats, :items, :threads def initialize(stats) @stats = stats @items = { :_seq_ => 1 } @threads = { :_seq_ => "A" } end def show puts "Job History:" stats.each do |stat| stat[:data] ||= [] rename(stat, :thread, threads) rename(stat[:data], :item_id, items) rename(stat[:data], :new_thread, threads) rename(stat[:data], :deleted_thread, threads) printf("%8d %2s %-20s %s\n", (stat[:time] * 1_000_000).round, stat[:thread], stat[:event], stat[:data].map { |k,v| "#{k}:#{v}" }.join(" ")) end end private def rename(hash, key, renames) if hash && hash[key] original = hash[key] value = renames[original] unless value value = renames[:_seq_] renames[:_seq_] = renames[:_seq_].succ renames[original] = value end hash[key] = value end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rake-10.0.0.beta.1 | lib/rake/thread_history_display.rb |
rake-0.9.3.beta.3 | lib/rake/thread_history_display.rb |