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.17.0 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.16.0 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.15.6 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.15.5 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.15.4 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.15.3 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.15.1 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.15.0 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.14.2 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.14.1 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.14.0 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.13.7 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.13.6 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.13.5 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.13.4 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.13.3 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.13.2 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.13.1 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.13.0 lib/pe_build/util/version_string.rb
vagrant-pe_build-0.12.0 lib/pe_build/util/version_string.rb