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