From 287bd2d52c69b23ce579eeb8e13b1a12a1103f46 Mon Sep 17 00:00:00 2001 From: Riccardo Porreca Date: Fri, 7 Jan 2022 16:22:59 -0500 Subject: [PATCH] Lint --- lib/html_proofer/cache.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/html_proofer/cache.rb b/lib/html_proofer/cache.rb index a35a3680..e4fa63bd 100644 --- a/lib/html_proofer/cache.rb +++ b/lib/html_proofer/cache.rb @@ -98,18 +98,18 @@ def detect_url_changes(urls_detected, type) if @cache_log[type].include?(url) # if this is false, we're trying again - if type == :external - found = @cache_log[type][url][:found] + found = if type == :external + @cache_log[type][url][:found] + else + @cache_log[type][url][:metadata].all? { |m| m[:found] } + end + if found + # update the cached metadata (there might be more locations found cached for the link) + @cache_log[type][url][:metadata] = metadata else - found = @cache_log[type][url][:metadata].all? { |m| m[:found] } - end - if not found @logger.log :debug, "Re-adding not found #{url} to #{type} cache" # metadata will be updated when re-adding the url, and must be re-intialized for internal links @cache_log[type][url][:metadata] = [] - else - # update the cached metadata (there might be more locations found cached for the link) - @cache_log[type][url][:metadata] = metadata end found else