class GithubTV

Attributes

org[R]
repos[R]
token[R]

Public Class Methods

new(config) click to toggle source
# File lib/github-tv.rb, line 7
def initialize(config)
  @token = config.fetch 'token'
  @repos = config.fetch 'repos'
  @org   = config.fetch 'organization'
end

Public Instance Methods

run() click to toggle source
# File lib/github-tv.rb, line 13
def run
  repos.each do |repo|
    Sync.new(client, org, repo).run
  end
end

Private Instance Methods

client() click to toggle source
# File lib/github-tv.rb, line 21
def client
  @client ||= Octokit::Client
    .new(access_token: token)
    .tap(&:user) # check auth

rescue Octokit::Unauthorized
  raise "Your token (#{token.inspect}) is invalid"
end