Module: InchCI::GitHubInfo

Defined in:
lib/inch_ci/git_hub_info.rb

Overview

Retrieves project specific information via the GitHub API.

Defined Under Namespace

Classes: Repo, User

Class Method Summary collapse

Class Method Details

.clientObject


7
8
9
10
11
12
13
14
15
16
# File 'lib/inch_ci/git_hub_info.rb', line 7

def self.client
  @client ||= begin
    options = if AccessToken[:github_client_id] && AccessToken[:github_secret]
      {:client_id => AccessToken[:github_client_id], :client_secret => AccessToken[:github_secret]}
    else
      {:access_token => AccessToken[:github]}
    end
    Octokit::Client.new(options.merge(:per_page => 100))
  end
end

.repo(nwo) ⇒ Object


18
19
20
# File 'lib/inch_ci/git_hub_info.rb', line 18

def self.repo(nwo)
  Repo.new(client.repository(nwo))
end

.user(user_name) ⇒ Object


22
23
24
# File 'lib/inch_ci/git_hub_info.rb', line 22

def self.user(user_name)
  User.new(user_name)
end