Skip to content

Commit 34cf0c7

Browse files
committed
Tolerate snapshot release _data
I want to install a mocked out release YAML and overwrite the currentVersion in the snapshot website so that the new release appears in the release-archive and is the first release you see at http://kroxylicious.io/kroxylicious/documentation/ Signed-off-by: Robert Young <[email protected]>
1 parent d1f6e12 commit 34cf0c7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

_plugins/sort_hash_by.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ def sort_by_semver_key(hash, direction = 'desc')
1010

1111
normalized_str = key_str.gsub('.', '_')
1212

13-
unless normalized_str.match?(/\A\d+_\d+_\d+\z/)
14-
raise ArgumentError, "Invalid semver key in 'sort_by_semver_key'. Expected '1.2.3' or '1_2_3', but found '#{key_str}'."
13+
unless normalized_str.match?(/\A\d+_\d+_\d+(?:-SNAPSHOT)?\z/)
14+
raise ArgumentError, "Invalid semver key in 'sort_by_semver_key'. Expected '1.2.3[-SNAPSHOT]' or '1_2_3[-SNAPSHOT]', but found '#{key_str}'."
1515
end
1616

17-
normalized_str.split('_').map { |part| part.rjust(5, '0') }.join('.')
17+
normalized_str.split('_').map { |part| part.rjust(12, '0') }.join('.')
1818
end
1919

2020
# controlling this from the filter is convenient because 'sort_by_semver_key | reverse' doesn't work as expected

0 commit comments

Comments
 (0)