Commit 4c332ca9 authored by Achilleas Pipinellis's avatar Achilleas Pipinellis

Refactor docs raketask to use next unless

While adding the docs raketask to Omnibus in
https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/5275,
a rubocop offense suggested to use next. This ports the change
to the GitLab raketask as well.
parent 1a5f2e17
......@@ -112,13 +112,12 @@ namespace :gitlab do
# The remove_date of redirects.yaml should be nine months in the future.
# To not be confused with the remove_date of the Markdown page.
#
if remove_date < today
File.delete(filename) if File.exist?(filename)
next unless remove_date < today
puts " - from: #{old_path}"
puts " to: #{new_path(frontmatter['redirect_to'], filename)}"
puts " remove_date: #{remove_date >> 9}"
end
File.delete(filename) if File.exist?(filename)
puts " - from: #{old_path}"
puts " to: #{new_path(frontmatter['redirect_to'], filename)}"
puts " remove_date: #{remove_date >> 9}"
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment