Skip to content

Instantly share code, notes, and snippets.

@kyanny
Created January 10, 2014 08:18
Show Gist options
  • Select an option

  • Save kyanny/8348511 to your computer and use it in GitHub Desktop.

Select an option

Save kyanny/8348511 to your computer and use it in GitHub Desktop.
require "octokit"
def access_token
access_token ||= ["github", "ghi", "ghn"].each do |name|
val = `git config --global #{name}.token`.chomp
if val.present?
break val
end
end
end
def octokit
@client ||= Octokit::Client.new(access_token: access_token)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment