From be3666fcf05b3f61208df606911000071e7d895f Mon Sep 17 00:00:00 2001 From: Pat Hawks Date: Mon, 4 Jan 2016 11:51:14 -0800 Subject: [PATCH] Rubocop: Do not use unless with else - Rewrite these with the positive case first --- lib/jekyll.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/jekyll.rb b/lib/jekyll.rb index 6c5d8f10..8b92a045 100644 --- a/lib/jekyll.rb +++ b/lib/jekyll.rb @@ -156,10 +156,10 @@ module Jekyll clean_path = File.expand_path(questionable_path, "/") clean_path = clean_path.sub(/\A\w\:\//, '/') - unless clean_path.start_with?(base_directory.sub(/\A\w\:\//, '/')) - File.join(base_directory, clean_path) - else + if clean_path.start_with?(base_directory.sub(/\A\w\:\//, '/')) clean_path + else + File.join(base_directory, clean_path) end end