aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Contributions/cmd
diff options
context:
space:
mode:
authorDaniel Lee Harple2013-05-14 10:42:46 -0400
committerJack Nagel2013-05-22 19:53:04 -0500
commita113ebbfee5cfc96f95f1ac13b2ea110e58e05cc (patch)
tree8d85bbf3ac42f6a033e46c302df01228d190df99 /Library/Contributions/cmd
parent46941be352958eccec42d04894534b1c05f357a3 (diff)
downloadhomebrew-a113ebbfee5cfc96f95f1ac13b2ea110e58e05cc.tar.bz2
Check GitHub API rate limit instead of silently failing
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Contributions/cmd')
-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