diff options
| author | Jack Nagel | 2013-06-22 22:46:40 -0500 |
|---|---|---|
| committer | Jack Nagel | 2013-06-22 22:47:00 -0500 |
| commit | 79a69b9b46f5efa3a370e24b652314f837abdc03 (patch) | |
| tree | b0037afff5a50e7d957984a51b9a4cf9065df84a /Library/Homebrew | |
| parent | 49e06a466972928fe5a416033a1e89ac63637a47 (diff) | |
| download | homebrew-79a69b9b46f5efa3a370e24b652314f837abdc03.tar.bz2 | |
Extract constant in GitHub module
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/utils.rb | 4 |
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 |
