Rubocop: Style/ElseAlignment

- Align else with if
Rubocop: Lint/EndAlignment
 - Align end with if
This commit is contained in:
Pat Hawks 2016-01-04 11:23:06 -08:00
parent f6fd9014ba
commit af9ec6831d
No known key found for this signature in database
GPG Key ID: F1746FF5F18B3D1B
3 changed files with 25 additions and 24 deletions

View File

@ -155,20 +155,21 @@ module Jekyll
# #
# Returns the read metadata. # Returns the read metadata.
def read_metadata def read_metadata
@metadata = if !disabled? && File.file?(metadata_file) @metadata =
content = File.binread(metadata_file) if !disabled? && File.file?(metadata_file)
content = File.binread(metadata_file)
begin begin
Marshal.load(content) Marshal.load(content)
rescue TypeError rescue TypeError
SafeYAML.load(content) SafeYAML.load(content)
rescue ArgumentError => e rescue ArgumentError => e
Jekyll.logger.warn("Failed to load #{metadata_file}: #{e}") Jekyll.logger.warn("Failed to load #{metadata_file}: #{e}")
{}
end
else
{} {}
end end
else
{}
end
end end
end end
end end

View File

@ -118,13 +118,13 @@ module Jekyll
# be overriden in the collection's configuration in _config.yml. # be overriden in the collection's configuration in _config.yml.
def url def url
@url ||= if @collection.nil? @url ||= if @collection.nil?
relative_path relative_path
else else
::Jekyll::URL.new({ ::Jekyll::URL.new({
:template => @collection.url_template, :template => @collection.url_template,
:placeholders => placeholders :placeholders => placeholders
}) })
end.to_s.gsub(/\/$/, '') end.to_s.gsub(/\/$/, '')
end end
# Returns the type of the collection if present, nil otherwise. # Returns the type of the collection if present, nil otherwise.

View File

@ -42,12 +42,12 @@ module Jekyll
markup = markup[match.end(0)..-1] markup = markup[match.end(0)..-1]
value = if match[2] value = if match[2]
match[2].gsub(/\\"/, '"') match[2].gsub(/\\"/, '"')
elsif match[3] elsif match[3]
match[3].gsub(/\\'/, "'") match[3].gsub(/\\'/, "'")
elsif match[4] elsif match[4]
context[match[4]] context[match[4]]
end end
params[match[1]] = value params[match[1]] = value
end end