wrongdoc.git  about / heads / tags
RDoc done right (IMNSHO)
blob 324a13b5a281445abe9104b8642e1aaae692cded 646 bytes (raw)
$ git show HEAD:lib/wrongdoc/changelog.rb	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 
# helper method for generating the ChangeLog in RDoc format atomically
module Wrongdoc::Changelog
  include Wrongdoc::History

  def changelog
    fp = Tempfile.new('ChangeLog', '.')
    fp.write "ChangeLog from #@cgit_uri"
    cmd = %w(git log)
    if @changelog_start && tags[0]
      range = "#@changelog_start..#{tags[0][:tag]}"
      fp.write(" (#{range})")
      cmd << range
    end
    fp.write("\n\n")
    prefix = "   "
    IO.popen(cmd.join(' ')) do |io|
      io.each { |line|
        fp.write prefix
        fp.write line
      }
    end
    fp.chmod(0666 & ~File.umask)
    File.rename(fp.path, 'ChangeLog')
    fp.close!
  end
end

git clone https://yhbt.net/wrongdoc.git