Skip to content

Commit

Permalink
Use octokit's auto pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
glasnt committed Oct 3, 2014
1 parent 3992c2f commit 4f78e0b
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions lib/github-release.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ def run
private
def api
@api ||= Octokit::Client.new(:access_token => token)
@api.auto_paginate = true
@api
end

def token
Expand Down Expand Up @@ -91,20 +93,10 @@ def remote_name
end

def github_releases
@github_releases ||= api_repo_rels[:releases].get.data.map(&:tag_name)
@github_releases ||= api.releases(repo_name).map(&:tag_name)
log_val(@github_releases)
end

def api_repo
@api_repo ||= api.repo(repo_name)
log_val(@api_repo)
end

def api_repo_rels
@api_repo_rels ||= api_repo.rels
log_val(@api_repo_rels)
end

def git_config(item, default = nil)
@config_cache ||= {}

Expand Down

0 comments on commit 4f78e0b

Please sign in to comment.