From af9ec6831d7652c423e29a32aff418da783757d0 Mon Sep 17 00:00:00 2001 From: Pat Hawks Date: Mon, 4 Jan 2016 11:23:06 -0800 Subject: [PATCH] Rubocop: Style/ElseAlignment - Align else with if Rubocop: Lint/EndAlignment - Align end with if --- lib/jekyll/regenerator.rb | 23 ++++++++++++----------- lib/jekyll/static_file.rb | 14 +++++++------- lib/jekyll/tags/include.rb | 12 ++++++------ 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/lib/jekyll/regenerator.rb b/lib/jekyll/regenerator.rb index 1e751f7d..bb9284aa 100644 --- a/lib/jekyll/regenerator.rb +++ b/lib/jekyll/regenerator.rb @@ -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 diff --git a/lib/jekyll/static_file.rb b/lib/jekyll/static_file.rb index 7938a050..0ed0fbfe 100644 --- a/lib/jekyll/static_file.rb +++ b/lib/jekyll/static_file.rb @@ -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. diff --git a/lib/jekyll/tags/include.rb b/lib/jekyll/tags/include.rb index c8f08a6c..b92e5b85 100644 --- a/lib/jekyll/tags/include.rb +++ b/lib/jekyll/tags/include.rb @@ -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