Class: Gitt::Shell
- Inherits:
-
Object
- Object
- Gitt::Shell
- Defined in:
- lib/gitt/shell.rb
Overview
A low-level shell client.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(client: Open3) ⇒ Shell
constructor
A new instance of Shell.
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
#call ⇒ Object
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 |