class Spoom::Timeline
def commits_for_dates(dates)
def commits_for_dates(dates) dates.map do |t| out, _, _ = Spoom::Git.log( "--since='#{t}'", "--until='#{t.to_date.next_month}'", "--format='format:%h'", "--author-date-order", "-1", path: @path, ) next if out.empty? out end.compact.uniq end
def initialize(from, to, path: ".")
def initialize(from, to, path: ".") @from = from @to = to @path = path end
def months
def months d = Date.new(@from.year, @from.month, 1) to = Date.new(@to.year, @to.month, 1) res = [d.to_time] while d < to d = d.next_month res << d.to_time end res end
def ticks
def ticks commits_for_dates(months) end