fcoury / octopi

A Ruby interface to GitHub API v2
http://hasmany.info/2009/4/18/ruby-interface-to-github-api
MIT License
216 stars 47 forks source link

Paginated Results for Commits #44

Open bry4n opened 14 years ago

bry4n commented 14 years ago

It seems like Commit API v2 supports pagination.

See:

curl "http://github.com/api/v2/json/commits/list/mojombo/grit/master?page=3"

It would be nice if we can use something like this way or other way:

repo = Repository.find(:user => "fcoury", :name => "octopi", :page => 3)
radar commented 13 years ago

Hey, sorry about the lag. If you're still interested in having this feature in, I'd be more than happy to review a patch.

jamieforrest commented 13 years ago

You can accomplish this by calling, for instance:

commits = repo.commits('master?page=2')

Or whatever branch name you want instead of master. But it would be nice to have the Commit.find_all method work as an iterator that returned the pages as you needed them (as mentioned here https://github.com/fcoury/octopi/issues/19)