diff --git a/bin/git-timecost b/bin/git-timecost index 4acc0b2..1258eff 100755 --- a/bin/git-timecost +++ b/bin/git-timecost @@ -14,6 +14,8 @@ app.parse_cmdline ARGV app.analyze app.export app.report +#app.report_ranges +#app.report_users exit 0 diff --git a/lib/timecost/author_list.rb b/lib/timecost/author_list.rb new file mode 100644 index 0000000..06ba002 --- /dev/null +++ b/lib/timecost/author_list.rb @@ -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 diff --git a/lib/timecost/cli.rb b/lib/timecost/cli.rb index b40d089..de2183b 100644 --- a/lib/timecost/cli.rb +++ b/lib/timecost/cli.rb @@ -17,6 +17,7 @@ module TimeCost :verbose => false } @rangelist = nil + @authorlist = nil end def parse_cmdline args diff --git a/lib/timecost/rangelist.rb b/lib/timecost/range_list.rb similarity index 100% rename from lib/timecost/rangelist.rb rename to lib/timecost/range_list.rb diff --git a/lib/timecost/user.rb b/lib/timecost/user.rb deleted file mode 100644 index 8335fde..0000000 --- a/lib/timecost/user.rb +++ /dev/null @@ -1,8 +0,0 @@ - -module TimeCost - class Range - # Return local user id for git user - def self.parse gituser - end - end -end