Sha256: c609e4693abb4b71ac9969acf77fc950a3ae54cf9627a5ae123c86d867acb0ed

Contents?: true

Size: 1.12 KB

Versions: 20

Compression:

Stored size: 1.12 KB

Contents

#!/usr/bin/env ruby

$:.unshift 'lib'

require 'rubygems'

def format_text(text, wrap, indent=0)
  result = []
  work = text.dup

  while work.length > wrap
    if work =~ /^(.{0,#{wrap}})[ \n]/o
      result << $1
      work.slice!(0, $&.length)
    else
      result << work.slice!(0, wrap)
    end
  end

  result << work if work.length.nonzero?
  result.join("\n").gsub(/^/, " " * indent)
end

version = ARGV.shift || Gem::VERSION

entries = Hash.new { |h,file| h[file] = [] }
entry = []
file = nil

IO.foreach 'ChangeLog' do |line|
  case line
  when /^\s*$/,
       /^#/,
       /^\d{4}-\d{2}-\d{2}/ then
    next
  when /^\s+\*\s+([^:]+?):\s+#{version}/ then
    entries[file] << entry.join(' ') unless entry.empty?
    break
  when /^\s+\*\s+([^:]+?):\s+/ then
    entries[file] << entry.join(' ') unless entry.empty?
    file = $1
    entry = [$'.strip]
  when /^\s+/ then
    entry << $'.strip
  end
end

entries.sort_by { |file, | file }.each do |file, file_entries|
  puts "* #{file}"
  file_entries.each do |file_entry|
    file_entry = format_text file_entry, 74, 4
    file_entry.sub! '    ', '  * '
    puts file_entry
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
rubygems-update-3.1.6 util/CL2notes
rubygems-update-3.1.5 util/CL2notes
rubygems-update-3.0.9 util/CL2notes
rubygems-update-3.1.4 util/CL2notes
rubygems-update-3.1.3 util/CL2notes
rubygems-update-3.0.8 util/CL2notes
rubygems-update-3.0.7 util/CL2notes
rubygems-update-3.1.2 util/CL2notes
rubygems-update-3.1.1 util/CL2notes
rubygems-update-3.1.0 util/CL2notes
rubygems-update-3.1.0.pre3 util/CL2notes
rubygems-update-3.1.0.pre2 util/CL2notes
rubygems-update-3.1.0.pre1 util/CL2notes
rubygems-update-3.0.6 util/CL2notes
rubygems-update-3.0.5 util/CL2notes
rubygems-update-3.0.4 util/CL2notes
rubygems-update-3.0.3 util/CL2notes
rubygems-update-3.0.2 util/CL2notes
rubygems-update-3.0.1 util/CL2notes
rubygems-update-3.0.0 util/CL2notes