Sha256: 7cfa3009eb083988f8a3d27fdef6e50b6021e2460fdedd0908a582e52becac82
Contents?: true
Size: 731 Bytes
Versions: 211
Compression:
Stored size: 731 Bytes
Contents
require 'puppet/util/package' # Compares two version numbers. # # Prototype: # # \$result = versioncmp(a, b) # # Where a and b are arbitrary version strings. # # This function returns: # # * `1` if version a is greater than version b # * `0` if the versions are equal # * `-1` if version a is less than version b # # @example # # if versioncmp('2.6-1', '2.4.5') > 0 { # notice('2.6-1 is > than 2.4.5') # } # # This function uses the same version comparison algorithm used by Puppet's # `package` type. # Puppet::Functions.create_function(:versioncmp) do dispatch :versioncmp do param 'String', :a param 'String', :b end def versioncmp(a, b) Puppet::Util::Package.versioncmp(a, b) end end
Version data entries
211 entries across 211 versions & 3 rubygems