Change release_sumary task to work in first releases of the series

This commit is contained in:
Rafael Mendonça França 2019-01-18 16:35:09 -05:00
parent 5a0230c67f
commit 3c6cfdf7ad
No known key found for this signature in database
GPG Key ID: FC23B6D0F1EEE948
1 changed files with 6 additions and 2 deletions

View File

@ -136,16 +136,20 @@ namespace :changelog do
end
end
task :release_summary, [:base_release] do |_, args|
task :release_summary, [:base_release, :release] do |_, args|
release_regexp = args[:base_release] ? Regexp.escape(args[:base_release]) : /\d+\.\d+\.\d+/
puts release
FRAMEWORKS.each do |fw|
puts "## #{FRAMEWORK_NAMES[fw]}"
fname = File.join fw, "CHANGELOG.md"
contents = File.readlines fname
contents.shift
changes = []
until contents.first =~ /^## Rails #{release_regexp}.*$/
until contents.first =~ /^## Rails #{release_regexp}.*$/ ||
contents.first =~ /^Please check.*for previous changes\.$/ ||
contents.empty?
changes << contents.shift
end