Class: PairingMatrix::CommitReader

Inherits:
Object
  • Object
show all
Defined in:
lib/pairing_matrix/commit_readers/commit_reader.rb

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ CommitReader

Returns a new instance of CommitReader.



5
6
7
# File 'lib/pairing_matrix/commit_readers/commit_reader.rb', line 5

def initialize(config)
    @config = config
end

Instance Method Details

#authors_with_commits(days) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/pairing_matrix/commit_readers/commit_reader.rb', line 9

def authors_with_commits(days)
    date = (Date.today - days).to_s
    authors = authors(date)
    author_groups = authors.group_by { |n| titleize(n)}
    author_groups.map do |k, v|
        pair = k.split(',')
        pair.unshift('') if pair.size == 1
        [pair, v.size].flatten
    end
end