aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Contributions
diff options
context:
space:
mode:
authorDaniel Lee Harple2013-05-14 10:42:46 -0400
committerJack Nagel2013-05-22 19:53:04 -0500
commit0fa5c47d7fa15d677f4604d60223d4db2c52e369 (patch)
treef77d69f6a2fa02fa39965bb161e8b76b881accdb /Library/Contributions
parent222f96d37b3c41b0538e96245ab37c6f01b872c2 (diff)
downloadbrew-0fa5c47d7fa15d677f4604d60223d4db2c52e369.tar.bz2
Check GitHub API rate limit instead of silently failing
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Contributions')
-rwxr-xr-xLibrary/Contributions/cmd/brew-ls-taps.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/Library/Contributions/cmd/brew-ls-taps.rb b/Library/Contributions/cmd/brew-ls-taps.rb
index c3741656b..600e0ad58 100755
--- a/Library/Contributions/cmd/brew-ls-taps.rb
+++ b/Library/Contributions/cmd/brew-ls-taps.rb
@@ -1,7 +1,7 @@
require 'vendor/multi_json'
-begin
- GitHub.open "https://api.github.com/legacy/repos/search/homebrew" do |f|
+GitHub.open "https://api.github.com/legacy/repos/search/homebrew" do |f|
+ begin
MultiJson.decode(f.read)["repositories"].each do |repo|
if repo['name'] =~ /^homebrew-(\S+)$/
puts tap = if repo['username'] == "Homebrew"
@@ -11,7 +11,6 @@ begin
end
end
end
+ rescue
end
-rescue
- nil
end