@@ -150,18 +150,24 @@ def create_post(version)
150
150
end
151
151
152
152
def 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
159
163
160
164
windows_version = version . gsub ( '.' , '_' )
161
165
previous_windows_version = previous_version . gsub ( '.' , '_' )
162
166
167
+ previous_link_version = previous_version . gsub ( '.' , '-' )
168
+
163
169
# 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 } }
165
171
puts previous_link_re
166
172
167
173
# We use full versions since we are doing simple text replacement. Only
0 commit comments