diff --git a/lib/jekyll/regenerator.rb b/lib/jekyll/regenerator.rb index 2d84ee34..c7d47c59 100644 --- a/lib/jekyll/regenerator.rb +++ b/lib/jekyll/regenerator.rb @@ -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) diff --git a/lib/jekyll/static_file.rb b/lib/jekyll/static_file.rb index 6f24f7d2..efa836d1 100644 --- a/lib/jekyll/static_file.rb +++ b/lib/jekyll/static_file.rb @@ -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)) diff --git a/lib/jekyll/stevenson.rb b/lib/jekyll/stevenson.rb index 9a9f412e..ea26c8b5 100644 --- a/lib/jekyll/stevenson.rb +++ b/lib/jekyll/stevenson.rb @@ -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 diff --git a/lib/jekyll/tags/highlight.rb b/lib/jekyll/tags/highlight.rb index 616dfdbf..13c4e8e8 100644 --- a/lib/jekyll/tags/highlight.rb +++ b/lib/jekyll/tags/highlight.rb @@ -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: diff --git a/lib/jekyll/tags/include.rb b/lib/jekyll/tags/include.rb index 6082a4cc..e3bee115 100644 --- a/lib/jekyll/tags/include.rb +++ b/lib/jekyll/tags/include.rb @@ -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 diff --git a/lib/jekyll/utils.rb b/lib/jekyll/utils.rb index c0c56579..d18b41c7 100644 --- a/lib/jekyll/utils.rb +++ b/lib/jekyll/utils.rb @@ -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