lib/vclog/templates/history.ansi.rb in vclog-1.8.2 vs lib/vclog/templates/history.ansi.rb in vclog-1.9.0
- old
+ new
@@ -2,12 +2,11 @@
out = []
out << "#{title.ansi(:bold)}"
-history.releases.sort.each do |release|
-
+releases.sort.each do |release|
tag = release.tag
# TODO: support verbose option
#if verbose?
# out << "\n#{tag.name} / #{tag.date.strftime('%Y-%m-%d %H:%M')}".ansi(:bold)
@@ -15,50 +14,44 @@
out << "\n#{tag.name} / #{tag.date.strftime('%Y-%m-%d')}".ansi(:bold)
#end
out << "\n#{tag.message.strip} (#{tag.author})"
- if options.extra && !release.changes.empty?
+ if !(options.summary or release.changes.empty?)
#out << "\nChanges:".ansi(:green)
release.groups.each do |number, changes|
out << "\n* " + "#{changes.size} #{changes[0].label}\n"
changes.sort{|a,b| b.date <=> a.date}.each do |entry|
+ msg = entry.to_s(:summary=>!options.detail)
- line = "#{entry.message.strip}"
-
- if options.revision
- out.last << "(##{entry.revision})"
- end
-
case entry.level
when 1
- line = line.ansi(:yellow)
+ msg = msg.ansi(:yellow)
when 0
- line = line.ansi(:green)
+ msg = msg.ansi(:green)
when -1
- line = line.ansi(:cyan)
+ msg = msg.ansi(:cyan)
else
if entry.level > 1
- line = line.ansi(:red)
+ msg = msg.ansi(:red)
else
- line = line.ansi(:blue)
+ msg = msg.ansi(:blue)
end
end
- out << " * " + line
+ msg << "\n(##{entry.id})" if options.reference
+ out << msg.tabto(6).sub(' ',' * ')
end
end
end
out << ""
-
end
out.join("\n") + "\n"
-