Class: Git::Commands::Version Private

Inherits:
Base
  • Object
show all
Defined in:
lib/git/commands/version.rb

Overview

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

Note:

arguments block audited against https://git-scm.com/docs/git-version/2.53.0

Wrapper for the git version command

Prints the git suite version.

Examples:

Basic usage

version = Git::Commands::Version.new(execution_context)
result = version.call
result.stdout #=> "git version 2.42.0"

See Also:

Instance Method Summary collapse

Methods inherited from Base

allow_exit_status, arguments, #initialize, requires_git_version, skip_version_validation

Constructor Details

This class inherits a constructor from Git::Commands::Base

Instance Method Details

#call(**options) ⇒ Git::CommandLineResult

Execute the git version command.

Parameters:

  • options (Hash)

    command options

Options Hash (**options):

  • :build_options (Boolean, nil) — default: nil

    include build options in the output

Returns:

Raises:

  • (ArgumentError)

    if unsupported options are provided

  • (Git::FailedError)

    if git exits with a non-zero exit status



# File 'lib/git/commands/version.rb', line 35