jekyll 3.8.5 → 3.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ed516471d3283099829df11941c1aa3ade27332a31a5bf0dcfb619a140ded8a6
4
- data.tar.gz: de439ebe40081f3e2160d8e3d3f773652b032691c0b8d0092d102a73c47f66b5
3
+ metadata.gz: 8f959acffcad3e5404bc70b3930b7adc63785e242fa17b5b7ead0b43e693f5b0
4
+ data.tar.gz: dcaa4992fc6deafdb2990a6054a6436cdae588027d939a00d13b630444712596
5
5
  SHA512:
6
- metadata.gz: abf95c2ca9b932059d82fa7f99cb62602f9c15c10d23b83245caadaa2591f1ab23286ca08eaeb010c8287c2a2f86a5f66d52e87559067ea1da981e008095542a
7
- data.tar.gz: a14c8e1ae6e4f1ea6b07c203b8c2c0fa0cd22acfc72083d7ddb024527af0b605c4644ff1c455e127dc63d6828c518aa66f3b2703f3e9eae586a3d48cf9fdd566
6
+ metadata.gz: 17ae2536951e741b22c38926b51df8f7d189dfbfde2f6bd95e126f1c18573c9ac8a05509ed30133934bc98e9fe2d7a77fd7adf7909b178bab84ee00819356558
7
+ data.tar.gz: 80d2620582682894853b16cea940b5875ad9c2d5ea67ad2950df157037ba5cbe07972846d5b80be5a4b5c6ddcb572a644b940ff477a7ca9495cfb5e3d7fe296e
@@ -88,10 +88,14 @@ group :jekyll_plugins do
88
88
  end
89
89
 
90
90
  # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
91
- gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]
91
+ # and associated library.
92
+ install_if -> { RUBY_PLATFORM =~ %r!mingw|mswin|java! } do
93
+ gem "tzinfo", "~> 1.2"
94
+ gem "tzinfo-data"
95
+ end
92
96
 
93
97
  # Performance-booster for watching directories on Windows
94
- gem "wdm", "~> 0.1.0" if Gem.win_platform?
98
+ gem "wdm", "~> 0.1.0", :install_if => Gem.win_platform?
95
99
 
96
100
  RUBY
97
101
  end
@@ -8,8 +8,7 @@ module Jekyll
8
8
  mutable false
9
9
 
10
10
  def_delegator :@obj, :site_data, :data
11
- def_delegators :@obj, :time, :pages, :static_files, :documents,
12
- :tags, :categories
11
+ def_delegators :@obj, :time, :pages, :static_files, :tags, :categories
13
12
 
14
13
  private def_delegator :@obj, :config, :fallback_data
15
14
 
@@ -39,6 +38,16 @@ module Jekyll
39
38
  @site_collections ||= @obj.collections.values.sort_by(&:label).map(&:to_liquid)
40
39
  end
41
40
 
41
+ # `Site#documents` cannot be memoized so that `Site#docs_to_write` can access the
42
+ # latest state of the attribute.
43
+ #
44
+ # Since this method will be called after `Site#pre_render` hook,
45
+ # the `Site#documents` array shouldn't thereafter change and can therefore be
46
+ # safely memoized to prevent additional computation of `Site#documents`.
47
+ def documents
48
+ @documents ||= @obj.documents
49
+ end
50
+
42
51
  # `{{ site.related_posts }}` is how posts can get posts related to
43
52
  # them, either through LSI if it's enabled, or through the most
44
53
  # recent posts.
@@ -166,7 +166,7 @@ module Jekyll
166
166
 
167
167
  def liquid_block?(tag_name)
168
168
  return false unless tag_name.is_a?(String)
169
- return false if tag_name.start_with?("end")
169
+ return false unless Liquid::Template.tags[tag_name]
170
170
 
171
171
  Liquid::Template.tags[tag_name].ancestors.include?(Liquid::Block)
172
172
  rescue NoMethodError
@@ -53,7 +53,9 @@ module Jekyll
53
53
  private
54
54
 
55
55
  def filename_regex
56
- @filename_regex ||= %r!\A(#{source_dir}/|#{theme_dir}/|\W*)(.*)!i
56
+ @filename_regex ||= begin
57
+ %r!\A(#{Regexp.escape(source_dir)}/|#{Regexp.escape(theme_dir.to_s)}/|/*)(.*)!i
58
+ end
57
59
  end
58
60
 
59
61
  def new_profile_hash
@@ -314,15 +314,15 @@ module Jekyll
314
314
  #
315
315
  # Returns an Array of Documents which should be written
316
316
  def docs_to_write
317
- @docs_to_write ||= documents.select(&:write?)
317
+ documents.select(&:write?)
318
318
  end
319
319
 
320
320
  # Get all the documents
321
321
  #
322
322
  # Returns an Array of all Documents
323
323
  def documents
324
- collections.reduce(Set.new) do |docs, (_, collection)|
325
- docs + collection.docs + collection.files
324
+ collections.each_with_object(Set.new) do |(_, collection), set|
325
+ set.merge(collection.docs).merge(collection.files)
326
326
  end.to_a
327
327
  end
328
328
 
@@ -224,6 +224,7 @@ MSG
224
224
  else
225
225
  File.join(site.config["collections_dir"], page_payload["path"])
226
226
  end
227
+ resource_path.sub!(%r!/#excerpt\z!, "")
227
228
  site.in_source_dir File.dirname(resource_path)
228
229
  end
229
230
  end
@@ -56,12 +56,28 @@ module Jekyll
56
56
  end
57
57
 
58
58
  def realpath_for(folder)
59
- File.realpath(Jekyll.sanitized_path(root, folder.to_s))
60
- rescue Errno::ENOENT, Errno::EACCES, Errno::ELOOP
61
- Jekyll.logger.warn "Invalid theme folder:", folder
59
+ # This resolves all symlinks for the theme subfolder and then ensures
60
+ # that the directory remains inside the theme root. This prevents the
61
+ # use of symlinks for theme subfolders to escape the theme root.
62
+ # However, symlinks are allowed to point to other directories within the theme.
63
+ Jekyll.sanitized_path(root, File.realpath(Jekyll.sanitized_path(root, folder.to_s)))
64
+ rescue Errno::ENOENT, Errno::EACCES, Errno::ELOOP => e
65
+ log_realpath_exception(e, folder)
62
66
  nil
63
67
  end
64
68
 
69
+ def log_realpath_exception(err, folder)
70
+ return if err.is_a?(Errno::ENOENT)
71
+
72
+ case err
73
+ when Errno::EACCES
74
+ Jekyll.logger.error "Theme error:", "Directory '#{folder}' is not accessible."
75
+ when Errno::ELOOP
76
+ Jekyll.logger.error "Theme error:",
77
+ "Directory '#{folder}' includes a symbolic link loop."
78
+ end
79
+ end
80
+
65
81
  def gemspec
66
82
  @gemspec ||= Gem::Specification.find_by_name(name)
67
83
  rescue Gem::LoadError
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Jekyll
4
- VERSION = "3.8.5".freeze
4
+ VERSION = "3.8.6".freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.8.5
4
+ version: 3.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Preston-Werner
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-04 00:00:00.000000000 Z
11
+ date: 2019-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -327,8 +327,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
327
327
  - !ruby/object:Gem::Version
328
328
  version: '0'
329
329
  requirements: []
330
- rubyforge_project:
331
- rubygems_version: 2.7.6
330
+ rubygems_version: 3.0.3
332
331
  signing_key:
333
332
  specification_version: 2
334
333
  summary: A simple, blog aware, static site generator.