Sha256: f362441a0921314b2c7a66e67d15410a88222e9335f27b421f7aaf1275ec5f41
Contents?: true
Size: 1.59 KB
Versions: 1
Compression:
Stored size: 1.59 KB
Contents
#!/usr/bin/env ruby require 'optparse' require 'methadone' require 'octokit' require 'soopr.rb' class String # colorization def colorize(color_code) "\e[#{color_code}m#{self}\e[0m" end def red colorize(31) end def green colorize(32) end def blue colorize(34) end end class App include Methadone::Main include Methadone::CLILogging main do |organisation, team| Octokit.configure do |c| c.netrc = true end debug "Starting to fetch teams for organisation '#{organisation}'" teams = Octokit.organization_teams organisation team_resource = teams.find{ |t| t.name == team} if team_resource.nil? exit_now! 1, "No team with name '#{team}' could be found" end debug "Starting to fetch repos for team '#{team}'" repos = Octokit.team_repositories(team_resource.id) .select{|r| r.open_issues_count > 10} if repos.empty? puts "No open pull requests found.".green else debug "Open pull requests for '#{team}':" repos.each do |repo| pull_requests = Octokit.pull_requests repo.id if pull_requests.size > 0 then puts "# #{repo.name}".red pull_requests.each do |pr| puts "- #{pr.title}: ".blue + "#{pr.html_url}\n\n".green end end end end end version Soopr::VERSION description 'List open pull requests of a Github team' arg :organisation, "Github organisation the team belongs to" arg :team, "Github team from which to list open pull requests" use_log_level_option :toggle_debug_on_signal => 'USR1' go! end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
soopr-0.1.0 | bin/soopr |