Style fixes for Rubocop 0.42.0

- var == 0 becomes var.zero?
- when defining method_missing, also define respond_to_missing?
This commit is contained in:
Parker Moore 2016-07-25 12:46:43 -07:00
parent 0e0e9f2081
commit 4b698747dc
No known key found for this signature in database
GPG Key ID: 193CDEBA72063C58
6 changed files with 6 additions and 6 deletions

View File

@ -91,7 +91,7 @@ end
def run_jekyll(args)
args = args.strip.split(" ") # Shellwords?
process = run_in_shell(Paths.jekyll_bin.to_s, *args, "--trace")
process.exitstatus == 0
process.exitstatus.zero?
end
#

View File

@ -25,7 +25,7 @@ module Jekyll
# Override of normal respond_to? to match method_missing's logic for
# looking in @data.
def respond_to?(method, include_private = false)
def respond_to_missing?(method, include_private = false)
docs.respond_to?(method.to_sym, include_private) || super
end

View File

@ -374,7 +374,7 @@ module Jekyll
private
def check_maruku(config)
if config.fetch("markdown", "kramdown").to_s.casecmp("maruku") == 0
if config.fetch("markdown", "kramdown").to_s.casecmp("maruku").zero?
Jekyll.logger.abort_with "Error:", "You're using the 'maruku' " \
"Markdown processor, which has been removed as of 3.0.0. " \
"We recommend you switch to Kramdown. To do this, replace " \

View File

@ -367,7 +367,7 @@ module Jekyll
def <=>(other)
return nil unless other.respond_to?(:data)
cmp = data["date"] <=> other.data["date"]
cmp = path <=> other.path if cmp.nil? || cmp == 0
cmp = path <=> other.path if cmp.nil? || cmp.zero?
cmp
end

View File

@ -25,7 +25,7 @@ module Jekyll
def <=>(other)
return nil unless other.is_a? DocumentDrop
cmp = self["date"] <=> other["date"]
cmp = self["path"] <=> other["path"] if cmp.nil? || cmp == 0
cmp = self["path"] <=> other["path"] if cmp.nil? || cmp.zero?
cmp
end

View File

@ -43,7 +43,7 @@ module Jekyll
str = ""
row_data.each_with_index do |cell_data, cell_index|
str << if cell_index == 0
str << if cell_index.zero?
cell_data.ljust(widths[cell_index], " ")
else
cell_data.rjust(widths[cell_index], " ")