lib/git-process/github_configuration.rb
#
# Connects to GitHub to get an OAuth token.
#
# @param [Hash] opts
# @option opts [String] :base_url The base URL to use for the GitHub server
# @option opts [String] :remote_name (#remote_name) The "remote" name to use (e.g., 'origin')
# @option opts [String] :user the username to authenticate with
# @option opts [String] :password (#password) the password to authenticate with
#
# @return [String] the OAuth token
#
Connects to GitHub to get an OAuth token.
Connects to GitHub to get an OAuth token .
def create_authorization(opts = {})
      username = opts[:user] || self.user
      remote = opts[:remote_name] || self.remote_name
      logger.info("Authorizing #{username} to work with #{remote}.")
      auth = create_pw_client(opts).create_authorization(
          :scopes => %w(repo user gist),
          :note => 'Git-Process',
          :note_url => 'http://jdigger.github.com/git-process')
      config_auth_token = auth['token']
      gitlib.config['gitProcess.github.authToken'] = config_auth_token
      config_auth_token
    end
def create_authorization ( opts = { } ) username = opts [ :user ] || self . user remote = opts [ :remote_name ] || self . remote_name logger . info ( "Authorizing #{username} to work with #{remote}." ) auth = create_pw_client ( opts ) . create_authorization ( :scopes => %w( repo user gist ) , :note => 'Git-Process' , :note_url => 'http://jdigger.github.com/git-process' ) config_auth_token = auth [ 'token' ] gitlib . config [ 'gitProcess.github.authToken' ] = config_auth_token config_auth_token end
Connects to GitHub to get an OAuth token.
Connects to GitHub to get an OAuth token .
# remember it for next time
the OAuth token
the OAuth token
String
opts
None
<not_specific>
None