Sha256: 645cb40048fbe511f3d7bf36574333c8290fa69e5b136e62818b19ba1e88d9c4

Contents?: true

Size: 1.12 KB

Versions: 130

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 then
      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

130 entries across 130 versions & 1 rubygems

Version Path
rubygems-update-2.7.11 util/CL2notes
rubygems-update-2.7.10 util/CL2notes
rubygems-update-2.7.9 util/CL2notes
rubygems-update-2.7.8 util/CL2notes
rubygems-update-2.7.7 util/CL2notes
rubygems-update-2.7.6 util/CL2notes
rubygems-update-2.7.5 util/CL2notes
rubygems-update-2.7.4 util/CL2notes
rubygems-update-2.7.4.pre1 util/CL2notes
rubygems-update-2.7.3 util/CL2notes
rubygems-update-2.7.2 util/CL2notes
rubygems-update-2.7.1 util/CL2notes
rubygems-update-2.7.0 util/CL2notes
rubygems-update-2.6.14 util/CL2notes
rubygems-update-2.6.13 util/CL2notes
rubygems-update-2.6.12 util/CL2notes
rubygems-update-2.6.11 util/CL2notes
rubygems-update-2.6.10 util/CL2notes
rubygems-update-2.6.9 util/CL2notes
rubygems-update-2.6.8 util/CL2notes