From 471502bc06e8dde06618b30885d21d10c53528e5 Mon Sep 17 00:00:00 2001 From: Daniel Lee Harple Date: Sat, 18 May 2013 08:34:28 -0400 Subject: Remove unnecessary rescue-all exception handling Signed-off-by: Jack Nagel --- Library/Homebrew/cmd/search.rb | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'Library/Homebrew/cmd') diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb index 2ceefd2ce..e86594253 100644 --- a/Library/Homebrew/cmd/search.rb +++ b/Library/Homebrew/cmd/search.rb @@ -64,16 +64,13 @@ module Homebrew extend self results = [] GitHub.open "https://api.github.com/repos/#{user}/homebrew-#{repo}/git/trees/HEAD?recursive=1" do |f| - begin - user.downcase! if user == "Homebrew" # special handling for the Homebrew organization - MultiJson.decode(f.read)["tree"].map{ |hash| hash['path'] }.compact.each do |file| - name = File.basename(file, '.rb') - if file =~ /\.rb$/ and name =~ rx - results << "#{user}/#{repo}/#{name}" - $found += 1 - end + user.downcase! if user == "Homebrew" # special handling for the Homebrew organization + MultiJson.decode(f.read)["tree"].map{ |hash| hash['path'] }.compact.each do |file| + name = File.basename(file, '.rb') + if file =~ /\.rb$/ and name =~ rx + results << "#{user}/#{repo}/#{name}" + $found += 1 end - rescue end end results -- cgit v1.2.3