aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2013-06-22 22:46:40 -0500
committerJack Nagel2013-06-22 22:47:00 -0500
commit368963aa26e9335628174c4f6791b8f3f617ed14 (patch)
treeaed765009aa887300813df1acb3c9e7c5cbeb490 /Library
parent5439813c2712ab02191dfeb77df589d2a001e93b (diff)
downloadbrew-368963aa26e9335628174c4f6791b8f3f617ed14.tar.bz2
Extract constant in GitHub module
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/utils.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index 89542fe8e..e72452ee0 100644
--- a/Library/Homebrew/utils.rb
+++ b/Library/Homebrew/utils.rb
@@ -259,6 +259,8 @@ def nostdout
end
module GitHub extend self
+ ISSUES_URI = URI.parse("https://api.github.com/legacy/issues/search/mxcl/homebrew/open/")
+
def open url, headers={}, &block
default_headers = {'User-Agent' => HOMEBREW_USER_AGENT}
default_headers['Authorization'] = "token #{HOMEBREW_GITHUB_API_TOKEN}" if HOMEBREW_GITHUB_API_TOKEN
@@ -272,7 +274,7 @@ module GitHub extend self
end
def each_issue_matching(query, &block)
- uri = URI.parse("https://api.github.com/legacy/issues/search/mxcl/homebrew/open/#{query}")
+ uri = ISSUES_URI + query
open(uri) { |f| Utils::JSON.load(f.read)['issues'].each(&block) }
end