Add basic support for author_list.

This commit is contained in:
Glenn Y. Rolland 2014-09-24 20:11:05 +02:00
parent 40f6a33505
commit 9b4c1418a7
5 changed files with 27 additions and 8 deletions

View file

@ -14,6 +14,8 @@ app.parse_cmdline ARGV
app.analyze app.analyze
app.export app.export
app.report app.report
#app.report_ranges
#app.report_users
exit 0 exit 0

View file

@ -0,0 +1,24 @@
module TimeCost
class AuthorList
# Prepare an empty index (local)
def initialize
@count = 0
@store = {}
end
# Return local user id for git user
# FIXME: should handle multiple names for same user
def parse gitauthor
invert_store = @store.invert
result = 0
if invert_store.include? gitauthor then
result = invert_store[gitauthor]
else
@store[gitauthor] = @count
result = @count
@count += 1
end
end
end
end

View file

@ -17,6 +17,7 @@ module TimeCost
:verbose => false :verbose => false
} }
@rangelist = nil @rangelist = nil
@authorlist = nil
end end
def parse_cmdline args def parse_cmdline args

View file

@ -1,8 +0,0 @@
module TimeCost
class Range
# Return local user id for git user
def self.parse gituser
end
end
end