File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -464,6 +464,7 @@ def prereleases
464464 links
465465 end
466466
467+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
467468 def compare_versions ( first , second )
468469 # Sort by version number
469470 numeric_comparation = first . to_f <=> second . to_f
@@ -481,9 +482,16 @@ def compare_versions(first, second)
481482 return -1 if is_first_gm && !is_second_gm
482483 return 1 if !is_first_gm && is_second_gm
483484
485+ # Return Release Candidate versions before others
486+ is_first_rc = first . include? ( 'RC' ) || first . include? ( 'Release Candidate' )
487+ is_second_rc = second . include? ( 'RC' ) || second . include? ( 'Release Candidate' )
488+ return -1 if is_first_rc && !is_second_rc
489+ return 1 if !is_first_rc && is_second_rc
490+
484491 # Sort alphabetically
485492 first <=> second
486493 end
494+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
487495
488496 def hdiutil ( *args )
489497 io = IO . popen ( [ 'hdiutil' , *args ] )
You can’t perform that action at this time.
0 commit comments