diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2018-12-04 13:05:53 -0500 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2018-12-04 13:41:36 -0500 |
commit | e91bf5966e9f6f58bc0ea9e92f94b9d892ef29bc (patch) | |
tree | 7cd7bb3a429155b47704252ea6cd4daa484d5cd7 | |
parent | e5172265bf36c0834a67ef82c0ad514cfe7671df (diff) | |
download | rails-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.rb | 15 |
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 |