README.rdoc in github_api-0.1.1 vs README.rdoc in github_api-0.1.2
- old
+ new
@@ -1,28 +1,28 @@
-= github
+= github {<img src="http://travis-ci.org/peter-murach/github.png?branch=master" />}[http://travis-ci.org/peter-murach/github]
A Ruby wrapper for the GitHub REST API v3.
Supports all the API methods(nearly 200). It's build in a modular way, that is, you can either instantiate the whole api wrapper Github.new or use parts of it e.i. Github::Repos.new if working solely with repositories is your main concern.
== Installation
Grab the gem by issuing
- gem install github_api --pre
+ gem install github_api
or in your Gemfile
- gem "github_api", "~> 0.1.0.pre"
+ gem "github_api", "~> 0.1.1"
== Usage
Create a new client instance
@github = Github.new
-At this stage you can also supply various configuration parameters, such as :user, :repo, :org etc..,
+At this stage you can also supply various configuration parameters, such as :user, :repo, :org, :oauth_token, :login, :password or :basic_auth
which are used thoughtout the API
@github = Github.new :user => 'peter-murach', :repo => 'github-api'
In order to authenticate the user through OAuth2 on GitHub you need to
@@ -31,10 +31,17 @@
* authorize your credentials https://github.com/login/oauth/authorize
* get your token https://github.com/login/oauth/access_token
Once you have your consumer and token keys, configure your github instance following instructions under Configuration.
+You can also use basic authentication by passing your login and password credentials
+ @github = Github.new :login => 'peter-murach', :password => '...'
+
+ or use convenience method:
+
+ @github = Github.new :basic_auth => 'login:password'
+
You can interact with GitHub interface, for example repositories, by issueing following calls
@github.repos.commits
@github.repos.branches
@github.repos.contributors
@@ -113,14 +120,16 @@
Certain methods require authentication. To get your GitHub OAuth v2 credentials,
register an app at https://github.com/account/applications/
Github.configure do |config|
config.oauth_token = YOUR_OAUTH_ACCESS_TOKEN
+ config.basic_auth = 'login:password'
end
or
Github.new(:oauth_token => YOUR_OAUTH_TOKEN)
+ Github.new(:basic_auth => 'login:password)
All parameters can be overwirtten as per method call. By passing parameters hash...
== Examples