From 0fa5c47d7fa15d677f4604d60223d4db2c52e369 Mon Sep 17 00:00:00 2001 From: Daniel Lee Harple Date: Tue, 14 May 2013 10:42:46 -0400 Subject: Check GitHub API rate limit instead of silently failing Signed-off-by: Jack Nagel --- Library/Contributions/cmd/brew-ls-taps.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'Library/Contributions/cmd') 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 -- cgit v1.2.3