Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit 0c9d5aa6c5d357b12e3fa7c13a6368dbbed92fa8 1 parent 0d04613
Jacob Dunphy authored

Showing 2 changed files with 6 additions and 1 deletion. Show diff stats Hide diff stats

  1. +1 1  README
  2. +5 0 lib/kablame.rb
2  README
... ... @@ -1,4 +1,4 @@
1   -= Kablame 0.2
  1 += Kablame 0.2.1
2 2
3 3 So who really gets bragging rights?
4 4
5 lib/kablame.rb
@@ -26,6 +26,7 @@ def process_file(filename)
26 26 print '.'
27 27 STDOUT.flush
28 28 get_blame_lines(filename).each do |line|
  29 + next if line.match(blank_line_regex)
29 30 name = line.match(name_match_regex)[1]
30 31 (@users[name] ? @users[name].increment : @users[name] = KablameUser.new(name)) unless name.nil?
31 32 end
@@ -56,6 +57,8 @@ def type
56 57 end
57 58
58 59 module Svn
  60 + def blank_line_regex; /\d+[\ ]+(\w+)+(\s+)$/; end
  61 +
59 62 def name_match_regex; /\d+[\ ]+(\w+)/; end
60 63
61 64 def get_blame_lines(filename)
@@ -66,6 +69,8 @@ def version_control; 'svn'; end
66 69 end
67 70
68 71 module Git
  72 + def blank_line_regex; /\(.+[\+-]\d{4}\s+\d+\)(\s*)$/; end
  73 +
69 74 def name_match_regex; /\((\w+)\s/; end
70 75
71 76 def get_blame_lines(filename)

0 comments on commit 0c9d5aa

Please sign in to comment.
Something went wrong with that request. Please try again.