Skip to content

Commit e91bf59

Browse files
committed
Improve the task to generate the release summary
Now it accepts the base release to be compared with. [ci skip]
1 parent e517226 commit e91bf59

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

tasks/release.rb

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,20 @@
122122
end
123123
end
124124

125-
task :release_summary do
126-
(FRAMEWORKS + ["guides"]).each do |fw|
127-
puts "## #{fw}"
125+
task :release_summary, [:base_release] do |_, args|
126+
release_regexp = args[:base_release] ? Regexp.escape(args[:base_release]) : /\d+\.\d+\.\d+/
127+
128+
FRAMEWORKS.each do |fw|
129+
puts "## #{FRAMEWORK_NAMES[fw]}"
128130
fname = File.join fw, "CHANGELOG.md"
129131
contents = File.readlines fname
130132
contents.shift
131133
changes = []
132-
changes << contents.shift until contents.first =~ /^\*Rails \d+\.\d+\.\d+/
133-
puts changes.reject { |change| change.strip.empty? }.join
134+
until contents.first =~ /^## Rails #{release_regexp}.*$/
135+
changes << contents.shift
136+
end
137+
138+
puts changes.join
134139
puts
135140
end
136141
end

0 commit comments

Comments
 (0)