README.rdoc in github_api-0.2.2 vs README.rdoc in github_api-0.3.0
- old
+ new
@@ -26,11 +26,11 @@
You can authenticate either using OAuth authentication convenience methods(see section OAuth) or through basic authentication by passing your login and password credentials
@github = Github.new :login => 'peter-murach', :password => '...'
- or use convenience method:
+or use convenience method:
@github = Github.new :basic_auth => 'login:password'
You can interact with GitHub interface, for example repositories, by issueing following calls
@@ -65,10 +65,11 @@
Github::Issues
Github::Orgs
Github::PullRequests
Github::Repos
Github::Users
+ Github::Authorizations
Some parts of GitHub API v3 require you to be autheticated, for instance the following are examples of APIs only for the authenticated user
Github::Users::Emails
Github::Users::Keys
@@ -114,9 +115,16 @@
After you get your authorization code, call to receive your access_token
token = github.get_token( authorization_code )
Once you have your access token, configure your github instance following instructions under Configuration.
+
+Alternatively you can use OAuth Authorizations API. For instance, to create access token through GitHub API do following
+
+ @github = Github.new :basic_auth => 'login:password'
+ @github.oauth.create_authorization 'scopes' => ['repo']
+
+You can add more than one scope from the <tt>user</tt>, <tt>public_repo</tt>, <tt>repo</tt>, <tt>gist</tt> or leave the scopes parameter out, in which case, the default read-only access will be assumed(includes public user profile info, public repo info, and gists).
== MIME Types
Issues, PullRequests and few other API leverage custom mime types which are <tt>:json</tt>, <tt>:blob</tt>, <tt>:raw</tt>, <tt>:text</tt>, <tt>:html</tt>, <tt>:full</tt>. By default <tt>:raw</tt> is used.