jekyll 4.0.0 → 4.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3d628ad7c78b42c6430f0fa42153b0039881f581d1151678cb2d99a5256f0628
4
- data.tar.gz: 22a33c4249c92f5ce5e75d60420c11df71852a58b64a254ddb53c6ffec4f3ce9
3
+ metadata.gz: 0562e1d33bdfbe9a42636335c4f4d9c9da442ec3887886536f888720c9a87b9b
4
+ data.tar.gz: 8561a49dec1141a1b7c111939a8220113d5e01e51605f0eba76536ab06b265c7
5
5
  SHA512:
6
- metadata.gz: 68b602c0af4b2e2540584f3bf6210f07363d51b50a484d5134f8c69d38a7f5893fe130f6e63218e36e2f3a6e05a54eb8a46c220540a852cdc2417d8e0b24fb1d
7
- data.tar.gz: ab9c8776960d49245f22c6b5b759e2928cd77338a592374c14357e561c1525f1f6720e10c8bdecf0d3bb5c1231bb823ad9cd40fb6038a9c7198572f9879a1ba8
6
+ metadata.gz: fbccdaab958f04e2175e8b224b5495fcf5a55703a559e9f1f96b7821601f28b0db0545a96f4119314274751051ec300f1121ec0d0988a203c2cc99de37b71325
7
+ data.tar.gz: afa55cd05bcabfb2a3749c6ed0968039742068c440132ce786b6d2b3ab89458deba2652ec8363b686891c403d127e5177fe296acd85808eaf45f6bf58a934978
@@ -107,6 +107,8 @@ Style/Alias:
107
107
  EnforcedStyle: prefer_alias_method
108
108
  Style/AndOr:
109
109
  Severity: error
110
+ Style/BracesAroundHashParameters:
111
+ Enabled: false
110
112
  Style/ClassAndModuleChildren:
111
113
  Exclude:
112
114
  - test/**/*.rb
@@ -39,7 +39,7 @@ module Jekyll
39
39
 
40
40
  begin
41
41
  self.content = File.read(@path || site.in_source_dir(base, name),
42
- Utils.merged_file_read_opts(site, opts))
42
+ **Utils.merged_file_read_opts(site, opts))
43
43
  if content =~ Document::YAML_FRONT_MATTER_REGEXP
44
44
  self.content = $POSTMATCH
45
45
  self.data = SafeYAML.load(Regexp.last_match(1))
@@ -298,7 +298,7 @@ module Jekyll
298
298
  else
299
299
  begin
300
300
  merge_defaults
301
- read_content(opts)
301
+ read_content(**opts)
302
302
  read_post_data
303
303
  rescue StandardError => e
304
304
  handle_read_error(e)
@@ -429,14 +429,14 @@ module Jekyll
429
429
  categories.flatten!
430
430
  categories.uniq!
431
431
 
432
- merge_data!("categories" => categories)
432
+ merge_data!({ "categories" => categories })
433
433
  end
434
434
 
435
435
  def populate_tags
436
436
  tags = Utils.pluralized_array_from_hash(data, "tag", "tags")
437
437
  tags.flatten!
438
438
 
439
- merge_data!("tags" => tags)
439
+ merge_data!({ "tags" => tags })
440
440
  end
441
441
 
442
442
  private
@@ -462,8 +462,8 @@ module Jekyll
462
462
  merge_data!(defaults, :source => "front matter defaults") unless defaults.empty?
463
463
  end
464
464
 
465
- def read_content(opts)
466
- self.content = File.read(path, Utils.merged_file_read_opts(site, opts))
465
+ def read_content(**opts)
466
+ self.content = File.read(path, **Utils.merged_file_read_opts(site, opts))
467
467
  if content =~ YAML_FRONT_MATTER_REGEXP
468
468
  self.content = $POSTMATCH
469
469
  data_file = SafeYAML.load(Regexp.last_match(1))
@@ -368,15 +368,18 @@ module Jekyll
368
368
  end
369
369
  end
370
370
 
371
- # rubocop:disable Performance/RegexpMatch
371
+ FLOAT_LIKE = %r!\A\s*-?(?:\d+\.?\d*|\.\d+)\s*\Z!.freeze
372
+ INTEGER_LIKE = %r!\A\s*-?\d+\s*\Z!.freeze
373
+ private_constant :FLOAT_LIKE, :INTEGER_LIKE
374
+
372
375
  # return numeric values as numbers for proper sorting
373
376
  def parse_sort_input(property)
374
- number_like = %r!\A\s*-?(?:\d+\.?\d*|\.\d+)\s*\Z!
375
- return property.to_f if property.to_s =~ number_like
377
+ stringified = property.to_s
378
+ return property.to_i if INTEGER_LIKE.match?(stringified)
379
+ return property.to_f if FLOAT_LIKE.match?(stringified)
376
380
 
377
381
  property
378
382
  end
379
- # rubocop:enable Performance/RegexpMatch
380
383
 
381
384
  def as_liquid(item)
382
385
  case item
@@ -18,6 +18,8 @@ module Jekyll
18
18
  end
19
19
 
20
20
  def render(*args)
21
+ reset_template_assigns
22
+
21
23
  measure_time do
22
24
  measure_bytes do
23
25
  measure_counts do
@@ -29,6 +31,8 @@ module Jekyll
29
31
 
30
32
  # This method simply 'rethrows any error' before attempting to render the template.
31
33
  def render!(*args)
34
+ reset_template_assigns
35
+
32
36
  measure_time do
33
37
  measure_bytes do
34
38
  measure_counts do
@@ -44,6 +48,12 @@ module Jekyll
44
48
 
45
49
  private
46
50
 
51
+ # clear assigns to `Liquid::Template` instance prior to rendering since
52
+ # `Liquid::Template` instances are cached in Jekyll 4.
53
+ def reset_template_assigns
54
+ @template.instance_assigns.clear
55
+ end
56
+
47
57
  def measure_counts
48
58
  @renderer.increment_count(@filename)
49
59
  yield
@@ -126,7 +126,7 @@ module Jekyll
126
126
  :collection => @collection.label,
127
127
  :path => cleaned_relative_path,
128
128
  :output_ext => "",
129
- :name => "",
129
+ :name => basename,
130
130
  :title => "",
131
131
  }
132
132
  end
@@ -176,7 +176,7 @@ module Jekyll
176
176
 
177
177
  # This method allows to modify the file content by inheriting from the class.
178
178
  def read_file(file, context)
179
- File.read(file, file_read_opts(context))
179
+ File.read(file, **file_read_opts(context))
180
180
  end
181
181
 
182
182
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Jekyll
4
- VERSION = "4.0.0"
4
+ VERSION = "4.0.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Preston-Werner
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2019-08-20 00:00:00.000000000 Z
13
+ date: 2020-05-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: addressable
@@ -382,7 +382,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
382
382
  - !ruby/object:Gem::Version
383
383
  version: 2.7.0
384
384
  requirements: []
385
- rubygems_version: 3.0.4
385
+ rubygems_version: 3.1.2
386
386
  signing_key:
387
387
  specification_version: 4
388
388
  summary: A simple, blog aware, static site generator.