Ruby Gem - An intuitive wrapper for the Github Api v3.
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

rubhub - Ruby Gem for the Github API

A minimal Ruby Gem created for making interaction with the Github API(v3) easy and predictable.


gem install rubhub

Basic Authentication

Use a username and password associated with a Github account.


require 'rubhub'
g = username, password )

Making Requests

Use the API documentation as a reference. The library is structured exactly like the API v3 documentation.

Example Request for Authenticated User's Data

response = g.users.getUser()

The response...

    "type": "User",
    "url": "",
    "private_gists": 2,
    "created_at": "2011-07-07T22:20:48Z",
    "email": "",
    "html_url": "",
    "gravatar_id": "123123123123123123123123123",
    "collaborators": 1,
    "hireable": false,
    "disk_usage": 13348,
    "total_private_repos": 3,
    "following": 4,
    "blog": "",
    "bio": null,
    "avatar_url": "",
    "login": "username",
    "owned_private_repos": 3,
    "followers": 1,
    "name": "Your Name",
    "plan": {
        "private_repos": 10,
        "collaborators": 3,
        "space": 614400,
        "name": "micro"
    "location": "Your City, NY",
    "id": 902312,
    "public_repos": 0,
    "public_gists": 17,
    "company": "Your Company Name, LLC"

Example Request Creating a New Repository

# Using just the new Repo name
response = g.repos.createUserRepo( "MyNewRepo" )

# Using some other parameters
name = 'MyNewRepo'
desc = 'Some description.'
page = ''
private = TRUE
has_issues = TRUE
has_wiki = TRUE
has_downloads = TRUE
response = g.repos.createUserRepo( name, desc, page, private, has_issues, has_wiki, has_downloads )

The response...

    "url": "",
    "watchers": 1,
    "has_issues": true,
    "created_at": "2012-02-14T03:40:49Z",
    "html_url": "",
    "has_downloads": true,
    "ssh_url": "",
    "svn_url": "",
    "description": "Some description.",
    "mirror_url": null,
    "clone_url": "",
    "forks": 1,
    "fork": false,
    "has_wiki": true,
    "private": True,
    "homepage": "",
    "size": 0,
    "updated_at": "2012-02-14T03:40:49Z",
    "owner": {
        "url": "",
        "avatar_url": "",
        "gravatar_id": "948f18791231231231231231231",
        "login": "username",
        "id": 901650
    "name": "MyNewRepo",
    "open_issues": 0,
    "master_branch": null,
    "pushed_at": null,
    "id": 3436770,
    "git_url": "git://",
    "language": null