Class: Carson::Adapters::GitHub

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

Overview

Thin wrapper around the gh CLI for GitHub API access.

Instance Method Summary collapse

Constructor Details

#initialize(repo_root:) ⇒ GitHub

Returns a new instance of GitHub.



8
9
10
# File 'lib/carson/adapters/github.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/github.rb', line 12

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