aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-02-12 12:17:32 -0500
committerJack Nagel2014-02-12 12:17:32 -0500
commit82a7415227e775f31a717b8b78093c6eb46a88b9 (patch)
treeaacfc7dac7dcea695f3a30f6e4ef458ea8de5f61 /Library
parent18aa10b39995385c0c4b974f4307645b07d9cf23 (diff)
downloadhomebrew-82a7415227e775f31a717b8b78093c6eb46a88b9.tar.bz2
Let the API do more work for us
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/utils.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index 490c5bf7d..8852d93b8 100644
--- a/Library/Homebrew/utils.rb
+++ b/Library/Homebrew/utils.rb
@@ -290,7 +290,7 @@ module GitHub extend self
def issues_matching(query)
uri = ISSUES_URI.dup
- uri.query = "q=#{uri_escape(query)}+repo:Homebrew/homebrew&per_page=100"
+ uri.query = "q=#{uri_escape(query)}+repo:Homebrew/homebrew+in:title&per_page=100"
open(uri) { |json| json["items"] }
end
@@ -305,9 +305,7 @@ module GitHub extend self
def issues_for_formula name
# don't include issues that just refer to the tool in their body
- issues_matching(name).select { |issue|
- issue["state"] == "open" && issue["title"].include?(name)
- }
+ issues_matching(name).select { |issue| issue["state"] == "open" }
end
def find_pull_requests rx
@@ -317,7 +315,7 @@ module GitHub extend self
query = rx.source.delete('.*').gsub('\\', '')
open_or_closed_prs = issues_matching(query).select do |issue|
- rx === issue["title"] && issue["pull_request"]["html_url"]
+ issue["pull_request"]["html_url"]
end
open_prs = open_or_closed_prs.select {|i| i["state"] == "open" }