Pass the string instead of reconstructing it from a regexp

This commit is contained in:
Jack Nagel 2014-02-12 13:59:18 -05:00
parent 0a3794776e
commit 345457b33e
2 changed files with 2 additions and 4 deletions

View File

@ -62,7 +62,7 @@ module Homebrew extend self
if count == 0 and not blacklisted? query if count == 0 and not blacklisted? query
puts "No formula found for #{query.inspect}." puts "No formula found for #{query.inspect}."
begin begin
GitHub.find_pull_requests(rx) { |pull| puts pull } GitHub.find_pull_requests(query) { |pull| puts pull }
rescue GitHub::Error => e rescue GitHub::Error => e
opoo e.message opoo e.message
end end

View File

@ -308,12 +308,10 @@ module GitHub extend self
issues_matching(name).select { |issue| issue["state"] == "open" } issues_matching(name).select { |issue| issue["state"] == "open" }
end end
def find_pull_requests rx def find_pull_requests query
return if ENV['HOMEBREW_NO_GITHUB_API'] return if ENV['HOMEBREW_NO_GITHUB_API']
puts "Searching pull requests..." puts "Searching pull requests..."
query = rx.source.delete('.*').gsub('\\', '')
open_or_closed_prs = issues_matching(query).select do |issue| open_or_closed_prs = issues_matching(query).select do |issue|
issue["pull_request"]["html_url"] issue["pull_request"]["html_url"]
end end