# File languages-statistics.rb, line 189 def fetch_uri(uri_string, limit = 10 ) raise ArgumentError, 'http redirect too deep' if limit == 0 response = Net::HTTP.get_response(URI.parse(uri_string)) case response when Net::HTTPSuccess then response when Net::HTTPRedirection then fetch_uri(response['location'], limit - 1) else response.error! end end