class Prpr::Repository::Github

Public Class Methods

access_token() click to toggle source
# File lib/prpr/repository/github.rb, line 35
def access_token
  env[:github_access_token]
end
api_endpoint() click to toggle source
# File lib/prpr/repository/github.rb, line 27
def api_endpoint
  "https://#{github_host}/api/v3" if github_host
end
client_options() click to toggle source
# File lib/prpr/repository/github.rb, line 11
def client_options
  client_options_with_nil_value.reject {|key, value| value.nil? }
end
client_options_with_nil_value() click to toggle source
# File lib/prpr/repository/github.rb, line 15
def client_options_with_nil_value
  {
    access_token: access_token,
    api_endpoint: api_endpoint,
    web_endpoint: web_endpoint,
  }
end
default() click to toggle source
# File lib/prpr/repository/github.rb, line 7
def default
  Octokit::Client.new(client_options)
end
env() click to toggle source
# File lib/prpr/repository/github.rb, line 31
def env
  @env ||= Prpr::Config::Env.default
end
github_host() click to toggle source
# File lib/prpr/repository/github.rb, line 39
def github_host
  env[:github_host]
end
web_endpoint() click to toggle source
# File lib/prpr/repository/github.rb, line 23
def web_endpoint
  "https://#{github_host}/" if github_host
end