Sha256: aca734ef20c97194e48c2437c7d2eacc8566b8c8868f35294a9cd5d8542d343c

Contents?: true

Size: 680 Bytes

Versions: 7

Compression:

Stored size: 680 Bytes

Contents

desc 'update changelog'
task :changelog do
  File.open('guide/CHANGELOG', 'w+') do |changelog|
    `git log -z --abbrev-commit`.split("\0").each do |commit|
      next if commit =~ /^Merge: \d*/
      ref, author, time, _, title, _, message = commit.split("\n", 7)
      ref    = ref[/commit ([0-9a-f]+)/, 1]
      author = author[/Author: (.*)/, 1].strip
      time   = Time.parse(time[/Date: (.*)/, 1]).utc
      time   = time.strftime('%a %b %d %H:%M:%S %Z %Y')

      title = title.to_s.strip

      changelog.puts "[#{ref} | #{time}] #{author}"
      changelog.puts '', "  * #{title}"
      changelog.puts '', message.rstrip if message
      changelog.puts
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ramaze-2023.01.06 tasks/changelog.rake
ramaze-2012.12.08 tasks/changelog.rake
ramaze-2012.12.08b tasks/changelog.rake
ramaze-2012.04.14 tasks/changelog.rake
ramaze-2012.03.07 tasks/changelog.rake
ramaze-2011.12.28 tasks/changelog.rake
ramaze-2011.10.23 tasks/changelog.rake