Method: Github.api

Defined in:
lib/github.rb

.api(authorization_info = {}) ⇒ Object

Get an instance of the Octokit API class

Authorization info is the structure from here: developer.github.com/v3/oauth/#create-a-new-authorization

something like this:

:scopes => ['repo'],
:note => "git-scripts command line interface",
:note_url => "https://github.com/ifixit/git-scripts"



31
32
33
34
35
36
37
38
39
40
41
# File 'lib/github.rb', line 31

def self.api(authorization_info = {})
   # Let Octokit handle pagination automagically for us.
   Octokit.auto_paginate = true
   # Defaults
   authorization_info = {
      :scopes => ['repo'],
      :note => "ifixit git-scripts command line interface",
      :note_url => "https://github.com/ifixit/git-scripts"
   }.merge(authorization_info)
   OctokitWrapper.new(self::get_authentication(authorization_info))
end