Class: TimeCost::AuthorList
- Inherits:
-
Object
- Object
- TimeCost::AuthorList
- Defined in:
- lib/timecost/author_list.rb
Defined Under Namespace
Classes: UnknownAuthor
Instance Method Summary collapse
- #add(author) ⇒ Object
- #alias(author_ref, author_new) ⇒ Object
-
#initialize ⇒ AuthorList
constructor
Prepare an empty index (local).
-
#parse(author) ⇒ Object
Return local user id for git user FIXME: should handle multiple names for same user.
- #size ⇒ Object
Constructor Details
#initialize ⇒ AuthorList
Prepare an empty index (local)
9 10 11 12 |
# File 'lib/timecost/author_list.rb', line 9 def initialize @count = 0 = {} end |
Instance Method Details
#add(author) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/timecost/author_list.rb', line 14 def add if .include? then result = [] else [] = @count result = @count @count += 1 end end |
#alias(author_ref, author_new) ⇒ Object
24 25 26 |
# File 'lib/timecost/author_list.rb', line 24 def alias , raise UnknownAuthor unless .include? end |
#parse(author) ⇒ Object
Return local user id for git user FIXME: should handle multiple names for same user
30 31 32 |
# File 'lib/timecost/author_list.rb', line 30 def parse return [] end |
#size ⇒ Object
34 35 36 |
# File 'lib/timecost/author_list.rb', line 34 def size return .keys.size end |