diff --git a/.rubocop.yml b/.rubocop.yml
index 0324c412..67f212ae 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -127,5 +127,7 @@ Style/StringLiterals:
EnforcedStyle: double_quotes
Style/StringLiteralsInInterpolation:
EnforcedStyle: double_quotes
+Style/TrailingCommaInLiteral:
+ EnforcedStyleForMultiline: consistent_comma
Style/UnneededCapitalW:
Enabled: false
diff --git a/features/support/formatter.rb b/features/support/formatter.rb
index 22237010..79d14664 100644
--- a/features/support/formatter.rb
+++ b/features/support/formatter.rb
@@ -16,7 +16,7 @@ module Jekyll
:pending => "\u203D".yellow,
:undefined => "\u2718".red,
:passed => "\u2714".green,
- :skipped => "\u203D".blue
+ :skipped => "\u203D".blue,
}.freeze
#
diff --git a/features/support/helpers.rb b/features/support/helpers.rb
index 1340808a..b8044a7c 100644
--- a/features/support/helpers.rb
+++ b/features/support/helpers.rb
@@ -142,7 +142,7 @@ def location(folder, direction)
end
[before || ".",
- after || "."]
+ after || ".",]
end
#
@@ -160,7 +160,7 @@ def seconds_agnostic_datetime(datetime = Time.now)
[
Regexp.escape(date),
"#{time}:\\d{2}",
- Regexp.escape(zone)
+ Regexp.escape(zone),
] \
.join("\\ ")
end
diff --git a/lib/jekyll/commands/doctor.rb b/lib/jekyll/commands/doctor.rb
index c7f387df..59004c96 100644
--- a/lib/jekyll/commands/doctor.rb
+++ b/lib/jekyll/commands/doctor.rb
@@ -35,7 +35,7 @@ module Jekyll
fsnotify_buggy?(site),
!deprecated_relative_permalinks(site),
!conflicting_urls(site),
- !urls_only_differ_by_case(site)
+ !urls_only_differ_by_case(site),
].all?
end
diff --git a/lib/jekyll/commands/serve.rb b/lib/jekyll/commands/serve.rb
index e0da4807..16913595 100644
--- a/lib/jekyll/commands/serve.rb
+++ b/lib/jekyll/commands/serve.rb
@@ -10,9 +10,9 @@ module Jekyll
"ssl_key" => ["--ssl-key [KEY]", "X.509 (SSL) Private Key."],
"port" => ["-P", "--port [PORT]", "Port to listen on"],
"show_dir_listing" => ["--show-dir-listing",
- "Show a directory listing instead of loading your index file."],
+ "Show a directory listing instead of loading your index file.",],
"skip_initial_build" => ["skip_initial_build", "--skip-initial-build",
- "Skips the initial site build which occurs before the server is started."]
+ "Skips the initial site build which occurs before the server is started.",],
}.freeze
#
@@ -88,7 +88,7 @@ module Jekyll
index.rhtml
index.cgi
index.xml
- )
+ ),
}
opts[:DirectoryIndex] = [] if opts[:JekyllOptions]["show_dir_listing"]
@@ -116,8 +116,8 @@ module Jekyll
WEBrick::Config::FileHandler.merge({
:FancyIndexing => true,
:NondisclosureName => [
- ".ht*", "~*"
- ]
+ ".ht*", "~*",
+ ],
})
end
@@ -139,7 +139,7 @@ module Jekyll
:prefix => ssl_enabled ? "https" : "http",
:address => address,
:port => port,
- :baseurl => baseurl ? "#{baseurl}/" : ""
+ :baseurl => baseurl ? "#{baseurl}/" : "",
})
end
diff --git a/lib/jekyll/commands/serve/servlet.rb b/lib/jekyll/commands/serve/servlet.rb
index d0dd22af..3ae5cf32 100644
--- a/lib/jekyll/commands/serve/servlet.rb
+++ b/lib/jekyll/commands/serve/servlet.rb
@@ -6,7 +6,7 @@ module Jekyll
class Servlet < WEBrick::HTTPServlet::FileHandler
DEFAULTS = {
"Cache-Control" => "private, max-age=0, proxy-revalidate, " \
- "no-store, no-cache, must-revalidate"
+ "no-store, no-cache, must-revalidate",
}.freeze
def initialize(server, root, callbacks)
diff --git a/lib/jekyll/configuration.rb b/lib/jekyll/configuration.rb
index 8dc1807d..27e245e4 100644
--- a/lib/jekyll/configuration.rb
+++ b/lib/jekyll/configuration.rb
@@ -58,15 +58,15 @@ module Jekyll
"defaults" => [],
"liquid" => {
- "error_mode" => "warn"
+ "error_mode" => "warn",
},
"rdiscount" => {
- "extensions" => []
+ "extensions" => [],
},
"redcarpet" => {
- "extensions" => []
+ "extensions" => [],
},
"kramdown" => {
@@ -76,8 +76,8 @@ module Jekyll
"smart_quotes" => "lsquo,rsquo,ldquo,rdquo",
"input" => "GFM",
"hard_wrap" => false,
- "footnote_nr" => 1
- }
+ "footnote_nr" => 1,
+ },
}.map { |k, v| [k, v.freeze] }].freeze
class << self
diff --git a/lib/jekyll/converters/markdown/kramdown_parser.rb b/lib/jekyll/converters/markdown/kramdown_parser.rb
index dd71c6c1..a7252f1a 100644
--- a/lib/jekyll/converters/markdown/kramdown_parser.rb
+++ b/lib/jekyll/converters/markdown/kramdown_parser.rb
@@ -11,7 +11,7 @@ module Jekyll
"line_numbers" => "inline",
"line_number_start" => 1,
"tab_width" => 4,
- "wrap" => "div"
+ "wrap" => "div",
}.freeze
def initialize(config)
diff --git a/lib/jekyll/converters/markdown/redcarpet_parser.rb b/lib/jekyll/converters/markdown/redcarpet_parser.rb
index b5ec99f5..aa170feb 100644
--- a/lib/jekyll/converters/markdown/redcarpet_parser.rb
+++ b/lib/jekyll/converters/markdown/redcarpet_parser.rb
@@ -21,7 +21,7 @@ class Jekyll::Converters::Markdown::RedcarpetParser
code,
{
:lexer => lang,
- :options => { :encoding => "utf-8" }
+ :options => { :encoding => "utf-8" },
}
),
lang
diff --git a/lib/jekyll/document.rb b/lib/jekyll/document.rb
index ad5884ef..fecd5828 100644
--- a/lib/jekyll/document.rb
+++ b/lib/jekyll/document.rb
@@ -196,7 +196,7 @@ module Jekyll
@url = URL.new({
:template => url_template,
:placeholders => url_placeholders,
- :permalink => permalink
+ :permalink => permalink,
}).to_s
end
@@ -469,14 +469,14 @@ module Jekyll
"category",
"categories"
)
- ).map(&:to_s).flatten.uniq
+ ).map(&:to_s).flatten.uniq,
})
end
private
def populate_tags
merge_data!({
- "tags" => Utils.pluralized_array_from_hash(data, "tag", "tags").flatten
+ "tags" => Utils.pluralized_array_from_hash(data, "tag", "tags").flatten,
})
end
diff --git a/lib/jekyll/drops/jekyll_drop.rb b/lib/jekyll/drops/jekyll_drop.rb
index 50163d74..e3d2eb38 100644
--- a/lib/jekyll/drops/jekyll_drop.rb
+++ b/lib/jekyll/drops/jekyll_drop.rb
@@ -20,7 +20,7 @@ module Jekyll
def to_h
@to_h ||= {
"version" => version,
- "environment" => environment
+ "environment" => environment,
}
end
diff --git a/lib/jekyll/entry_filter.rb b/lib/jekyll/entry_filter.rb
index 5f3431d8..e4187d42 100644
--- a/lib/jekyll/entry_filter.rb
+++ b/lib/jekyll/entry_filter.rb
@@ -2,7 +2,7 @@ module Jekyll
class EntryFilter
attr_reader :site
SPECIAL_LEADING_CHARACTERS = [
- ".", "_", "#", "~"
+ ".", "_", "#", "~",
].freeze
def initialize(site, base_directory = nil)
diff --git a/lib/jekyll/filters/grouping_filters.rb b/lib/jekyll/filters/grouping_filters.rb
index a16901d9..e7a904a4 100644
--- a/lib/jekyll/filters/grouping_filters.rb
+++ b/lib/jekyll/filters/grouping_filters.rb
@@ -54,7 +54,7 @@ module Jekyll
array << {
"name" => item.first,
"items" => item.last,
- "size" => item.last.size
+ "size" => item.last.size,
}
end
end
diff --git a/lib/jekyll/hooks.rb b/lib/jekyll/hooks.rb
index 9083b27a..5f21b5f6 100644
--- a/lib/jekyll/hooks.rb
+++ b/lib/jekyll/hooks.rb
@@ -6,7 +6,7 @@ module Jekyll
PRIORITY_MAP = {
:low => 10,
:normal => 20,
- :high => 30
+ :high => 30,
}.freeze
# initial empty hooks
@@ -17,26 +17,26 @@ module Jekyll
:post_read => [],
:pre_render => [],
:post_render => [],
- :post_write => []
+ :post_write => [],
},
:pages => {
:post_init => [],
:pre_render => [],
:post_render => [],
- :post_write => []
+ :post_write => [],
},
:posts => {
:post_init => [],
:pre_render => [],
:post_render => [],
- :post_write => []
+ :post_write => [],
},
:documents => {
:post_init => [],
:pre_render => [],
:post_render => [],
- :post_write => []
- }
+ :post_write => [],
+ },
}
# map of all hooks and their priorities
@@ -64,7 +64,7 @@ module Jekyll
:post_init => [],
:pre_render => [],
:post_render => [],
- :post_write => []
+ :post_write => [],
}
unless @registry[owner][event]
diff --git a/lib/jekyll/log_adapter.rb b/lib/jekyll/log_adapter.rb
index 70173b91..965f3295 100644
--- a/lib/jekyll/log_adapter.rb
+++ b/lib/jekyll/log_adapter.rb
@@ -6,7 +6,7 @@ module Jekyll
:debug => ::Logger::DEBUG,
:info => ::Logger::INFO,
:warn => ::Logger::WARN,
- :error => ::Logger::ERROR
+ :error => ::Logger::ERROR,
}.freeze
# Public: Create a new instance of a log writer
diff --git a/lib/jekyll/page.rb b/lib/jekyll/page.rb
index 7619966d..324a867d 100644
--- a/lib/jekyll/page.rb
+++ b/lib/jekyll/page.rb
@@ -98,7 +98,7 @@ module Jekyll
@url ||= URL.new({
:template => template,
:placeholders => url_placeholders,
- :permalink => permalink
+ :permalink => permalink,
}).to_s
end
@@ -108,7 +108,7 @@ module Jekyll
{
:path => @dir,
:basename => basename,
- :output_ext => output_ext
+ :output_ext => output_ext,
}
end
diff --git a/lib/jekyll/plugin.rb b/lib/jekyll/plugin.rb
index bcc1bf7e..4680be32 100644
--- a/lib/jekyll/plugin.rb
+++ b/lib/jekyll/plugin.rb
@@ -5,7 +5,7 @@ module Jekyll
:highest => 100,
:lowest => -100,
:normal => 0,
- :high => 10
+ :high => 10,
}.freeze
#
diff --git a/lib/jekyll/readers/data_reader.rb b/lib/jekyll/readers/data_reader.rb
index 6744ae05..1083d62b 100644
--- a/lib/jekyll/readers/data_reader.rb
+++ b/lib/jekyll/readers/data_reader.rb
@@ -54,7 +54,7 @@ module Jekyll
when ".csv"
CSV.read(path, {
:headers => true,
- :encoding => site.config["encoding"]
+ :encoding => site.config["encoding"],
}).map(&:to_hash)
else
SafeYAML.load_file(path)
diff --git a/lib/jekyll/readers/post_reader.rb b/lib/jekyll/readers/post_reader.rb
index 123709e7..70688875 100644
--- a/lib/jekyll/readers/post_reader.rb
+++ b/lib/jekyll/readers/post_reader.rb
@@ -57,7 +57,7 @@ module Jekyll
path = @site.in_source_dir(File.join(dir, magic_dir, entry))
Document.new(path, {
:site => @site,
- :collection => @site.posts
+ :collection => @site.posts,
})
end.reject(&:nil?)
end
diff --git a/lib/jekyll/regenerator.rb b/lib/jekyll/regenerator.rb
index 4d89da2e..09ff309a 100644
--- a/lib/jekyll/regenerator.rb
+++ b/lib/jekyll/regenerator.rb
@@ -40,7 +40,7 @@ module Jekyll
metadata[path] = {
"mtime" => File.mtime(path),
- "deps" => []
+ "deps" => [],
}
cache[path] = true
end
diff --git a/lib/jekyll/static_file.rb b/lib/jekyll/static_file.rb
index 927a9b47..53b945d4 100644
--- a/lib/jekyll/static_file.rb
+++ b/lib/jekyll/static_file.rb
@@ -101,7 +101,7 @@ module Jekyll
"name" => name,
"extname" => extname,
"modified_time" => modified_time,
- "path" => File.join("", relative_path)
+ "path" => File.join("", relative_path),
}
end
@@ -112,7 +112,7 @@ module Jekyll
@collection.relative_directory.size..relative_path.size],
:output_ext => "",
:name => "",
- :title => ""
+ :title => "",
}
end
@@ -125,7 +125,7 @@ module Jekyll
else
::Jekyll::URL.new({
:template => @collection.url_template,
- :placeholders => placeholders
+ :placeholders => placeholders,
})
end.to_s.gsub(%r!/$!, "")
end
diff --git a/lib/jekyll/tags/highlight.rb b/lib/jekyll/tags/highlight.rb
index 43b0c62f..86b9171b 100644
--- a/lib/jekyll/tags/highlight.rb
+++ b/lib/jekyll/tags/highlight.rb
@@ -54,7 +54,7 @@ eos
[:hl_lines, opts.fetch(:hl_lines, nil)],
[:linenos, opts.fetch(:linenos, nil)],
[:encoding, opts.fetch(:encoding, "utf-8")],
- [:cssclass, opts.fetch(:cssclass, nil)]
+ [:cssclass, opts.fetch(:cssclass, nil)],
].reject { |f| f.last.nil? }]
else
opts
@@ -125,7 +125,7 @@ eos
def add_code_tag(code)
code_attributes = [
"class=\"language-#{@lang.to_s.tr("+", "-")}\"",
- "data-lang=\"#{@lang}\""
+ "data-lang=\"#{@lang}\"",
].join(" ")
""\
"#{code.chomp}
This should be published.
\n", "draft" => false, "categories" => [ - "publish_test" + "publish_test", ], "layout" => "default", "title" => "Publish", @@ -459,7 +459,7 @@ class TestFilters < JekyllUnitTest "date" => "2008-02-02 00:00:00 +0000", "slug" => "published", "ext" => ".markdown", - "tags" => [] + "tags" => [], } actual = JSON.parse(@filter.jsonify(@filter.site.docs_to_write.first.to_liquid)) @@ -475,7 +475,7 @@ class TestFilters < JekyllUnitTest actual = @filter.jsonify(@filter.site.to_liquid) assert_equal JSON.parse(actual)["jekyll"], { "environment" => "development", - "version" => Jekyll::VERSION + "version" => Jekyll::VERSION, } end @@ -491,7 +491,7 @@ class TestFilters < JekyllUnitTest "name" => name, :v => 1, :thing => M.new({ :kay => "jewelers" }), - :stuff => true + :stuff => true, } end end @@ -503,21 +503,21 @@ class TestFilters < JekyllUnitTest "v" => 1, "thing" => [ { - "kay" => "jewelers" - } + "kay" => "jewelers", + }, ], - "stuff" => true + "stuff" => true, }, { "name" => "Smathers", "v" => 1, "thing" => [ { - "kay" => "jewelers" - } + "kay" => "jewelers", + }, ], - "stuff" => true - } + "stuff" => true, + }, ] result = @filter.jsonify([T.new("Jeremiah"), T.new("Smathers")]) assert_equal expected, JSON.parse(result) @@ -533,32 +533,32 @@ class TestFilters < JekyllUnitTest "v" => 1, "thing" => [ { - "kay" => "jewelers" - } + "kay" => "jewelers", + }, ], - "stuff" => true + "stuff" => true, }, { "name" => 1, "v" => 1, "thing" => [ { - "kay" => "jewelers" - } + "kay" => "jewelers", + }, ], - "stuff" => true + "stuff" => true, }, { "name" => 2, "v" => 1, "thing" => [ { - "kay" => "jewelers" - } + "kay" => "jewelers", + }, ], - "stuff" => true - } - ] + "stuff" => true, + }, + ], } result = @filter.jsonify(my_hash) assert_equal expected, JSON.parse(result) @@ -633,7 +633,7 @@ class TestFilters < JekyllUnitTest hash = { "a" => { "tags"=>%w(x y) }, "b" => { "tags"=>["x"] }, - "c" => { "tags"=>%w(y z) } + "c" => { "tags"=>%w(y z) }, } assert_equal 2, @filter.where(hash, "tags", "x").length end @@ -642,7 +642,7 @@ class TestFilters < JekyllUnitTest hash = { "a" => { "tags"=>%w(x y) }, "b" => { "tags"=>"x" }, - "c" => { "tags"=>%w(y z) } + "c" => { "tags"=>%w(y z) }, } assert_equal 2, @filter.where(hash, "tags", "x").length end @@ -651,7 +651,7 @@ class TestFilters < JekyllUnitTest hash = { "a" => { "category"=>"bear" }, "b" => { "category"=>"wolf" }, - "c" => { "category"=>%w(bear lion) } + "c" => { "category"=>%w(bear lion) }, } assert_equal 0, @filter.where(hash, "category", "ear").length end @@ -660,7 +660,7 @@ class TestFilters < JekyllUnitTest hash = { "The Words" => { "rating" => 1.2, "featured" => false }, "Limitless" => { "rating" => 9.2, "featured" => true }, - "Hustle" => { "rating" => 4.7, "featured" => true } + "Hustle" => { "rating" => 4.7, "featured" => true }, } results = @filter.where(hash, "featured", "true") @@ -704,7 +704,7 @@ class TestFilters < JekyllUnitTest hash = { "The Words" => { "rating" => 1.2, "featured" => false }, "Limitless" => { "rating" => 9.2, "featured" => true }, - "Hustle" => { "rating" => 4.7, "featured" => true } + "Hustle" => { "rating" => 4.7, "featured" => true }, } results = @filter.where_exp(hash, "item", "item.featured == true") @@ -725,7 +725,7 @@ class TestFilters < JekyllUnitTest { "id" => "a", "groups" => [1, 2] }, { "id" => "b", "groups" => [2, 3] }, { "id" => "c" }, - { "id" => "d", "groups" => [1, 3] } + { "id" => "d", "groups" => [1, 3] }, ] should "filter with the contains operator over arrays" do results = @filter.where_exp(objects, "obj", "obj.groups contains 1") @@ -807,7 +807,7 @@ class TestFilters < JekyllUnitTest items = [ { "version"=>"1.0", "result"=>"slow" }, { "version"=>"1.1.5", "result"=>"medium" }, - { "version"=>"2.7.3", "result"=>"fast" } + { "version"=>"2.7.3", "result"=>"fast" }, ] result = @filter.group_by_exp(items, "item", "item.version | split: '.' | first") diff --git a/test/test_front_matter_defaults.rb b/test/test_front_matter_defaults.rb index 30c713ac..0d066c11 100644 --- a/test/test_front_matter_defaults.rb +++ b/test/test_front_matter_defaults.rb @@ -7,12 +7,12 @@ class TestFrontMatterDefaults < JekyllUnitTest "defaults" => [{ "scope" => { "path" => "contacts", - "type" => "page" + "type" => "page", }, "values" => { - "key" => "val" - } - }] + "key" => "val", + }, + },], }) @site.process @affected = @site.pages.find { |page| page.relative_path == "contacts/bar.html" } @@ -30,12 +30,12 @@ class TestFrontMatterDefaults < JekyllUnitTest @site = fixture_site({ "defaults" => [{ "scope" => { - "path" => "index.html" + "path" => "index.html", }, "values" => { - "key" => "val" - } - }] + "key" => "val", + }, + },], }) @site.process @@ -54,12 +54,12 @@ class TestFrontMatterDefaults < JekyllUnitTest @site = fixture_site({ "defaults" => [{ "scope" => { - "path" => "win" + "path" => "win", }, "values" => { - "key" => "val" - } - }] + "key" => "val", + }, + },], }) @site.process @@ -78,12 +78,12 @@ class TestFrontMatterDefaults < JekyllUnitTest @site = fixture_site({ "defaults" => [{ "scope" => { - "type" => "page" + "type" => "page", }, "values" => { - "key" => "val" - } - }] + "key" => "val", + }, + },], }) @site.process @@ -103,12 +103,12 @@ class TestFrontMatterDefaults < JekyllUnitTest @site = fixture_site({ "defaults" => [{ "scope" => { - "type" => "pages" + "type" => "pages", }, "values" => { - "key" => "val" - } - }] + "key" => "val", + }, + },], }) @site.process @affected = @site.pages @@ -129,9 +129,9 @@ class TestFrontMatterDefaults < JekyllUnitTest "scope" => { }, "values" => { - "key" => "val" - } - }] + "key" => "val", + }, + },], }) @site.process @affected = @site.pages @@ -149,9 +149,9 @@ class TestFrontMatterDefaults < JekyllUnitTest @site = fixture_site({ "defaults" => [{ "values" => { - "key" => "val" - } - }] + "key" => "val", + }, + },], }) @site.process @affected = @site.pages @@ -171,9 +171,9 @@ class TestFrontMatterDefaults < JekyllUnitTest "destination" => dest_dir, "defaults" => [{ "values" => { - "date" => "2015-01-01 00:00:01" - } - }] + "date" => "2015-01-01 00:00:01", + }, + },], })) end diff --git a/test/test_kramdown.rb b/test/test_kramdown.rb index 0a6332f8..d8f886a4 100644 --- a/test/test_kramdown.rb +++ b/test/test_kramdown.rb @@ -16,9 +16,9 @@ class TestKramdown < JekyllUnitTest "syntax_highlighter" => "rouge", "syntax_highlighter_opts" => { - "bold_every" => 8, "css" => :class - } - } + "bold_every" => 8, "css" => :class, + }, + }, } @config = Jekyll.configuration(@config) @@ -43,8 +43,8 @@ class TestKramdown < JekyllUnitTest override = { "highlighter" => nil, "kramdown" => { - "smart_quotes" => "lsaquo,rsaquo,laquo,raquo" - } + "smart_quotes" => "lsaquo,rsaquo,laquo,raquo", + }, } markdown = Converters::Markdown.new(Utils.deep_merge_hashes(@config, override)) @@ -70,8 +70,8 @@ class TestKramdown < JekyllUnitTest "highlighter" => nil, "markdown" => "kramdown", "kramdown" => { - "syntax_highlighter" => :coderay - } + "syntax_highlighter" => :coderay, + }, } markdown = Converters::Markdown.new(Utils.deep_merge_hashes(@config, override)) @@ -89,8 +89,8 @@ class TestKramdown < JekyllUnitTest override = { "markdown" => "kramdown", "kramdown" => { - "enable_coderay" => true - } + "enable_coderay" => true, + }, } @config.delete("highlighter") @@ -115,9 +115,9 @@ class TestKramdown < JekyllUnitTest "kramdown" => { "syntax_highlighter" => "coderay", "coderay" => { - "hello" => "world" - } - } + "hello" => "world", + }, + }, })) expect(Kramdown::Document).to receive(:new) do |arg1, hash| diff --git a/test/test_layout_reader.rb b/test/test_layout_reader.rb index 133cd6f2..1d32fa57 100644 --- a/test/test_layout_reader.rb +++ b/test/test_layout_reader.rb @@ -4,7 +4,7 @@ class TestLayoutReader < JekyllUnitTest context "reading layouts" do setup do config = Jekyll::Configuration::DEFAULTS.merge({ "source" => source_dir, - "destination" => dest_dir }) + "destination" => dest_dir, }) @site = fixture_site(config) end diff --git a/test/test_liquid_renderer.rb b/test/test_liquid_renderer.rb index 7d429c52..6ba29299 100644 --- a/test/test_liquid_renderer.rb +++ b/test/test_liquid_renderer.rb @@ -16,7 +16,7 @@ class TestLiquidRenderer < JekyllUnitTest expected = [ %r!^Filename\s+|\s+Count\s+|\s+Bytes\s+|\s+Time$!, %r!^-+\++-+\++-+\++-+$!, - %r!^_posts/2010-01-09-date-override\.markdown\s+|\s+\d+\s+|\s+\d+\.\d{2}K\s+|\s+\d+\.\d{3}$! + %r!^_posts/2010-01-09-date-override\.markdown\s+|\s+\d+\s+|\s+\d+\.\d{2}K\s+|\s+\d+\.\d{3}$!, ] # rubocop:enable Metrics/LineLength diff --git a/test/test_page.rb b/test/test_page.rb index 259de185..431c57a6 100644 --- a/test/test_page.rb +++ b/test/test_page.rb @@ -12,7 +12,7 @@ class TestPage < JekyllUnitTest def do_render(page) layouts = { - "default" => Layout.new(@site, source_dir("_layouts"), "simple.html") + "default" => Layout.new(@site, source_dir("_layouts"), "simple.html"), } page.render(layouts, @site.site_payload) end @@ -23,7 +23,7 @@ class TestPage < JekyllUnitTest @site = Site.new(Jekyll.configuration({ "source" => source_dir, "destination" => dest_dir, - "skip_config_files" => true + "skip_config_files" => true, })) end @@ -90,7 +90,7 @@ class TestPage < JekyllUnitTest :permalink => "/properties/", :published => nil, :title => "Properties Page", - :url => "/properties/" + :url => "/properties/", } attrs.each do |attr, val| diff --git a/test/test_plugin_manager.rb b/test/test_plugin_manager.rb index c625c3a8..702df593 100644 --- a/test/test_plugin_manager.rb +++ b/test/test_plugin_manager.rb @@ -68,7 +68,7 @@ class TestPluginManager < JekyllUnitTest should "require plugin files" do site = double({ :safe => false, :config => { "plugins_dir" => "_plugins" }, - :in_source_dir => "/tmp/" }) + :in_source_dir => "/tmp/", }) plugin_manager = PluginManager.new(site) expect(Jekyll::External).to receive(:require_with_graceful_fail) @@ -98,9 +98,9 @@ class TestPluginManager < JekyllUnitTest should "call site's in_source_dir" do site = double({ :config => { - "plugins_dir" => Jekyll::Configuration::DEFAULTS["plugins_dir"] + "plugins_dir" => Jekyll::Configuration::DEFAULTS["plugins_dir"], }, - :in_source_dir => "/tmp/" + :in_source_dir => "/tmp/", }) plugin_manager = PluginManager.new(site) @@ -132,7 +132,7 @@ class TestPluginManager < JekyllUnitTest should "print no deprecation warning if jekyll-paginate is present" do site = double({ - :config => { "paginate" => true, "gems" => ["jekyll-paginate"] } + :config => { "paginate" => true, "gems" => ["jekyll-paginate"] }, }) plugin_manager = PluginManager.new(site) diff --git a/test/test_rdiscount.rb b/test/test_rdiscount.rb index 9390aaed..32289a64 100644 --- a/test/test_rdiscount.rb +++ b/test/test_rdiscount.rb @@ -13,8 +13,8 @@ class TestRdiscount < JekyllUnitTest "markdown" => "rdiscount", "rdiscount" => { "toc_token" => "{:toc}", - "extensions" => %w(smart generate_toc) - } + "extensions" => %w(smart generate_toc), + }, } @markdown = Converters::Markdown.new config diff --git a/test/test_redcarpet.rb b/test/test_redcarpet.rb index 140fabbe..4e979f4d 100644 --- a/test/test_redcarpet.rb +++ b/test/test_redcarpet.rb @@ -12,8 +12,8 @@ class TestRedcarpet < JekyllUnitTest @config = { "markdown" => "redcarpet", "redcarpet" => { - "extensions" => %w(smart strikethrough filter_html) - } + "extensions" => %w(smart strikethrough filter_html), + }, } @markdown = Converters::Markdown.new @config diff --git a/test/test_regenerator.rb b/test/test_regenerator.rb index 03920c83..9e1559d4 100644 --- a/test/test_regenerator.rb +++ b/test/test_regenerator.rb @@ -8,10 +8,10 @@ class TestRegenerator < JekyllUnitTest @site = fixture_site({ "collections" => { "methods" => { - "output" => true - } + "output" => true, + }, }, - "incremental" => true + "incremental" => true, }) @site.read @@ -92,7 +92,7 @@ class TestRegenerator < JekyllUnitTest setup do FileUtils.rm_rf(source_dir(".jekyll-metadata")) @site = fixture_site({ - "incremental" => true + "incremental" => true, }) @site.read @@ -129,7 +129,7 @@ class TestRegenerator < JekyllUnitTest @site = Site.new(Jekyll.configuration({ "source" => source_dir, "destination" => dest_dir, - "incremental" => true + "incremental" => true, })) @site.process @@ -311,7 +311,7 @@ class TestRegenerator < JekyllUnitTest @site = Site.new(Jekyll.configuration({ "source" => source_dir, "destination" => dest_dir, - "incremental" => false + "incremental" => false, })) @site.process diff --git a/test/test_related_posts.rb b/test/test_related_posts.rb index ef7265ef..2d616550 100644 --- a/test/test_related_posts.rb +++ b/test/test_related_posts.rb @@ -28,7 +28,7 @@ class TestRelatedPosts < JekyllUnitTest allow_any_instance_of(Jekyll::RelatedPosts).to receive(:display) @site = fixture_site({ - "lsi" => true + "lsi" => true, }) @site.reset diff --git a/test/test_sass.rb b/test/test_sass.rb index f5241790..3a9df0ae 100644 --- a/test/test_sass.rb +++ b/test/test_sass.rb @@ -5,7 +5,7 @@ class TestSass < JekyllUnitTest setup do @site = Jekyll::Site.new(Jekyll.configuration({ "source" => source_dir, - "destination" => dest_dir + "destination" => dest_dir, })) @site.process @test_css_file = dest_dir("css/main.css") diff --git a/test/test_site.rb b/test/test_site.rb index 81da363d..bbf42d25 100644 --- a/test/test_site.rb +++ b/test/test_site.rb @@ -20,7 +20,7 @@ class TestSite < JekyllUnitTest should "have an array for plugins if passed as an array" do site = Site.new(site_configuration({ - "plugins_dir" => ["/tmp/plugins", "/tmp/otherplugins"] + "plugins_dir" => ["/tmp/plugins", "/tmp/otherplugins"], })) array = if Utils::Platforms.windows? ["C:/tmp/plugins", "C:/tmp/otherplugins"] @@ -485,7 +485,7 @@ class TestSite < JekyllUnitTest context "manipulating the Jekyll environment" do setup do @site = Site.new(site_configuration({ - "incremental" => false + "incremental" => false, })) @site.process @page = @site.pages.find { |p| p.name == "environment.html" } @@ -499,7 +499,7 @@ class TestSite < JekyllUnitTest setup do ENV["JEKYLL_ENV"] = "production" @site = Site.new(site_configuration({ - "incremental" => false + "incremental" => false, })) @site.process @page = @site.pages.find { |p| p.name == "environment.html" } @@ -565,7 +565,7 @@ class TestSite < JekyllUnitTest context "incremental build" do setup do @site = Site.new(site_configuration({ - "incremental" => true + "incremental" => true, })) @site.read end diff --git a/test/test_static_file.rb b/test/test_static_file.rb index 2be800a6..dd3515f6 100644 --- a/test/test_static_file.rb +++ b/test/test_static_file.rb @@ -95,8 +95,8 @@ class TestStaticFile < JekyllUnitTest should "use the _config.yml defaults to determine writability" do defaults = [{ "scope" => { "path" => "private" }, - "values" => { "published" => false } - }] + "values" => { "published" => false }, + },] static_file = setup_static_file_with_defaults( "root", "private/dir/subdir", @@ -146,7 +146,7 @@ class TestStaticFile < JekyllUnitTest "name" => "static_file.txt", "extname" => ".txt", "modified_time" => @static_file.modified_time, - "path" => "/static_file.txt" + "path" => "/static_file.txt", } assert_equal expected, @static_file.to_liquid end diff --git a/test/test_tags.rb b/test/test_tags.rb index fd6dcb97..a636abf6 100644 --- a/test/test_tags.rb +++ b/test/test_tags.rb @@ -17,7 +17,7 @@ class TestTags < JekyllUnitTest info = { :filters => [Jekyll::Filters], :registers => { :site => site } } @converter = site.converters.find { |c| c.class == converter_class } payload = { "highlighter_prefix" => @converter.highlighter_prefix, - "highlighter_suffix" => @converter.highlighter_suffix } + "highlighter_suffix" => @converter.highlighter_suffix, } @result = Liquid::Template.parse(content).render!(payload, info) @result = @converter.convert(@result) @@ -487,7 +487,7 @@ CONTENT end create_post(@content, { - "markdown" => "rdiscount" + "markdown" => "rdiscount", }) end @@ -517,7 +517,7 @@ CONTENT end create_post(@content, { - "markdown" => "redcarpet" + "markdown" => "redcarpet", }) end @@ -541,7 +541,7 @@ CONTENT "permalink" => "pretty", "source" => source_dir, "destination" => dest_dir, - "read_posts" => true + "read_posts" => true, }) end @@ -567,7 +567,7 @@ CONTENT "permalink" => "pretty", "source" => source_dir, "destination" => dest_dir, - "read_posts" => true + "read_posts" => true, }) end @@ -596,7 +596,7 @@ CONTENT "permalink" => "pretty", "source" => source_dir, "destination" => dest_dir, - "read_posts" => true + "read_posts" => true, }) end @@ -628,7 +628,7 @@ CONTENT "permalink" => "pretty", "source" => source_dir, "destination" => dest_dir, - "read_posts" => true + "read_posts" => true, }) end @@ -664,7 +664,7 @@ CONTENT "permalink" => "pretty", "source" => source_dir, "destination" => dest_dir, - "read_posts" => true + "read_posts" => true, }) end end @@ -683,7 +683,7 @@ CONTENT "permalink" => "pretty", "source" => source_dir, "destination" => dest_dir, - "read_posts" => true + "read_posts" => true, }) end end @@ -703,7 +703,7 @@ CONTENT create_post(content, { "source" => source_dir, "destination" => dest_dir, - "read_all" => true + "read_all" => true, }) end @@ -737,7 +737,7 @@ CONTENT "source" => source_dir, "destination" => dest_dir, "collections" => { "methods" => { "output" => true } }, - "read_collections" => true + "read_collections" => true, }) end @@ -764,7 +764,7 @@ CONTENT "source" => source_dir, "destination" => dest_dir, "collections" => { "methods" => { "output" => true } }, - "read_collections" => true + "read_collections" => true, }) end @@ -796,7 +796,7 @@ CONTENT "source" => source_dir, "destination" => dest_dir, "collections" => { "methods" => { "output" => true } }, - "read_collections" => true + "read_collections" => true, }) end end @@ -820,7 +820,7 @@ CONTENT "source" => source_dir, "destination" => dest_dir, "read_posts" => true, - "safe" => true + "safe" => true, }) end @result ||= "" @@ -842,7 +842,7 @@ CONTENT "source" => source_dir, "destination" => dest_dir, "read_posts" => true, - "safe" => true + "safe" => true, }) end assert_match( @@ -868,7 +868,7 @@ CONTENT "permalink" => "pretty", "source" => source_dir, "destination" => dest_dir, - "read_posts" => true + "read_posts" => true, }) end @@ -896,7 +896,7 @@ CONTENT "permalink" => "pretty", "source" => source_dir, "destination" => dest_dir, - "read_posts" => true + "read_posts" => true, }) end @@ -913,7 +913,7 @@ CONTENT "permalink" => "pretty", "source" => source_dir, "destination" => dest_dir, - "read_posts" => true + "read_posts" => true, }) end end @@ -932,7 +932,7 @@ CONTENT "permalink" => "pretty", "source" => source_dir, "destination" => dest_dir, - "read_posts" => true + "read_posts" => true, }) end @@ -959,7 +959,7 @@ CONTENT "permalink" => "pretty", "source" => source_dir, "destination" => dest_dir, - "read_posts" => true + "read_posts" => true, }) end @@ -982,7 +982,7 @@ CONTENT "permalink" => "pretty", "source" => source_dir, "destination" => dest_dir, - "read_posts" => true + "read_posts" => true, }) end @@ -1004,7 +1004,7 @@ CONTENT "permalink" => "pretty", "source" => source_dir, "destination" => dest_dir, - "read_posts" => true + "read_posts" => true, }) end @@ -1030,7 +1030,7 @@ CONTENT "permalink" => "pretty", "source" => source_dir, "destination" => dest_dir, - "read_posts" => true + "read_posts" => true, }) end assert_match( @@ -1125,7 +1125,7 @@ CONTENT "permalink" => "pretty", "source" => source_dir, "destination" => dest_dir, - "read_posts" => true + "read_posts" => true, }) end assert_match "Could not locate the included file 'missing.html' in any of " \ @@ -1150,7 +1150,7 @@ CONTENT "permalink" => "pretty", "source" => source_dir, "destination" => dest_dir, - "read_posts" => true + "read_posts" => true, }) end assert_equal( @@ -1180,7 +1180,7 @@ CONTENT "source" => source_dir, "destination" => dest_dir, "read_posts" => true, - "safe" => true + "safe" => true, }) end @result ||= "" @@ -1202,7 +1202,7 @@ CONTENT "source" => source_dir, "destination" => dest_dir, "read_posts" => true, - "safe" => true + "safe" => true, }) end assert_match(