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.
def read_metadata
@metadata = if !disabled? && File.file?(metadata_file)
content = File.binread(metadata_file)
@metadata =
if !disabled? && File.file?(metadata_file)
content = File.binread(metadata_file)
begin
Marshal.load(content)
rescue TypeError
SafeYAML.load(content)
rescue ArgumentError => e
Jekyll.logger.warn("Failed to load #{metadata_file}: #{e}")
begin
Marshal.load(content)
rescue TypeError
SafeYAML.load(content)
rescue ArgumentError => e
Jekyll.logger.warn("Failed to load #{metadata_file}: #{e}")
{}
end
else
{}
end
else
{}
end
end
end
end

View File

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

View File

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