Skip to content

Commit

Permalink
Sorted report by composite mass and cleaned up output. Prepped for re…
Browse files Browse the repository at this point in the history
…lease

[git-p4: depot-paths = "//src/flay/dev/": change = 4463]
  • Loading branch information
zenspider committed Nov 6, 2008
1 parent 5a7e234 commit fbd6948
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion History.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
=== 1.0.0 / 2008-09-17
=== 1.0.0 / 2008-11-06

* 1 major enhancement

Expand Down
12 changes: 9 additions & 3 deletions lib/flay.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,18 @@ def prune
def report prune = nil
self.prune

self.hashes.each do |_,nodes|
self.hashes.sort_by { |_,nodes|
-(nodes.first.mass * nodes.size)
}.each do |_,nodes|
next unless nodes.first.first == prune if prune
puts
puts "Matches found in: #{nodes.first.first}"

node = nodes.first
puts "Matches found in %p (mass = %d)" %
[node.first, nodes.size * node.mass]

nodes.each do |node|
puts " #{node.file}:#{node.line} (mass = #{node.mass})"
puts " #{node.file}:#{node.line}"
end
end
end
Expand Down

0 comments on commit fbd6948

Please sign in to comment.