diff --git a/.rubocop.yml b/.rubocop.yml
index e5b26bcc..ea3aa106 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -9,6 +9,7 @@ AllCops:
- benchmark/**/*
- script/**/*
- vendor/**/*
+ - tmp/**/*
Layout/AlignArray:
Enabled: false
Layout/AlignHash:
@@ -99,6 +100,9 @@ Style/BracesAroundHashParameters:
Enabled: false
Style/ClassAndModuleChildren:
Enabled: false
+Style/FrozenStringLiteralComment:
+ Enabled: true
+ EnforcedStyle: always
Style/Documentation:
Enabled: false
Exclude:
diff --git a/Gemfile b/Gemfile
index 0306c71a..0dcb4776 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
source "https://rubygems.org"
gemspec :name => "jekyll"
diff --git a/Rakefile b/Rakefile
index c80324ab..a7d50088 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "rubygems"
require "rake"
require "rdoc"
diff --git a/exe/jekyll b/exe/jekyll
index baac0997..07e13717 100755
--- a/exe/jekyll
+++ b/exe/jekyll
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
+# frozen_string_literal: true
+
STDOUT.sync = true
$LOAD_PATH.unshift File.expand_path("../lib", __dir__)
diff --git a/features/step_definitions.rb b/features/step_definitions.rb
index c22adb48..29900491 100644
--- a/features/step_definitions.rb
+++ b/features/step_definitions.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Before do
FileUtils.rm_rf(Paths.test_dir) if Paths.test_dir.exist?
FileUtils.mkdir_p(Paths.test_dir) unless Paths.test_dir.directory?
diff --git a/features/support/formatter.rb b/features/support/formatter.rb
index 79d14664..745c74ec 100644
--- a/features/support/formatter.rb
+++ b/features/support/formatter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "fileutils"
require "colorator"
require "cucumber/formatter/console"
diff --git a/features/support/helpers.rb b/features/support/helpers.rb
index 118dd9cf..36a726b4 100644
--- a/features/support/helpers.rb
+++ b/features/support/helpers.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "fileutils"
require "jekyll"
require "time"
@@ -107,7 +109,8 @@ def run_in_shell(*args)
File.write(Paths.status_file, p.exitstatus)
File.open(Paths.output_file, "wb") do |f|
- f.puts "$ " << args.join(" ")
+ f.print "$ "
+ f.puts args.join(" ")
f.puts output
f.puts "EXIT STATUS: #{p.exitstatus}"
end
diff --git a/jekyll.gemspec b/jekyll.gemspec
index 5ec2e9a2..87031a80 100644
--- a/jekyll.gemspec
+++ b/jekyll.gemspec
@@ -1,4 +1,5 @@
# coding: utf-8
+# frozen_string_literal: true
lib = File.expand_path("lib", __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
diff --git a/lib/jekyll.rb b/lib/jekyll.rb
index 5e5923c2..fb5db3d4 100644
--- a/lib/jekyll.rb
+++ b/lib/jekyll.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
$LOAD_PATH.unshift __dir__ # For use/testing when no gem is installed
# Require all of the Ruby files in the given directory.
@@ -162,8 +164,9 @@ module Jekyll
def sanitized_path(base_directory, questionable_path)
return base_directory if base_directory.eql?(questionable_path)
- questionable_path.insert(0, "/") if questionable_path.start_with?("~")
- clean_path = File.expand_path(questionable_path, "/")
+ clean_path = questionable_path.dup
+ clean_path.insert(0, "/") if clean_path.start_with?("~")
+ clean_path = File.expand_path(clean_path, "/")
return clean_path if clean_path.eql?(base_directory)
diff --git a/lib/jekyll/cleaner.rb b/lib/jekyll/cleaner.rb
index db8a9180..fee6418a 100644
--- a/lib/jekyll/cleaner.rb
+++ b/lib/jekyll/cleaner.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "set"
module Jekyll
diff --git a/lib/jekyll/collection.rb b/lib/jekyll/collection.rb
index f839915f..ebafea38 100644
--- a/lib/jekyll/collection.rb
+++ b/lib/jekyll/collection.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
class Collection
attr_reader :site, :label, :metadata
diff --git a/lib/jekyll/command.rb b/lib/jekyll/command.rb
index f9f243dd..7de98e76 100644
--- a/lib/jekyll/command.rb
+++ b/lib/jekyll/command.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
class Command
class << self
diff --git a/lib/jekyll/commands/build.rb b/lib/jekyll/commands/build.rb
index 3cea607c..1bd176b8 100644
--- a/lib/jekyll/commands/build.rb
+++ b/lib/jekyll/commands/build.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
module Commands
class Build < Command
diff --git a/lib/jekyll/commands/clean.rb b/lib/jekyll/commands/clean.rb
index 3a44d596..1c3e40bf 100644
--- a/lib/jekyll/commands/clean.rb
+++ b/lib/jekyll/commands/clean.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
module Commands
class Clean < Command
diff --git a/lib/jekyll/commands/doctor.rb b/lib/jekyll/commands/doctor.rb
index 5c235dac..1ef87e71 100644
--- a/lib/jekyll/commands/doctor.rb
+++ b/lib/jekyll/commands/doctor.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "addressable/uri"
module Jekyll
diff --git a/lib/jekyll/commands/help.rb b/lib/jekyll/commands/help.rb
index b4f136bf..42a8017a 100644
--- a/lib/jekyll/commands/help.rb
+++ b/lib/jekyll/commands/help.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
module Commands
class Help < Command
diff --git a/lib/jekyll/commands/new.rb b/lib/jekyll/commands/new.rb
index d1aeb5a0..b1c8bb0b 100644
--- a/lib/jekyll/commands/new.rb
+++ b/lib/jekyll/commands/new.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "erb"
module Jekyll
diff --git a/lib/jekyll/commands/new_theme.rb b/lib/jekyll/commands/new_theme.rb
index 65125d58..c55e6812 100644
--- a/lib/jekyll/commands/new_theme.rb
+++ b/lib/jekyll/commands/new_theme.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "erb"
class Jekyll::Commands::NewTheme < Jekyll::Command
diff --git a/lib/jekyll/commands/serve.rb b/lib/jekyll/commands/serve.rb
index 4bc9eaf0..53973b66 100644
--- a/lib/jekyll/commands/serve.rb
+++ b/lib/jekyll/commands/serve.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
module Commands
class Serve < Command
diff --git a/lib/jekyll/commands/serve/servlet.rb b/lib/jekyll/commands/serve/servlet.rb
index 2e20ace8..b661940c 100644
--- a/lib/jekyll/commands/serve/servlet.rb
+++ b/lib/jekyll/commands/serve/servlet.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "webrick"
module Jekyll
diff --git a/lib/jekyll/configuration.rb b/lib/jekyll/configuration.rb
index ec8e2a22..2931cba4 100644
--- a/lib/jekyll/configuration.rb
+++ b/lib/jekyll/configuration.rb
@@ -1,4 +1,5 @@
# encoding: UTF-8
+# frozen_string_literal: true
module Jekyll
class Configuration < Hash
diff --git a/lib/jekyll/converter.rb b/lib/jekyll/converter.rb
index b7fa0091..3cb74de2 100644
--- a/lib/jekyll/converter.rb
+++ b/lib/jekyll/converter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
class Converter < Plugin
# Public: Get or set the highlighter prefix. When an argument is specified,
diff --git a/lib/jekyll/converters/identity.rb b/lib/jekyll/converters/identity.rb
index 9574769d..2296aff1 100644
--- a/lib/jekyll/converters/identity.rb
+++ b/lib/jekyll/converters/identity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
module Converters
class Identity < Converter
diff --git a/lib/jekyll/converters/markdown.rb b/lib/jekyll/converters/markdown.rb
index c718d539..3e539921 100644
--- a/lib/jekyll/converters/markdown.rb
+++ b/lib/jekyll/converters/markdown.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
module Converters
class Markdown < Converter
diff --git a/lib/jekyll/converters/markdown/rdiscount_parser.rb b/lib/jekyll/converters/markdown/rdiscount_parser.rb
index f1679e79..654a3a6d 100644
--- a/lib/jekyll/converters/markdown/rdiscount_parser.rb
+++ b/lib/jekyll/converters/markdown/rdiscount_parser.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
module Converters
class Markdown
diff --git a/lib/jekyll/converters/markdown/redcarpet_parser.rb b/lib/jekyll/converters/markdown/redcarpet_parser.rb
index aa170feb..fae09621 100644
--- a/lib/jekyll/converters/markdown/redcarpet_parser.rb
+++ b/lib/jekyll/converters/markdown/redcarpet_parser.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Jekyll::Converters::Markdown::RedcarpetParser
module CommonMethods
def add_code_tags(code, lang)
@@ -48,9 +50,7 @@ class Jekyll::Converters::Markdown::RedcarpetParser
def block_code(code, lang)
code = "
#{super}
"
- output = ""
- output << add_code_tags(code, lang)
- output << "
"
+ "#{add_code_tags(code, lang)}
"
end
protected
diff --git a/lib/jekyll/converters/smartypants.rb b/lib/jekyll/converters/smartypants.rb
index d1bc8103..37fecb12 100644
--- a/lib/jekyll/converters/smartypants.rb
+++ b/lib/jekyll/converters/smartypants.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Kramdown::Parser::SmartyPants < Kramdown::Parser::Kramdown
def initialize(source, options)
super
diff --git a/lib/jekyll/convertible.rb b/lib/jekyll/convertible.rb
index 74125f09..aea33fdc 100644
--- a/lib/jekyll/convertible.rb
+++ b/lib/jekyll/convertible.rb
@@ -1,4 +1,5 @@
# encoding: UTF-8
+# frozen_string_literal: true
require "set"
diff --git a/lib/jekyll/deprecator.rb b/lib/jekyll/deprecator.rb
index ca2b8b3f..327358c2 100644
--- a/lib/jekyll/deprecator.rb
+++ b/lib/jekyll/deprecator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
module Deprecator
extend self
diff --git a/lib/jekyll/document.rb b/lib/jekyll/document.rb
index 8634082c..b6493f3c 100644
--- a/lib/jekyll/document.rb
+++ b/lib/jekyll/document.rb
@@ -1,4 +1,5 @@
# encoding: UTF-8
+# frozen_string_literal: true
module Jekyll
class Document
diff --git a/lib/jekyll/drops/collection_drop.rb b/lib/jekyll/drops/collection_drop.rb
index 5f5025b1..2c9c0132 100644
--- a/lib/jekyll/drops/collection_drop.rb
+++ b/lib/jekyll/drops/collection_drop.rb
@@ -1,4 +1,5 @@
# encoding: UTF-8
+# frozen_string_literal: true
module Jekyll
module Drops
diff --git a/lib/jekyll/drops/document_drop.rb b/lib/jekyll/drops/document_drop.rb
index ed851821..7796980c 100644
--- a/lib/jekyll/drops/document_drop.rb
+++ b/lib/jekyll/drops/document_drop.rb
@@ -1,4 +1,5 @@
# encoding: UTF-8
+# frozen_string_literal: true
module Jekyll
module Drops
diff --git a/lib/jekyll/drops/drop.rb b/lib/jekyll/drops/drop.rb
index 6227213e..1ded11eb 100644
--- a/lib/jekyll/drops/drop.rb
+++ b/lib/jekyll/drops/drop.rb
@@ -1,4 +1,5 @@
# encoding: UTF-8
+# frozen_string_literal: true
module Jekyll
module Drops
diff --git a/lib/jekyll/drops/excerpt_drop.rb b/lib/jekyll/drops/excerpt_drop.rb
index 5d61aeb1..06f8ae7d 100644
--- a/lib/jekyll/drops/excerpt_drop.rb
+++ b/lib/jekyll/drops/excerpt_drop.rb
@@ -1,4 +1,5 @@
# encoding: UTF-8
+# frozen_string_literal: true
module Jekyll
module Drops
diff --git a/lib/jekyll/drops/jekyll_drop.rb b/lib/jekyll/drops/jekyll_drop.rb
index e3d2eb38..1686da41 100644
--- a/lib/jekyll/drops/jekyll_drop.rb
+++ b/lib/jekyll/drops/jekyll_drop.rb
@@ -1,4 +1,5 @@
# encoding: UTF-8
+# frozen_string_literal: true
module Jekyll
module Drops
diff --git a/lib/jekyll/drops/site_drop.rb b/lib/jekyll/drops/site_drop.rb
index 97b41806..cb4a007e 100644
--- a/lib/jekyll/drops/site_drop.rb
+++ b/lib/jekyll/drops/site_drop.rb
@@ -1,4 +1,5 @@
# encoding: UTF-8
+# frozen_string_literal: true
module Jekyll
module Drops
diff --git a/lib/jekyll/drops/static_file_drop.rb b/lib/jekyll/drops/static_file_drop.rb
index e0af2f09..f855cf33 100644
--- a/lib/jekyll/drops/static_file_drop.rb
+++ b/lib/jekyll/drops/static_file_drop.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
module Drops
class StaticFileDrop < Drop
diff --git a/lib/jekyll/drops/unified_payload_drop.rb b/lib/jekyll/drops/unified_payload_drop.rb
index b642bda2..833443a4 100644
--- a/lib/jekyll/drops/unified_payload_drop.rb
+++ b/lib/jekyll/drops/unified_payload_drop.rb
@@ -1,4 +1,5 @@
# encoding: UTF-8
+# frozen_string_literal: true
module Jekyll
module Drops
diff --git a/lib/jekyll/drops/url_drop.rb b/lib/jekyll/drops/url_drop.rb
index 5c97190d..e67d24d4 100644
--- a/lib/jekyll/drops/url_drop.rb
+++ b/lib/jekyll/drops/url_drop.rb
@@ -1,4 +1,5 @@
# encoding: UTF-8
+# frozen_string_literal: true
module Jekyll
module Drops
diff --git a/lib/jekyll/entry_filter.rb b/lib/jekyll/entry_filter.rb
index f4425037..01913319 100644
--- a/lib/jekyll/entry_filter.rb
+++ b/lib/jekyll/entry_filter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
class EntryFilter
attr_reader :site
diff --git a/lib/jekyll/errors.rb b/lib/jekyll/errors.rb
index 95aa04b4..8d659e8d 100644
--- a/lib/jekyll/errors.rb
+++ b/lib/jekyll/errors.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
module Errors
FatalException = Class.new(::RuntimeError)
diff --git a/lib/jekyll/excerpt.rb b/lib/jekyll/excerpt.rb
index 61344e79..7adfec98 100644
--- a/lib/jekyll/excerpt.rb
+++ b/lib/jekyll/excerpt.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
class Excerpt
extend Forwardable
@@ -117,7 +119,7 @@ module Jekyll
if tail.empty?
head
else
- "" << head << "\n\n" << tail.scan(%r!^ {0,3}\[[^\]]+\]:.+$!).join("\n")
+ head.to_s.dup << "\n\n" << tail.scan(%r!^ {0,3}\[[^\]]+\]:.+$!).join("\n")
end
end
end
diff --git a/lib/jekyll/external.rb b/lib/jekyll/external.rb
index bdefc798..0a65dfad 100644
--- a/lib/jekyll/external.rb
+++ b/lib/jekyll/external.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
module External
class << self
diff --git a/lib/jekyll/filters.rb b/lib/jekyll/filters.rb
index e15cf7c6..35ed4d9f 100644
--- a/lib/jekyll/filters.rb
+++ b/lib/jekyll/filters.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "addressable/uri"
require "json"
require "date"
diff --git a/lib/jekyll/filters/grouping_filters.rb b/lib/jekyll/filters/grouping_filters.rb
index c1029256..4086bbe9 100644
--- a/lib/jekyll/filters/grouping_filters.rb
+++ b/lib/jekyll/filters/grouping_filters.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
module Filters
module GroupingFilters
diff --git a/lib/jekyll/filters/url_filters.rb b/lib/jekyll/filters/url_filters.rb
index 6ededc95..5bae1b17 100644
--- a/lib/jekyll/filters/url_filters.rb
+++ b/lib/jekyll/filters/url_filters.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "addressable/uri"
module Jekyll
diff --git a/lib/jekyll/frontmatter_defaults.rb b/lib/jekyll/frontmatter_defaults.rb
index 7cbfa358..fc1bcc2d 100644
--- a/lib/jekyll/frontmatter_defaults.rb
+++ b/lib/jekyll/frontmatter_defaults.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
# This class handles custom defaults for YAML frontmatter settings.
# These are set in _config.yml and apply both to internal use (e.g. layout)
diff --git a/lib/jekyll/generator.rb b/lib/jekyll/generator.rb
index bf7c0f19..649715f8 100644
--- a/lib/jekyll/generator.rb
+++ b/lib/jekyll/generator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
Generator = Class.new(Plugin)
end
diff --git a/lib/jekyll/hooks.rb b/lib/jekyll/hooks.rb
index 241dce3a..8007edff 100644
--- a/lib/jekyll/hooks.rb
+++ b/lib/jekyll/hooks.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
module Hooks
DEFAULT_PRIORITY = 20
diff --git a/lib/jekyll/layout.rb b/lib/jekyll/layout.rb
index 3a08ad0d..f62fec08 100644
--- a/lib/jekyll/layout.rb
+++ b/lib/jekyll/layout.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
class Layout
include Convertible
diff --git a/lib/jekyll/liquid_extensions.rb b/lib/jekyll/liquid_extensions.rb
index 5ba7dd8e..4551ac19 100644
--- a/lib/jekyll/liquid_extensions.rb
+++ b/lib/jekyll/liquid_extensions.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
module LiquidExtensions
diff --git a/lib/jekyll/liquid_renderer.rb b/lib/jekyll/liquid_renderer.rb
index 919930ef..2e15dbc6 100644
--- a/lib/jekyll/liquid_renderer.rb
+++ b/lib/jekyll/liquid_renderer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "jekyll/liquid_renderer/file"
require "jekyll/liquid_renderer/table"
diff --git a/lib/jekyll/liquid_renderer/file.rb b/lib/jekyll/liquid_renderer/file.rb
index eec8c7b5..574bbd31 100644
--- a/lib/jekyll/liquid_renderer/file.rb
+++ b/lib/jekyll/liquid_renderer/file.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
class LiquidRenderer
class File
diff --git a/lib/jekyll/liquid_renderer/table.rb b/lib/jekyll/liquid_renderer/table.rb
index aab7fdf7..7aa2e49e 100644
--- a/lib/jekyll/liquid_renderer/table.rb
+++ b/lib/jekyll/liquid_renderer/table.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
class LiquidRenderer::Table
def initialize(stats)
@@ -13,7 +15,7 @@ module Jekyll
private
def generate_table(data, widths)
- str = "\n"
+ str = String.new("\n")
table_head = data.shift
str << generate_row(table_head, widths)
@@ -28,7 +30,7 @@ module Jekyll
end
def generate_table_head_border(row_data, widths)
- str = ""
+ str = String.new("")
row_data.each_index do |cell_index|
str << "-" * widths[cell_index]
@@ -40,7 +42,7 @@ module Jekyll
end
def generate_row(row_data, widths)
- str = ""
+ str = String.new("")
row_data.each_with_index do |cell_data, cell_index|
str << if cell_index.zero?
diff --git a/lib/jekyll/log_adapter.rb b/lib/jekyll/log_adapter.rb
index 965f3295..ec33b4d9 100644
--- a/lib/jekyll/log_adapter.rb
+++ b/lib/jekyll/log_adapter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
class LogAdapter
attr_reader :writer, :messages
diff --git a/lib/jekyll/page.rb b/lib/jekyll/page.rb
index 02c6cfae..3b3d9353 100644
--- a/lib/jekyll/page.rb
+++ b/lib/jekyll/page.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
class Page
include Convertible
diff --git a/lib/jekyll/plugin.rb b/lib/jekyll/plugin.rb
index b6e5023d..2a9dbeed 100644
--- a/lib/jekyll/plugin.rb
+++ b/lib/jekyll/plugin.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
class Plugin
PRIORITIES = {
diff --git a/lib/jekyll/plugin_manager.rb b/lib/jekyll/plugin_manager.rb
index 979004d6..f53d187a 100644
--- a/lib/jekyll/plugin_manager.rb
+++ b/lib/jekyll/plugin_manager.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
class PluginManager
attr_reader :site
diff --git a/lib/jekyll/publisher.rb b/lib/jekyll/publisher.rb
index 0b67b8c6..26fe4a38 100644
--- a/lib/jekyll/publisher.rb
+++ b/lib/jekyll/publisher.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
class Publisher
def initialize(site)
diff --git a/lib/jekyll/reader.rb b/lib/jekyll/reader.rb
index 903e36d3..5804d1f9 100644
--- a/lib/jekyll/reader.rb
+++ b/lib/jekyll/reader.rb
@@ -1,4 +1,5 @@
# encoding: UTF-8
+# frozen_string_literal: true
require "csv"
diff --git a/lib/jekyll/readers/collection_reader.rb b/lib/jekyll/readers/collection_reader.rb
index 062be42a..7d605f42 100644
--- a/lib/jekyll/readers/collection_reader.rb
+++ b/lib/jekyll/readers/collection_reader.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
class CollectionReader
SPECIAL_COLLECTIONS = %w(posts data).freeze
diff --git a/lib/jekyll/readers/data_reader.rb b/lib/jekyll/readers/data_reader.rb
index 63db7c6d..e2671f2d 100644
--- a/lib/jekyll/readers/data_reader.rb
+++ b/lib/jekyll/readers/data_reader.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
class DataReader
attr_reader :site, :content
diff --git a/lib/jekyll/readers/layout_reader.rb b/lib/jekyll/readers/layout_reader.rb
index 985491c6..706dfed8 100644
--- a/lib/jekyll/readers/layout_reader.rb
+++ b/lib/jekyll/readers/layout_reader.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
class LayoutReader
attr_reader :site
diff --git a/lib/jekyll/readers/page_reader.rb b/lib/jekyll/readers/page_reader.rb
index 507c609e..62d7419e 100644
--- a/lib/jekyll/readers/page_reader.rb
+++ b/lib/jekyll/readers/page_reader.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
class PageReader
attr_reader :site, :dir, :unfiltered_content
diff --git a/lib/jekyll/readers/post_reader.rb b/lib/jekyll/readers/post_reader.rb
index 70688875..51019279 100644
--- a/lib/jekyll/readers/post_reader.rb
+++ b/lib/jekyll/readers/post_reader.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
class PostReader
attr_reader :site, :unfiltered_content
diff --git a/lib/jekyll/readers/static_file_reader.rb b/lib/jekyll/readers/static_file_reader.rb
index 1d43d69c..6bf07f5a 100644
--- a/lib/jekyll/readers/static_file_reader.rb
+++ b/lib/jekyll/readers/static_file_reader.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
class StaticFileReader
attr_reader :site, :dir, :unfiltered_content
diff --git a/lib/jekyll/readers/theme_assets_reader.rb b/lib/jekyll/readers/theme_assets_reader.rb
index 80a6547d..2706690c 100644
--- a/lib/jekyll/readers/theme_assets_reader.rb
+++ b/lib/jekyll/readers/theme_assets_reader.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
class ThemeAssetsReader
attr_reader :site
diff --git a/lib/jekyll/regenerator.rb b/lib/jekyll/regenerator.rb
index 09ff309a..91ce3003 100644
--- a/lib/jekyll/regenerator.rb
+++ b/lib/jekyll/regenerator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
class Regenerator
attr_reader :site, :metadata, :cache
diff --git a/lib/jekyll/related_posts.rb b/lib/jekyll/related_posts.rb
index 3526a73b..fcccdd80 100644
--- a/lib/jekyll/related_posts.rb
+++ b/lib/jekyll/related_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
class RelatedPosts
class << self
diff --git a/lib/jekyll/renderer.rb b/lib/jekyll/renderer.rb
index b0f544e3..5a2d32a8 100644
--- a/lib/jekyll/renderer.rb
+++ b/lib/jekyll/renderer.rb
@@ -1,4 +1,5 @@
# encoding: UTF-8
+# frozen_string_literal: true
module Jekyll
class Renderer
diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb
index 0bc3f1d5..54155d0c 100644
--- a/lib/jekyll/site.rb
+++ b/lib/jekyll/site.rb
@@ -1,4 +1,5 @@
# encoding: UTF-8
+# frozen_string_literal: true
require "csv"
diff --git a/lib/jekyll/static_file.rb b/lib/jekyll/static_file.rb
index 29d71cbe..55f0256c 100644
--- a/lib/jekyll/static_file.rb
+++ b/lib/jekyll/static_file.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
class StaticFile
attr_reader :relative_path, :extname, :name, :data
diff --git a/lib/jekyll/stevenson.rb b/lib/jekyll/stevenson.rb
index bf20b22f..bbec6617 100644
--- a/lib/jekyll/stevenson.rb
+++ b/lib/jekyll/stevenson.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
class Stevenson < ::Logger
def initialize
diff --git a/lib/jekyll/tags/highlight.rb b/lib/jekyll/tags/highlight.rb
index 86b9171b..7ea95b0b 100644
--- a/lib/jekyll/tags/highlight.rb
+++ b/lib/jekyll/tags/highlight.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
module Tags
class HighlightBlock < Liquid::Block
diff --git a/lib/jekyll/tags/include.rb b/lib/jekyll/tags/include.rb
index 08843047..ef6c8f73 100644
--- a/lib/jekyll/tags/include.rb
+++ b/lib/jekyll/tags/include.rb
@@ -1,4 +1,5 @@
# encoding: UTF-8
+# frozen_string_literal: true
module Jekyll
module Tags
diff --git a/lib/jekyll/tags/link.rb b/lib/jekyll/tags/link.rb
index a076c417..77f4da9c 100644
--- a/lib/jekyll/tags/link.rb
+++ b/lib/jekyll/tags/link.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
module Tags
class Link < Liquid::Tag
diff --git a/lib/jekyll/tags/post_url.rb b/lib/jekyll/tags/post_url.rb
index f7e52f42..9a1b8337 100644
--- a/lib/jekyll/tags/post_url.rb
+++ b/lib/jekyll/tags/post_url.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
module Tags
class PostComparer
diff --git a/lib/jekyll/theme.rb b/lib/jekyll/theme.rb
index 045c91aa..031c61b1 100644
--- a/lib/jekyll/theme.rb
+++ b/lib/jekyll/theme.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
class Theme
extend Forwardable
diff --git a/lib/jekyll/theme_builder.rb b/lib/jekyll/theme_builder.rb
index f1c97e37..aca89dd6 100644
--- a/lib/jekyll/theme_builder.rb
+++ b/lib/jekyll/theme_builder.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Jekyll::ThemeBuilder
SCAFFOLD_DIRECTORIES = %w(
assets _layouts _includes _sass
diff --git a/lib/jekyll/url.rb b/lib/jekyll/url.rb
index 8f3047d3..f9157850 100644
--- a/lib/jekyll/url.rb
+++ b/lib/jekyll/url.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "addressable/uri"
# Public: Methods that generate a URL for a resource such as a Post or a Page.
@@ -93,7 +95,7 @@ module Jekyll
def generate_url_from_drop(template)
template.gsub(%r!:([a-z_]+)!) do |match|
- pool = possible_keys(match.sub(":".freeze, "".freeze))
+ pool = possible_keys(match.sub(":", ""))
winner = pool.find { |key| @placeholders.key?(key) }
if winner.nil?
diff --git a/lib/jekyll/utils.rb b/lib/jekyll/utils.rb
index 3f91a2b0..c9dcf2fd 100644
--- a/lib/jekyll/utils.rb
+++ b/lib/jekyll/utils.rb
@@ -1,4 +1,6 @@
+# frozen_string_literal: true
+
module Jekyll
module Utils
extend self
@@ -247,6 +249,8 @@ module Jekyll
#
# Returns the updated permalink template
def add_permalink_suffix(template, permalink_style)
+ template = template.dup
+
case permalink_style
when :pretty
template << "/"
@@ -256,6 +260,7 @@ module Jekyll
template << "/" if permalink_style.to_s.end_with?("/")
template << ":output_ext" if permalink_style.to_s.end_with?(":output_ext")
end
+
template
end
@@ -296,7 +301,7 @@ module Jekyll
def merged_file_read_opts(site, opts)
merged = (site ? site.file_read_opts : {}).merge(opts)
if merged["encoding"] && !merged["encoding"].start_with?("bom|")
- merged["encoding"].insert(0, "bom|")
+ merged["encoding"] = "bom|#{merged["encoding"]}"
end
merged
end
diff --git a/lib/jekyll/utils/exec.rb b/lib/jekyll/utils/exec.rb
index 33403dbc..fee8b2d2 100644
--- a/lib/jekyll/utils/exec.rb
+++ b/lib/jekyll/utils/exec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "open3"
module Jekyll
diff --git a/lib/jekyll/utils/platforms.rb b/lib/jekyll/utils/platforms.rb
index f66ef795..f4f3382a 100644
--- a/lib/jekyll/utils/platforms.rb
+++ b/lib/jekyll/utils/platforms.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
module Utils
module Platforms
diff --git a/lib/jekyll/utils/win_tz.rb b/lib/jekyll/utils/win_tz.rb
index 06a10422..322f5ac6 100644
--- a/lib/jekyll/utils/win_tz.rb
+++ b/lib/jekyll/utils/win_tz.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
module Utils
module WinTZ
diff --git a/lib/jekyll/version.rb b/lib/jekyll/version.rb
index 8a8b2b30..6a276204 100644
--- a/lib/jekyll/version.rb
+++ b/lib/jekyll/version.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
VERSION = "3.5.1".freeze
end
diff --git a/lib/theme_template/Gemfile b/lib/theme_template/Gemfile
index 3be9c3cd..bb94df82 100644
--- a/lib/theme_template/Gemfile
+++ b/lib/theme_template/Gemfile
@@ -1,2 +1,4 @@
+# frozen_string_literal: true
+
source "https://rubygems.org"
gemspec
diff --git a/rake/docs.rake b/rake/docs.rake
index fcae4f20..e64c6cfd 100644
--- a/rake/docs.rake
+++ b/rake/docs.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
#############################################################################
#
# Packaging tasks for jekyll-docs
diff --git a/rake/release.rake b/rake/release.rake
index 9d9220a4..ce7bf41c 100644
--- a/rake/release.rake
+++ b/rake/release.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
#############################################################################
#
# Packaging tasks
diff --git a/rake/site.rake b/rake/site.rake
index 00ffd228..94aa969e 100644
--- a/rake/site.rake
+++ b/rake/site.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
#############################################################################
#
# Site tasks - https://jekyllrb.com
diff --git a/test/fixtures/test-dependency-theme/test-dependency-theme.gemspec b/test/fixtures/test-dependency-theme/test-dependency-theme.gemspec
index 5c260329..ebc8a83c 100644
--- a/test/fixtures/test-dependency-theme/test-dependency-theme.gemspec
+++ b/test/fixtures/test-dependency-theme/test-dependency-theme.gemspec
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Gem::Specification.new do |s|
s.name = "test-dependency-theme"
s.version = "0.1.0"
diff --git a/test/fixtures/test-theme/test-theme.gemspec b/test/fixtures/test-theme/test-theme.gemspec
index 73e5deb2..970e1b8a 100644
--- a/test/fixtures/test-theme/test-theme.gemspec
+++ b/test/fixtures/test-theme/test-theme.gemspec
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Gem::Specification.new do |s|
s.name = "test-theme"
s.version = "0.1.0"
diff --git a/test/helper.rb b/test/helper.rb
index 83beaad3..3f3227ba 100644
--- a/test/helper.rb
+++ b/test/helper.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
$stdout.puts "# -------------------------------------------------------------"
$stdout.puts "# SPECS AND TESTS ARE RUNNING WITH WARNINGS OFF."
$stdout.puts "# SEE: https://github.com/Shopify/liquid/issues/730"
diff --git a/test/simplecov_custom_profile.rb b/test/simplecov_custom_profile.rb
index 0aaec88a..555acec3 100644
--- a/test/simplecov_custom_profile.rb
+++ b/test/simplecov_custom_profile.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "simplecov"
SimpleCov.profiles.define "gem" do
diff --git a/test/source/_plugins/dummy.rb b/test/source/_plugins/dummy.rb
index fd11d0e1..25eef88e 100644
--- a/test/source/_plugins/dummy.rb
+++ b/test/source/_plugins/dummy.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jekyll
class Dummy < Generator
priority :high
diff --git a/test/test_ansi.rb b/test/test_ansi.rb
index 8f18f56e..9b4fd016 100644
--- a/test/test_ansi.rb
+++ b/test/test_ansi.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "helper"
class TestAnsi < JekyllUnitTest
diff --git a/test/test_cleaner.rb b/test/test_cleaner.rb
index d3072e54..65442ced 100644
--- a/test/test_cleaner.rb
+++ b/test/test_cleaner.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "helper"
class TestCleaner < JekyllUnitTest
diff --git a/test/test_coffeescript.rb b/test/test_coffeescript.rb
index 189ce05d..a60e0595 100644
--- a/test/test_coffeescript.rb
+++ b/test/test_coffeescript.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "helper"
class TestCoffeeScript < JekyllUnitTest
diff --git a/test/test_collections.rb b/test/test_collections.rb
index cb122cd9..e4dbe951 100644
--- a/test/test_collections.rb
+++ b/test/test_collections.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "helper"
class TestCollections < JekyllUnitTest
diff --git a/test/test_command.rb b/test/test_command.rb
index 90767013..33e13798 100644
--- a/test/test_command.rb
+++ b/test/test_command.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "helper"
class TestCommand < JekyllUnitTest
diff --git a/test/test_commands_serve.rb b/test/test_commands_serve.rb
index ef98bab4..135e83e2 100644
--- a/test/test_commands_serve.rb
+++ b/test/test_commands_serve.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "webrick"
require "mercenary"
require "helper"
diff --git a/test/test_configuration.rb b/test/test_configuration.rb
index 50156926..dddb61b8 100644
--- a/test/test_configuration.rb
+++ b/test/test_configuration.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "helper"
require "colorator"
diff --git a/test/test_convertible.rb b/test/test_convertible.rb
index ef703070..cc5be878 100644
--- a/test/test_convertible.rb
+++ b/test/test_convertible.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "helper"
require "ostruct"
diff --git a/test/test_doctor_command.rb b/test/test_doctor_command.rb
index 88614402..18287868 100644
--- a/test/test_doctor_command.rb
+++ b/test/test_doctor_command.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "helper"
require "jekyll/commands/doctor"
diff --git a/test/test_document.rb b/test/test_document.rb
index 8726c83c..42ba3c57 100644
--- a/test/test_document.rb
+++ b/test/test_document.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "helper"
class TestDocument < JekyllUnitTest
diff --git a/test/test_drop.rb b/test/test_drop.rb
index 80b0d0ff..00d21164 100644
--- a/test/test_drop.rb
+++ b/test/test_drop.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "helper"
class TestDrop < JekyllUnitTest
diff --git a/test/test_entry_filter.rb b/test/test_entry_filter.rb
index 7f32653c..c9025092 100644
--- a/test/test_entry_filter.rb
+++ b/test/test_entry_filter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "helper"
class TestEntryFilter < JekyllUnitTest
diff --git a/test/test_excerpt.rb b/test/test_excerpt.rb
index e0960f69..2bcf3ba8 100644
--- a/test/test_excerpt.rb
+++ b/test/test_excerpt.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "helper"
class TestExcerpt < JekyllUnitTest
diff --git a/test/test_excerpt_drop.rb b/test/test_excerpt_drop.rb
index 901b06a6..1eb66872 100644
--- a/test/test_excerpt_drop.rb
+++ b/test/test_excerpt_drop.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "helper"
class TestExcerptDrop < JekyllUnitTest
diff --git a/test/test_filters.rb b/test/test_filters.rb
index e0eb2fee..cb95a644 100644
--- a/test/test_filters.rb
+++ b/test/test_filters.rb
@@ -1,4 +1,5 @@
# coding: utf-8
+# frozen_string_literal: true
require "helper"
diff --git a/test/test_front_matter_defaults.rb b/test/test_front_matter_defaults.rb
index d45ab6de..9bf9629a 100644
--- a/test/test_front_matter_defaults.rb
+++ b/test/test_front_matter_defaults.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "helper"
class TestFrontMatterDefaults < JekyllUnitTest
diff --git a/test/test_generated_site.rb b/test/test_generated_site.rb
index 84345524..136f5fc9 100644
--- a/test/test_generated_site.rb
+++ b/test/test_generated_site.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "helper"
class TestGeneratedSite < JekyllUnitTest
diff --git a/test/test_kramdown.rb b/test/test_kramdown.rb
index 6396d672..3861416f 100644
--- a/test/test_kramdown.rb
+++ b/test/test_kramdown.rb
@@ -1,4 +1,5 @@
# encoding: UTF-8
+# frozen_string_literal: true
require "helper"
diff --git a/test/test_layout_reader.rb b/test/test_layout_reader.rb
index 1d32fa57..96d2045a 100644
--- a/test/test_layout_reader.rb
+++ b/test/test_layout_reader.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "helper"
class TestLayoutReader < JekyllUnitTest
diff --git a/test/test_liquid_extensions.rb b/test/test_liquid_extensions.rb
index a76f3786..e281e10e 100644
--- a/test/test_liquid_extensions.rb
+++ b/test/test_liquid_extensions.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "helper"
class TestLiquidExtensions < JekyllUnitTest
diff --git a/test/test_liquid_renderer.rb b/test/test_liquid_renderer.rb
index 6ba29299..32e980b8 100644
--- a/test/test_liquid_renderer.rb
+++ b/test/test_liquid_renderer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "helper"
class TestLiquidRenderer < JekyllUnitTest
diff --git a/test/test_log_adapter.rb b/test/test_log_adapter.rb
index 7e0873ca..2bcd2f1d 100644
--- a/test/test_log_adapter.rb
+++ b/test/test_log_adapter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "helper"
class TestLogAdapter < JekyllUnitTest
diff --git a/test/test_new_command.rb b/test/test_new_command.rb
index 32db566d..c2b7def4 100644
--- a/test/test_new_command.rb
+++ b/test/test_new_command.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "helper"
require "jekyll/commands/new"
diff --git a/test/test_page.rb b/test/test_page.rb
index 431c57a6..ed4c2c31 100644
--- a/test/test_page.rb
+++ b/test/test_page.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "helper"
class TestPage < JekyllUnitTest
diff --git a/test/test_path_sanitization.rb b/test/test_path_sanitization.rb
index 31a4b92e..184385fa 100644
--- a/test/test_path_sanitization.rb
+++ b/test/test_path_sanitization.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "helper"
class TestPathSanitization < JekyllUnitTest
diff --git a/test/test_plugin_manager.rb b/test/test_plugin_manager.rb
index 90f05764..213bcef6 100644
--- a/test/test_plugin_manager.rb
+++ b/test/test_plugin_manager.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "helper"
class TestPluginManager < JekyllUnitTest
diff --git a/test/test_rdiscount.rb b/test/test_rdiscount.rb
index 32289a64..7116c29a 100644
--- a/test/test_rdiscount.rb
+++ b/test/test_rdiscount.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "helper"
class TestRdiscount < JekyllUnitTest
diff --git a/test/test_redcarpet.rb b/test/test_redcarpet.rb
index 4e979f4d..f4208570 100644
--- a/test/test_redcarpet.rb
+++ b/test/test_redcarpet.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "helper"
class TestRedcarpet < JekyllUnitTest
diff --git a/test/test_regenerator.rb b/test/test_regenerator.rb
index 9e1559d4..3a5d35a8 100644
--- a/test/test_regenerator.rb
+++ b/test/test_regenerator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "helper"
class TestRegenerator < JekyllUnitTest
diff --git a/test/test_related_posts.rb b/test/test_related_posts.rb
index 2d616550..d6a8fe6f 100644
--- a/test/test_related_posts.rb
+++ b/test/test_related_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "helper"
class TestRelatedPosts < JekyllUnitTest
diff --git a/test/test_sass.rb b/test/test_sass.rb
index 3a9df0ae..15b04162 100644
--- a/test/test_sass.rb
+++ b/test/test_sass.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "helper"
class TestSass < JekyllUnitTest
diff --git a/test/test_site.rb b/test/test_site.rb
index d039cb8a..adc69e33 100644
--- a/test/test_site.rb
+++ b/test/test_site.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "helper"
class TestSite < JekyllUnitTest
diff --git a/test/test_site_drop.rb b/test/test_site_drop.rb
index b836c70d..43c52d70 100644
--- a/test/test_site_drop.rb
+++ b/test/test_site_drop.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "helper"
class TestSiteDrop < JekyllUnitTest
diff --git a/test/test_static_file.rb b/test/test_static_file.rb
index 49adc96b..edfc9fac 100644
--- a/test/test_static_file.rb
+++ b/test/test_static_file.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "helper"
class TestStaticFile < JekyllUnitTest
diff --git a/test/test_tags.rb b/test/test_tags.rb
index 68fd4039..7a60ec9d 100644
--- a/test/test_tags.rb
+++ b/test/test_tags.rb
@@ -1,4 +1,5 @@
# coding: utf-8
+# frozen_string_literal: true
require "helper"
diff --git a/test/test_theme.rb b/test/test_theme.rb
index 3d557dc8..69628dde 100644
--- a/test/test_theme.rb
+++ b/test/test_theme.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "helper"
class TestTheme < JekyllUnitTest
diff --git a/test/test_theme_assets_reader.rb b/test/test_theme_assets_reader.rb
index 8d792f73..358789f5 100644
--- a/test/test_theme_assets_reader.rb
+++ b/test/test_theme_assets_reader.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "helper"
class TestThemeAssetsReader < JekyllUnitTest
diff --git a/test/test_url.rb b/test/test_url.rb
index 23ab9735..859babd4 100644
--- a/test/test_url.rb
+++ b/test/test_url.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "helper"
class TestURL < JekyllUnitTest
diff --git a/test/test_utils.rb b/test/test_utils.rb
index 5f5611ce..1b4d4813 100644
--- a/test/test_utils.rb
+++ b/test/test_utils.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "helper"
class TestUtils < JekyllUnitTest