Class: Everlog::Inf::Api::Github

Inherits:
Everlog::Inf::Api show all
Defined in:
lib/everlog/inf/api/github.rb

Instance Method Summary collapse

Methods inherited from Everlog::Inf::Api

#initialize

Constructor Details

This class inherits a constructor from Everlog::Inf::Api

Instance Method Details

#clientObject



5
6
7
# File 'lib/everlog/inf/api/github.rb', line 5

def client
  @client ||= Octokit::Client.new(access_token: @config.access_secret)
end

#commits_on(repo, date) ⇒ Object



15
16
17
18
19
# File 'lib/everlog/inf/api/github.rb', line 15

def commits_on(repo, date)
  client.commits_on("#{client.user.name}/#{repo}", utc_from_jst(date))
rescue => e
  raise InfrastructureGithubError, "commits_on error / #{e.message}"
end

#reposObject



9
10
11
12
13
# File 'lib/everlog/inf/api/github.rb', line 9

def repos
  client.repositories
rescue => e
  raise InfrastructureGithubError, "repos error / #{e.message}"
end