Method: Git::Lib#compare_version_to

Defined in:
lib/git/lib.rb

#compare_version_to(*other_version) ⇒ Integer

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns current_command_version <=> other_version

Examples:

lib.current_command_version #=> [2, 42, 0]

lib.compare_version_to(2, 41, 0) #=> 1
lib.compare_version_to(2, 42, 0) #=> 0
lib.compare_version_to(2, 43, 0) #=> -1

Parameters:

  • other_version (Array<Object>)

    the other version to compare to

Returns:

  • (Integer)

    -1 if this version is less than other_version, 0 if equal, or 1 if greater than



1659
1660
1661
# File 'lib/git/lib.rb', line 1659

def compare_version_to(*other_version)
  current_command_version <=> other_version
end