Class: Gitt::Shell

Inherits:
Object
  • Object
show all
Defined in:
lib/gitt/shell.rb

Overview

A low-level shell client.

Instance Method Summary collapse

Constructor Details

#initialize(client: Open3) ⇒ Shell

Returns a new instance of Shell.



11
12
13
# File 'lib/gitt/shell.rb', line 11

def initialize client: Open3
  @client = client
end

Instance Method Details

#callObject



15
16
17
18
19
# File 'lib/gitt/shell.rb', line 15

def call(*, **)
  client.capture3("git", *, **).then do |stdout, stderr, status|
    status.success? ? Success(stdout) : Failure(stderr)
  end
end