class Fiesta::Github

Attributes

config[RW]

Public Class Methods

client() click to toggle source
# File lib/fiesta/github.rb, line 10
def self.client
  new.client
end

Public Instance Methods

client() click to toggle source
# File lib/fiesta/github.rb, line 14
def client
  Octokit::Client.new(config)
end

Private Instance Methods

config() click to toggle source
# File lib/fiesta/github.rb, line 20
def config
  self.class.config || default_config
end
default_config() click to toggle source
# File lib/fiesta/github.rb, line 24
def default_config
  { access_token: hub_config["oauth_token"] }.compact
end
hub_config() click to toggle source
# File lib/fiesta/github.rb, line 32
def hub_config
  YAML.load_file(hub_config_path)["github.com"].first
rescue Errno::ENOENT
  Logger.warn "No github config found at #{hub_config_path}, using ENV defaults (https://github.com/octokit/octokit.rb/blob/master/lib/octokit/default.rb)"
  {}
end
hub_config_path() click to toggle source
# File lib/fiesta/github.rb, line 28
def hub_config_path
  Dir.home + "/.config/hub"
end