Rubocop: Style/AndOr
- Use && instead of and - Use || instead of or
This commit is contained in:
parent
6550867051
commit
fb0457bf3d
|
@ -76,7 +76,7 @@ module Jekyll
|
||||||
#
|
#
|
||||||
# returns a boolean
|
# returns a boolean
|
||||||
def source_modified_or_dest_missing?(source_path, dest_path)
|
def source_modified_or_dest_missing?(source_path, dest_path)
|
||||||
modified?(source_path) || (dest_path and !File.exist?(dest_path))
|
modified?(source_path) || (dest_path && !File.exist?(dest_path))
|
||||||
end
|
end
|
||||||
|
|
||||||
# Checks if a path's (or one of its dependencies)
|
# Checks if a path's (or one of its dependencies)
|
||||||
|
|
|
@ -75,7 +75,7 @@ module Jekyll
|
||||||
def write(dest)
|
def write(dest)
|
||||||
dest_path = destination(dest)
|
dest_path = destination(dest)
|
||||||
|
|
||||||
return false if File.exist?(dest_path) and !modified?
|
return false if File.exist?(dest_path) && !modified?
|
||||||
@@mtimes[path] = mtime
|
@@mtimes[path] = mtime
|
||||||
|
|
||||||
FileUtils.mkdir_p(File.dirname(dest_path))
|
FileUtils.mkdir_p(File.dirname(dest_path))
|
||||||
|
|
|
@ -14,7 +14,7 @@ module Jekyll
|
||||||
severity ||= UNKNOWN
|
severity ||= UNKNOWN
|
||||||
@logdev = set_logdevice(severity)
|
@logdev = set_logdevice(severity)
|
||||||
|
|
||||||
if @logdev.nil? or severity < @level
|
if @logdev.nil? || severity < @level
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
progname ||= @progname
|
progname ||= @progname
|
||||||
|
|
|
@ -27,7 +27,7 @@ module Jekyll
|
||||||
@highlight_options[key.to_sym] = value || true
|
@highlight_options[key.to_sym] = value || true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@highlight_options[:linenos] = "inline" if @highlight_options.key?(:linenos) and @highlight_options[:linenos] == true
|
@highlight_options[:linenos] = "inline" if @highlight_options.key?(:linenos) && @highlight_options[:linenos] == true
|
||||||
else
|
else
|
||||||
raise SyntaxError.new <<-eos
|
raise SyntaxError.new <<-eos
|
||||||
Syntax Error in tag 'highlight' while parsing the following markup:
|
Syntax Error in tag 'highlight' while parsing the following markup:
|
||||||
|
|
|
@ -115,7 +115,7 @@ eos
|
||||||
validate_path(path, dir, site.safe)
|
validate_path(path, dir, site.safe)
|
||||||
|
|
||||||
# Add include to dependency tree
|
# Add include to dependency tree
|
||||||
if context.registers[:page] and context.registers[:page].has_key? "path"
|
if context.registers[:page] && context.registers[:page].has_key?("path")
|
||||||
site.regenerator.add_dependency(
|
site.regenerator.add_dependency(
|
||||||
site.in_source_dir(context.registers[:page]["path"]),
|
site.in_source_dir(context.registers[:page]["path"]),
|
||||||
path
|
path
|
||||||
|
|
|
@ -31,8 +31,8 @@ module Jekyll
|
||||||
# Thanks to whoever made it.
|
# Thanks to whoever made it.
|
||||||
def deep_merge_hashes!(target, overwrite)
|
def deep_merge_hashes!(target, overwrite)
|
||||||
overwrite.each_key do |key|
|
overwrite.each_key do |key|
|
||||||
if (overwrite[key].is_a?(Hash) or overwrite[key].is_a?(Drops::Drop)) and
|
if (overwrite[key].is_a?(Hash) || overwrite[key].is_a?(Drops::Drop)) &&
|
||||||
(target[key].is_a?(Hash) or target[key].is_a?(Drops::Drop))
|
(target[key].is_a?(Hash) || target[key].is_a?(Drops::Drop))
|
||||||
target[key] = Utils.deep_merge_hashes(target[key], overwrite[key])
|
target[key] = Utils.deep_merge_hashes(target[key], overwrite[key])
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue