docs/documentation/_plugins/openapi.rb
# 1 if a more stable than b or has higher version
# -1 if a less stable than b or has lower version
1 if a more stable than b or has higher version
1 if a less stable than b or has lower version
1 if a more stable than b or has higher version 1 if a less stable than b or has lower version
def compareAPIVersion(a,b)
        version = a['name'].scan(/v([1-9]+[0-9]*)((alpha|beta)([1-9]+[0-9]*))?/).flatten
        aVersion = {"majVersion" => version[0], "stability" => convertAPIVersionChannelToInt(version[2]), "minVersion" => version[3] ? version[3] : 3 }
        version = b['name'].scan(/v([1-9]+[0-9]*)((alpha|beta)([1-9]+[0-9]*))?/).flatten
        bVersion = {"majVersion" => version[0], "stability" => convertAPIVersionChannelToInt(version[2]), "minVersion" => version[3] ? version[3] : 3 }
        return -( aVersion["majVersion"] <=> bVersion["majVersion"] ) if aVersion["majVersion"] != bVersion["majVersion"]
        return -( aVersion["stability"] <=> bVersion["stability"] ) if aVersion["stability"] != bVersion["stability"]
        -( aVersion["minVersion"] <=> bVersion["minVersion"] )
    end
def compareAPIVersion ( a , b ) version = a [ 'name' ] . scan ( / v([1-9]+[0-9]*)((alpha|beta)([1-9]+[0-9]*))? / ) . flatten aVersion = { "majVersion" => version [ 0 ] , "stability" => convertAPIVersionChannelToInt ( version [ 2 ] ) , "minVersion" => version [ 3 ] ? version [ 3 ] : 3 } version = b [ 'name' ] . scan ( / v([1-9]+[0-9]*)((alpha|beta)([1-9]+[0-9]*))? / ) . flatten bVersion = { "majVersion" => version [ 0 ] , "stability" => convertAPIVersionChannelToInt ( version [ 2 ] ) , "minVersion" => version [ 3 ] ? version [ 3 ] : 3 } return - ( aVersion [ "majVersion" ] <=> bVersion [ "majVersion" ] ) if aVersion [ "majVersion" ] != bVersion [ "majVersion" ] return - ( aVersion [ "stability" ] <=> bVersion [ "stability" ] ) if aVersion [ "stability" ] != bVersion [ "stability" ] - ( aVersion [ "minVersion" ] <=> bVersion [ "minVersion" ] ) end
1 if a more stable than b or has higher version
1 if a less stable than b or has lower version
1 if a more stable than b or has higher version 1 if a less stable than b or has lower version
a
<not_specific>
b
<not_specific>