Permalink
Browse files

Now we don't count blank lines. FOR GREAT JUSTICE! Thanks to Austin f…

…or getting this commit started. I'm lazy.

git-svn-id: http://kablame.googlecode.com/svn/kablame@9 fc056d42-643f-0410-81e7-b73d40e30204
  • Loading branch information...
1 parent 0d04613 commit 0c9d5aa6c5d357b12e3fa7c13a6368dbbed92fa8 @jdunphy committed Mar 4, 2008
Showing with 6 additions and 1 deletion.
  1. +1 −1 README
  2. +5 −0 lib/kablame.rb
View
2 README
@@ -1,4 +1,4 @@
-= Kablame 0.2
+= Kablame 0.2.1
So who really gets bragging rights?
View
5 lib/kablame.rb
@@ -26,6 +26,7 @@ def process_file(filename)
print '.'
STDOUT.flush
get_blame_lines(filename).each do |line|
+ next if line.match(blank_line_regex)
name = line.match(name_match_regex)[1]
(@users[name] ? @users[name].increment : @users[name] = KablameUser.new(name)) unless name.nil?
end
@@ -56,6 +57,8 @@ def type
end
module Svn
+ def blank_line_regex; /\d+[\ ]+(\w+)+(\s+)$/; end
+
def name_match_regex; /\d+[\ ]+(\w+)/; end
def get_blame_lines(filename)
@@ -66,6 +69,8 @@ def version_control; 'svn'; end
end
module Git
+ def blank_line_regex; /\(.+[\+-]\d{4}\s+\d+\)(\s*)$/; end
+
def name_match_regex; /\((\w+)\s/; end
def get_blame_lines(filename)

0 comments on commit 0c9d5aa

Please sign in to comment.