Created
July 8, 2014 01:23
-
-
Save mmcdaris/1a2421b5dad5fddd5c0b to your computer and use it in GitHub Desktop.
get your issues on!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'octokit' | |
class Github | |
attr_accessor :cli, :user, :gh_user | |
def initialize(user) | |
@gh_user = user | |
@cli = Octokit::Client.new(access_token: ENV["GH_KEY"]) | |
@user = @cli.user | |
@user.login | |
end | |
# where repo is something like 'airbrake/airbrake' | |
def issues(repo, label, acct=@gh_user) | |
issues = @cli.issues "#{acct}/#{repo}", per_page: 100 | |
with_labels = issues.select {|i| i.labels.present? } | |
with_labels.select {|i| i.labels.map{|l| l[:name]}.include?(label) } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
use with something like: