Created
April 3, 2015 02:05
-
-
Save michaelfeathers/1e2934ebb95560cddc3b to your computer and use it in GitHub Desktop.
return a string that represents increases, decreases, and stable changes in a method's length
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# :: [event] -> String -> String | |
def method_delta_line es, method_name | |
es.select {|e| e.method_name == method_name } | |
.map(&:method_length) | |
.each_cons(2) | |
.map {|c,n| ["^","v","-"][(c <=> n) + 1] } | |
.join | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment