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(*all) ⇒ 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(*all) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/gitt/shell.rb', line 15 def call(*all, **) environment, arguments = all.partition { it.is_a? Hash } client.capture3(*environment, "git", *arguments, **).then do |stdout, stderr, status| status.success? ? Success(stdout) : Failure(stderr) end end |