Rubocop: Style/ElseAlignment
- Align else with if Rubocop: Lint/EndAlignment - Align end with if
This commit is contained in:
parent
f6fd9014ba
commit
af9ec6831d
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue