nanoc-core 4.12.20 → 4.12.21

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: 0bc06b86a25f8666e95d7f4112806c9c9b1ae652071fd89e084544c2f8016665
4
- data.tar.gz: a85710c5f160f0fa75237ed1ab805f58fde9f3c0f3efbe4b62e7a170e9d18999
3
+ metadata.gz: d6675a38101ebd10dc14bdea793786af898d8824034f13386ae3ebd1b66ca6f5
4
+ data.tar.gz: b4618d8ac489152d3bd30274365aea2fccda7a96f75875b25dbca604d0fac9a8
5
5
  SHA512:
6
- metadata.gz: 19b6e09d8ea2115fb38e3493ee45ed9438155d8801be0c72ca501f9bc8e5ad21b56269bf11d2c005a8c5a28ed176b7a483ef4df250359f201adbd8e8f36808b4
7
- data.tar.gz: 33b554e3eb1312e067925ab295bc020f41f097ebb090cea94e111609dbe66018d0450caf0e54e1f5d4e21581c7feafa0ef99d2d6e4de972789c2461effcfbcb0
6
+ metadata.gz: 5db81b09e8c17f60baa6b190bb52864bf2ba526cb38c5e6d304c46021c00e6a0ed6aa7d9e8d55221398cd5dee7535e910ed5859fba7084bdb5950ace2a4eb6c6
7
+ data.tar.gz: 8c90d0f5dea91f2bd4d5d67f5280a34428f58553689cfc9b5576222a5a37378f46bf0668c4400426f3e2008320d106db7617ccaa8166045c7f66d033f14374fc
@@ -61,14 +61,19 @@ module Nanoc
61
61
 
62
62
  private
63
63
 
64
- def update(obj, digest, visited = Immutable::Set.new)
65
- digest.update(obj.class.to_s)
66
-
67
- if visited.include?(obj)
68
- digest.update('<recur>')
64
+ def update(obj, digest, visited = {})
65
+ num = visited[obj]
66
+ if num
67
+ # If there already is an entry for this object, refer to it by its number.
68
+ digest.update("@#{num}")
69
69
  else
70
- digest.update('<')
71
- behavior_for(obj).update(obj, digest) { |o| update(o, digest, visited.add(obj)) }
70
+ # This object isn’t known yet. Assign it a new number.
71
+ num = visited.length
72
+ visited[obj] = num
73
+
74
+ digest.update(obj.class.to_s)
75
+ digest.update("##{num}<")
76
+ behavior_for(obj).update(obj, digest) { |o| update(o, digest, visited) }
72
77
  digest.update('>')
73
78
  end
74
79
  end
@@ -10,19 +10,23 @@ module Nanoc
10
10
  #
11
11
  # @return [Array] The converted array
12
12
  def __nanoc_symbolize_keys_recursively
13
- array = []
14
- each do |element|
15
- array << (element.respond_to?(:__nanoc_symbolize_keys_recursively) ? element.__nanoc_symbolize_keys_recursively : element)
13
+ map do |element|
14
+ if element.respond_to?(:__nanoc_symbolize_keys_recursively)
15
+ element.__nanoc_symbolize_keys_recursively
16
+ else
17
+ element
18
+ end
16
19
  end
17
- array
18
20
  end
19
21
 
20
22
  def __nanoc_stringify_keys_recursively
21
- array = []
22
- each do |element|
23
- array << (element.respond_to?(:__nanoc_stringify_keys_recursively) ? element.__nanoc_stringify_keys_recursively : element)
23
+ map do |element|
24
+ if element.respond_to?(:__nanoc_stringify_keys_recursively)
25
+ element.__nanoc_stringify_keys_recursively
26
+ else
27
+ element
28
+ end
24
29
  end
25
- array
26
30
  end
27
31
 
28
32
  # Freezes the contents of the array, as well as all array elements. The
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Nanoc
4
4
  module Core
5
- VERSION = '4.12.20'
5
+ VERSION = '4.12.21'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nanoc-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.12.20
4
+ version: 4.12.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Defreyne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-15 00:00:00.000000000 Z
11
+ date: 2024-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64
@@ -322,7 +322,7 @@ licenses:
322
322
  - MIT
323
323
  metadata:
324
324
  rubygems_mfa_required: 'true'
325
- source_code_uri: https://github.com/nanoc/nanoc/tree/nanoc-core-v4.12.20/nanoc-core
325
+ source_code_uri: https://github.com/nanoc/nanoc/tree/nanoc-core-v4.12.21/nanoc-core
326
326
  post_install_message:
327
327
  rdoc_options: []
328
328
  require_paths:
@@ -338,7 +338,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
338
338
  - !ruby/object:Gem::Version
339
339
  version: '0'
340
340
  requirements: []
341
- rubygems_version: 3.5.3
341
+ rubygems_version: 3.5.9
342
342
  signing_key:
343
343
  specification_version: 4
344
344
  summary: Core of Nanoc