aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2018-12-04 13:05:53 -0500
committerRafael Mendonça França <rafaelmfranca@gmail.com>2018-12-04 13:41:36 -0500
commite91bf5966e9f6f58bc0ea9e92f94b9d892ef29bc (patch)
tree7cd7bb3a429155b47704252ea6cd4daa484d5cd7
parente5172265bf36c0834a67ef82c0ad514cfe7671df (diff)
downloadrails-e91bf5966e9f6f58bc0ea9e92f94b9d892ef29bc.tar.gz
rails-e91bf5966e9f6f58bc0ea9e92f94b9d892ef29bc.tar.bz2
rails-e91bf5966e9f6f58bc0ea9e92f94b9d892ef29bc.zip
Improve the task to generate the release summary
Now it accepts the base release to be compared with. [ci skip]
-rw-r--r--tasks/release.rb15
1 files changed, 10 insertions, 5 deletions
diff --git a/tasks/release.rb b/tasks/release.rb
index 1e83814bae..a13003aa27 100644
--- a/tasks/release.rb
+++ b/tasks/release.rb
@@ -122,15 +122,20 @@ namespace :changelog do
end
end
- task :release_summary do
- (FRAMEWORKS + ["guides"]).each do |fw|
- puts "## #{fw}"
+ task :release_summary, [:base_release] do |_, args|
+ release_regexp = args[:base_release] ? Regexp.escape(args[:base_release]) : /\d+\.\d+\.\d+/
+
+ FRAMEWORKS.each do |fw|
+ puts "## #{FRAMEWORK_NAMES[fw]}"
fname = File.join fw, "CHANGELOG.md"
contents = File.readlines fname
contents.shift
changes = []
- changes << contents.shift until contents.first =~ /^\*Rails \d+\.\d+\.\d+/
- puts changes.reject { |change| change.strip.empty? }.join
+ until contents.first =~ /^## Rails #{release_regexp}.*$/
+ changes << contents.shift
+ end
+
+ puts changes.join
puts
end
end