Sha256: 5bdf635ea0abc4224bbc45e114e9bb195af8654c8b4ec1db060a32660b26307c

Contents?: true

Size: 837 Bytes

Versions: 5

Compression:

Stored size: 837 Bytes

Contents

#!/usr/bin/env ruby

cmd=`git log --pretty='format:%ci::%an <%ae>::%s'`

list = {}
list_order = []
contributors = []
changelog_file = "CHANGELOG"
contributors_file = "Contributors"

cmd.each do |l|
  date, author, subject = l.chomp.split("::")
  date, time, zone = date.split(" ")

  id = "#{date}\t#{author}"
  if not list[id]
    list[id] = []
    list_order << {:id => id, :value => list[id]}
  end
  list[id] << subject
  contributors << author
end

# list.each do |id, value|
file = File.new(changelog_file,"w")
list_order.each do |i|
  id = i[:id]
  value = i[:value]

  file.puts "#{id}"
  file.puts value.map { |e| "\t* #{e}" }.join("\n")
  file.puts "\n"
end
file.close
file = File.new(contributors_file,"w")
file.puts "Contributors (sorted alphabetically)"
file.puts "\n"
file.puts contributors.sort.uniq.join("\n")
file.close

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
foreman_discovery-1.0.0 test/foreman_app/extras/changelog
foreman_discovery-1.0.0.rc4 test/foreman_app/extras/changelog
foreman_discovery-1.0.0.rc3 test/foreman_app/extras/changelog
foreman_discovery-1.0.0.rc2 test/foreman_app/extras/changelog
foreman_discovery-1.0.0.rc1 test/foreman_app/extras/changelog