Rubocop: Style/AndOr

- Use && instead of and
 - Use || instead of or
This commit is contained in:
Pat Hawks 2016-01-03 15:30:26 -08:00
parent 6550867051
commit fb0457bf3d
No known key found for this signature in database
GPG Key ID: F1746FF5F18B3D1B
6 changed files with 7 additions and 7 deletions

View File

@ -76,7 +76,7 @@ module Jekyll
#
# returns a boolean
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
# Checks if a path's (or one of its dependencies)

View File

@ -75,7 +75,7 @@ module Jekyll
def write(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
FileUtils.mkdir_p(File.dirname(dest_path))

View File

@ -14,7 +14,7 @@ module Jekyll
severity ||= UNKNOWN
@logdev = set_logdevice(severity)
if @logdev.nil? or severity < @level
if @logdev.nil? || severity < @level
return true
end
progname ||= @progname

View File

@ -27,7 +27,7 @@ module Jekyll
@highlight_options[key.to_sym] = value || true
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
raise SyntaxError.new <<-eos
Syntax Error in tag 'highlight' while parsing the following markup:

View File

@ -115,7 +115,7 @@ eos
validate_path(path, dir, site.safe)
# 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.in_source_dir(context.registers[:page]["path"]),
path

View File

@ -31,8 +31,8 @@ module Jekyll
# Thanks to whoever made it.
def deep_merge_hashes!(target, overwrite)
overwrite.each_key do |key|
if (overwrite[key].is_a?(Hash) or overwrite[key].is_a?(Drops::Drop)) and
(target[key].is_a?(Hash) or target[key].is_a?(Drops::Drop))
if (overwrite[key].is_a?(Hash) || overwrite[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])
next
end