Created
September 16, 2015 18:00
-
-
Save Roemerb/85595761d6292b663830 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'octokit' | |
module Gissues | |
class Github::User < Gissues::Github | |
def initialize | |
@client = nil | |
@token = nil | |
end | |
def request_token(username, password) | |
@client = Octokit::Client.new(:login => username, :password => password) | |
begin | |
authorization = @client.create_authorization(:scopes => ["user","repo"], :note => "Gissues CLI issue manager") | |
@token = authorization[:token] | |
rescue | |
puts "Invalid credentials, please try again." | |
end | |
end | |
def signed_in? | |
@token != nil | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment