Sha256: e2b608cce96d102a3ffec14896b83b919a03f7c197c6ee58ec4f4c20207eee56

Contents?: true

Size: 637 Bytes

Versions: 44

Compression:

Stored size: 637 Bytes

Contents

require 'rubygems/version'

module PEBuild
  module Util
    # @api private
    #
    # @since 0.10.2
    module VersionString

      # Approximate comparison of two version strings using <=>
      #
      # Uses the Gem::Version class. Any nightly build tags, such as
      # `-rc4-165-g9a98c9f`, will be stripped from the version.
      #
      # @param a [String] The first version string.
      # @param b [String] The second version string.
      #
      # @return [Integer] A -1, 0 or 1.
      def self.compare(a, b)
        Gem::Version.new(a.split('-').first) <=> Gem::Version.new(b.split('-').first)
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
vagrant-pe_build-0.19.2 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.19.1 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.19.0 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.18.2 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.18.1 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.18.0 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.17.14 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.17.13 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.17.12 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.17.11 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.17.10 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.17.9 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.17.8 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.17.7 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.17.6 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.17.5 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.17.4 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.17.3 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.17.2 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.17.1 lib/pe_build/util/version_string.rb