Class: Carson::Adapters::Git

Inherits:
Object
  • Object
show all
Defined in:
lib/carson/adapters/git.rb

Overview

Thin wrapper around the git CLI. Runs commands via Open3.

Instance Method Summary collapse

Constructor Details

#initialize(repo_root:) ⇒ Git

Returns a new instance of Git.



8
9
10
# File 'lib/carson/adapters/git.rb', line 8

def initialize( repo_root: )
	@repo_root = repo_root
end

Instance Method Details

#run(*args) ⇒ Object



12
13
14
15
# File 'lib/carson/adapters/git.rb', line 12

def run( *args )
	stdout_text, stderr_text, status = Open3.capture3( "git", *args, chdir: repo_root )
	[ stdout_text, stderr_text, status.success?, status.exitstatus ]
end