OctocatNap

OctocatNap is a Ruby interface to the GitHub API v2.

The source of it's power is Weary.

Install

sudo gem sources -a http://gems.github.com  # If you haven't done that already
sudo gem install mwunsch-octocatnap

* Someday we can put this on Rubyforge

Requires

  • Weary >= 0.4.1

Authenticating

When you instantiate OctocatNap, you can pass different types of arguments to pass your credentials to the methods.

Explicitly

gh = OctocatNap.new("mwunsch", "my-super-secret-token")

or

gh = OctocatNap.new(["mwunsch","my-super-secret-token"])

or

gh = OctocatNap.new({:login => "mwunsch", :token => "my-super-secret-token"})

YAML

If you provide just one string when you instantiate, OctocatNap thinks that's the path to a file.

gh = OctocatNap.new(File.join(File.dirname(__FILE__), '..', "config.yml"))

That file should look something like this:

login: mwunsch
token: my-super-secret-token

~/.gitconfig

You can also get credentials from the global .gitconfig, as long as that is set up with your GitHub credentials

gh = OctocatNap.new(true)

This assumes your gitconfig is in a standard place, as detailed here: http://github.com/blog/180-local-github-config

API and Documentation

Coming soon. Keep an eye on the Wiki.

License

Copyright (c) 2009 Mark Wunsch. See LICENSE for details.