Class: Dude::CodeManagement::Github::Client
- Inherits:
-
Object
- Object
- Dude::CodeManagement::Github::Client
- Defined in:
- lib/dude/code_management/github/client.rb
Instance Method Summary collapse
- #client ⇒ Object
- #create_pull_request(issue:, owner:, repo:, params:) ⇒ Object
- #health_check ⇒ Object
Instance Method Details
#client ⇒ Object
9 10 11 12 13 |
# File 'lib/dude/code_management/github/client.rb', line 9 def client @client ||= Faraday.new('https://api.github.com/', { headers: { Authorization: "token #{Dude::SETTINGS.dig(:github, :token)}" } }) end |
#create_pull_request(issue:, owner:, repo:, params:) ⇒ Object
15 16 17 |
# File 'lib/dude/code_management/github/client.rb', line 15 def create_pull_request(issue:, owner:, repo:, params:) CreatePullRequest.new.call(client, issue: issue, owner: owner, repo: repo, params: params) end |
#health_check ⇒ Object
19 20 21 22 23 |
# File 'lib/dude/code_management/github/client.rb', line 19 def health_check client.get('https://api.github.com/user').status == 200 rescue StandardError false end |