Rubocop: Do not use unless with else

- Rewrite these with the positive case first
This commit is contained in:
Pat Hawks 2016-01-04 11:51:14 -08:00
parent ec83ef60b5
commit be3666fcf0
No known key found for this signature in database
GPG Key ID: F1746FF5F18B3D1B
1 changed files with 3 additions and 3 deletions

View File

@ -156,10 +156,10 @@ module Jekyll
clean_path = File.expand_path(questionable_path, "/") clean_path = File.expand_path(questionable_path, "/")
clean_path = clean_path.sub(/\A\w\:\//, '/') clean_path = clean_path.sub(/\A\w\:\//, '/')
unless clean_path.start_with?(base_directory.sub(/\A\w\:\//, '/')) if clean_path.start_with?(base_directory.sub(/\A\w\:\//, '/'))
File.join(base_directory, clean_path)
else
clean_path clean_path
else
File.join(base_directory, clean_path)
end end
end end