Rubocop: Style/NegatedIf

- Favor unless over if for negative conditions
This commit is contained in:
Pat Hawks 2016-01-03 15:59:12 -08:00
parent 663a2d3279
commit 704ca6b8cc
No known key found for this signature in database
GPG Key ID: F1746FF5F18B3D1B
5 changed files with 5 additions and 5 deletions

View File

@ -13,7 +13,7 @@ module Jekyll
# Cleans up the site's destination directory
def cleanup!
FileUtils.rm_rf(obsolete_files)
FileUtils.rm_rf(metadata_file) if !@site.incremental?
FileUtils.rm_rf(metadata_file) unless @site.incremental?
end
private

View File

@ -59,7 +59,7 @@ module Jekyll
end
def fsnotify_buggy?(site)
return true if !Utils::Platforms.osx?
return true unless Utils::Platforms.osx?
if Dir.pwd != `pwd`.strip
Jekyll.logger.error " " + <<-STR.strip.gsub(/\n\s+/, "\n ")
We have detected that there might be trouble using fsevent on your

View File

@ -52,7 +52,7 @@ module Jekyll
def set_defaults
hash_ = @jekyll_opts.fetch("webrick", {}).fetch("headers", {})
DEFAULTS.each_with_object(@headers = hash_) do |(key, val), hash|
hash[key] = val if !hash.key?(key)
hash[key] = val unless hash.key?(key)
end
end
end

View File

@ -7,7 +7,7 @@ module Jekyll
def setup
return if @setup
if (!@parser = get_processor)
unless (@parser = get_processor)
Jekyll.logger.error "Invalid Markdown processor given:", @config["markdown"]
Jekyll.logger.info "", "Custom processors are not loaded in safe mode" if @config["safe"]
Jekyll.logger.error "", "Available processors are: #{valid_processors.join(", ")}"

View File

@ -119,7 +119,7 @@ module Jekyll
def add_dependency(path, dependency)
return if (metadata[path].nil? || @disabled)
if !metadata[path]["deps"].include? dependency
unless metadata[path]["deps"].include? dependency
metadata[path]["deps"] << dependency
add(dependency) unless metadata.include?(dependency)
end