@@ -150,18 +150,24 @@ def create_post(version)
150150end
151151
152152def change_versions_in(filename, version, post_link)
153- # we recalc this each time but this is a rakefile :)
154- major, second, third, minor = version.split('.')
155-
156- fail "third value is not a number: #{third}" unless third =~ /\d+/
157- previous_third = third.to_i - 1
158- previous_version = [major, second, previous_third, minor].join('.')
153+ if ENV['JRUBY_LAST_VERSION']
154+ previous_version = ENV['JRUBY_LAST_VERSION']
155+ else
156+ # we recalc this each time but this is a rakefile :)
157+ major, second, third, minor = version.split('.')
158+
159+ fail "third value is not a number: #{third}" unless third =~ /\d+/
160+ previous_third = third.to_i - 1
161+ previous_version = [major, second, previous_third, minor].join('.')
162+ end
159163
160164 windows_version = version.gsub('.', '_')
161165 previous_windows_version = previous_version.gsub('.', '_')
162166
167+ previous_link_version = previous_version.gsub('.', '-')
168+
163169 # format to match <a href='/2025/01/21/jruby-9-4-10-0'>release notes</a>
164- previous_link_re = %r{/\d+\/\d+\/\d+\/jruby\-#{major}\-#{second}\-#{previous_third}\-#{minor }}
170+ previous_link_re = %r{/\d+\/\d+\/\d+\/jruby\-#{previous_link_version }}
165171 puts previous_link_re
166172
167173 # We use full versions since we are doing simple text replacement. Only
0 commit comments