jcoutu/gitnetworkitis — pull request #1 by cdidyk (2012-04-13 18:24:32+00:00)
Title: Github V3 API Support

This code changes Gitnetworkitis to support Github's v3 API. v2 will no longer be supported once this pull request is merged, but it's deprecated anyway. It also changes the API of Gitnetworkitis.

Some additional notes:

1. Gitnetworkitis now requires an OAuth 2 access token to work
2. Paging for Branch#commits had to be overhauled do to changes in how Github supports pagination. The new scheme allows for getting batched responses: responses that combine all of the pages of responses into what looks like a single one to the code that consumes it.
3. Since the Github API doesn't allow for a way to find only commits since a commit with a specific SHA was created, I added support for it in. The main reason is because otherwise, when you get commits for a specific branch, you dumbly page through all commits for the branch going back to the initial commit of the repository! It makes me cringe to think of what would happen while maintaining imports for a reasonably large repo with a host of feature branches. When fetching commits this way, Gitnetworkitis scans each response page as it gets them and checks to see if it has the commit with the specifiied SHA. If so, it stops paging and only returns the commits up to that point.
4. The testing may or may not be adequate. I opted for coarse-grained specs, and much of the Base#get functionality is tested through the Branch specs, since that's where it really gets accessed.
5. This pull request totally reorganizes how responses are acquired and stored (it uses VCR).