Rubocop: Do not use unless with else
- Rewrite these with the positive case first
This commit is contained in:
parent
ec83ef60b5
commit
be3666fcf0
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue