26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/todidnt.rb', line 26
def self.generate(options)
GitRepo.new(options[:path]).run do |path|
history = GitHistory.new
buckets, authors = history.timeline!
lines = TodoLine.all(["TODO"])
lines.each do |todo|
blames = history.blames[todo.raw_content]
if blames && (metadata = blames.pop)
todo.author = metadata[:name]
todo.timestamp = metadata[:time]
else
todo.author = "(Not yet committed)"
todo.timestamp = Time.now.to_i
end
end
file_path = HTMLGenerator.generate(:all, :all_lines => lines.sort_by(&:timestamp).reverse)
file_path = HTMLGenerator.generate(:history, :data => {:history => buckets.map {|h| h[:authors].merge('Date' => h[:timestamp]) }, :authors => authors.to_a})
Launchy.open("file://#{file_path}")
end
end
|