Rubocop: Style/NegatedIf
- Favor unless over if for negative conditions
This commit is contained in:
parent
663a2d3279
commit
704ca6b8cc
|
@ -13,7 +13,7 @@ module Jekyll
|
||||||
# Cleans up the site's destination directory
|
# Cleans up the site's destination directory
|
||||||
def cleanup!
|
def cleanup!
|
||||||
FileUtils.rm_rf(obsolete_files)
|
FileUtils.rm_rf(obsolete_files)
|
||||||
FileUtils.rm_rf(metadata_file) if !@site.incremental?
|
FileUtils.rm_rf(metadata_file) unless @site.incremental?
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -59,7 +59,7 @@ module Jekyll
|
||||||
end
|
end
|
||||||
|
|
||||||
def fsnotify_buggy?(site)
|
def fsnotify_buggy?(site)
|
||||||
return true if !Utils::Platforms.osx?
|
return true unless Utils::Platforms.osx?
|
||||||
if Dir.pwd != `pwd`.strip
|
if Dir.pwd != `pwd`.strip
|
||||||
Jekyll.logger.error " " + <<-STR.strip.gsub(/\n\s+/, "\n ")
|
Jekyll.logger.error " " + <<-STR.strip.gsub(/\n\s+/, "\n ")
|
||||||
We have detected that there might be trouble using fsevent on your
|
We have detected that there might be trouble using fsevent on your
|
||||||
|
|
|
@ -52,7 +52,7 @@ module Jekyll
|
||||||
def set_defaults
|
def set_defaults
|
||||||
hash_ = @jekyll_opts.fetch("webrick", {}).fetch("headers", {})
|
hash_ = @jekyll_opts.fetch("webrick", {}).fetch("headers", {})
|
||||||
DEFAULTS.each_with_object(@headers = hash_) do |(key, val), hash|
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,7 +7,7 @@ module Jekyll
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
return if @setup
|
return if @setup
|
||||||
if (!@parser = get_processor)
|
unless (@parser = get_processor)
|
||||||
Jekyll.logger.error "Invalid Markdown processor given:", @config["markdown"]
|
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.info "", "Custom processors are not loaded in safe mode" if @config["safe"]
|
||||||
Jekyll.logger.error "", "Available processors are: #{valid_processors.join(", ")}"
|
Jekyll.logger.error "", "Available processors are: #{valid_processors.join(", ")}"
|
||||||
|
|
|
@ -119,7 +119,7 @@ module Jekyll
|
||||||
def add_dependency(path, dependency)
|
def add_dependency(path, dependency)
|
||||||
return if (metadata[path].nil? || @disabled)
|
return if (metadata[path].nil? || @disabled)
|
||||||
|
|
||||||
if !metadata[path]["deps"].include? dependency
|
unless metadata[path]["deps"].include? dependency
|
||||||
metadata[path]["deps"] << dependency
|
metadata[path]["deps"] << dependency
|
||||||
add(dependency) unless metadata.include?(dependency)
|
add(dependency) unless metadata.include?(dependency)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue