Add basic support for author_list.
This commit is contained in:
parent
40f6a33505
commit
9b4c1418a7
5 changed files with 27 additions and 8 deletions
|
@ -14,6 +14,8 @@ app.parse_cmdline ARGV
|
|||
app.analyze
|
||||
app.export
|
||||
app.report
|
||||
#app.report_ranges
|
||||
#app.report_users
|
||||
|
||||
exit 0
|
||||
|
||||
|
|
24
lib/timecost/author_list.rb
Normal file
24
lib/timecost/author_list.rb
Normal 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
|
|
@ -17,6 +17,7 @@ module TimeCost
|
|||
:verbose => false
|
||||
}
|
||||
@rangelist = nil
|
||||
@authorlist = nil
|
||||
end
|
||||
|
||||
def parse_cmdline args
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
|
||||
module TimeCost
|
||||
class Range
|
||||
# Return local user id for git user
|
||||
def self.parse gituser
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue