class GithubDailyUpdate::Reporter::OpenPulls
This reporter generates a list of all the open pull-requests for an Org
Public Instance Methods
generate()
click to toggle source
# File lib/github_daily_update/reporters/open_pulls.rb, line 3 def generate output = "## Open Pulls\n\n" output += open_pull_requests.map { |pull| template % pull }.join("\n") output end
Private Instance Methods
extract_values(repo, pull)
click to toggle source
# File lib/github_daily_update/reporters/open_pulls.rb, line 29 def extract_values(repo, pull) [repo.full_name, pull.number, pull.title] end
open_pull_requests()
click to toggle source
# File lib/github_daily_update/reporters/open_pulls.rb, line 15 def open_pull_requests org_repositories.map do |repo| open_pulls_in_repo(repo).map { |pull| extract_values(repo, pull) } end.flatten(1) end
open_pulls_in_repo(repo)
click to toggle source
# File lib/github_daily_update/reporters/open_pulls.rb, line 25 def open_pulls_in_repo(repo) repo.rels[:pulls].get(state: 'open').data end
org_repositories()
click to toggle source
# File lib/github_daily_update/reporters/open_pulls.rb, line 21 def org_repositories Octokit.organization_repositories(options[:org]) end
template()
click to toggle source
# File lib/github_daily_update/reporters/open_pulls.rb, line 11 def template '- %s#%d: %s' end