nanoc-core 4.12.2 → 4.12.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3dc7e6692696f6b2b0bbf15a7c5f0aa607af851182de259323b3f18869117ef0
|
4
|
+
data.tar.gz: a6964648a0eb41ffbffbda9fd9b18da1f80dd83a1a86d8564aee05f6bd5be16d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ee96bf469d44eb81ee815f6adf1439dadcd7efa34fdb9f71c057888ac4b690d799506d24b3fce04d54530deca15deb3564894cd340f519fde93fdeb80295487
|
7
|
+
data.tar.gz: cfa697a3471cb5efb04c8d9e7f919c39b399f958b2f20a8232bd6c3d2d5214fd2a3acf4fb4308a4b094cbf02c4bb87ae050379c6a3b0421092101c2576e69432
|
@@ -36,7 +36,13 @@ module Nanoc
|
|
36
36
|
# @return [void]
|
37
37
|
def load
|
38
38
|
# rubocop:disable Security/Eval
|
39
|
-
eval(
|
39
|
+
eval(<<~CODE, TOPLEVEL_BINDING)
|
40
|
+
unless respond_to?(:use_helper)
|
41
|
+
def self.use_helper(mod)
|
42
|
+
Nanoc::Core::Context.instance_eval { include mod }
|
43
|
+
end
|
44
|
+
end
|
45
|
+
CODE
|
40
46
|
eval(@data, TOPLEVEL_BINDING, @filename)
|
41
47
|
# rubocop:enable Security/Eval
|
42
48
|
nil
|
@@ -18,15 +18,20 @@ module Nanoc
|
|
18
18
|
contract Nanoc::Core::ItemRep, C::KeywordArgs[is_outdated: C::Bool], C::Func[C::None => C::Any] => C::Any
|
19
19
|
def run(rep, is_outdated:)
|
20
20
|
if can_reuse_content_for_rep?(rep, is_outdated: is_outdated)
|
21
|
+
# If cached content can be used for this item rep, do so, and skip
|
22
|
+
# recalculation of the item rep compiled content.
|
21
23
|
Nanoc::Core::NotificationCenter.post(:cached_content_used, rep)
|
22
|
-
|
23
24
|
@compiled_content_store.set_all(rep, @compiled_content_cache[rep])
|
24
25
|
else
|
26
|
+
# Cached content couldn’t be used for this rep. Continue as usual with
|
27
|
+
# recalculation of the item rep compiled content.
|
25
28
|
yield
|
29
|
+
|
30
|
+
# Update compiled content cache, now that the item rep is compiled.
|
31
|
+
@compiled_content_cache[rep] = @compiled_content_store.get_all(rep)
|
26
32
|
end
|
27
33
|
|
28
34
|
rep.compiled = true
|
29
|
-
@compiled_content_cache[rep] = @compiled_content_store.get_all(rep)
|
30
35
|
end
|
31
36
|
|
32
37
|
contract Nanoc::Core::ItemRep, C::KeywordArgs[is_outdated: C::Bool] => C::Bool
|
@@ -19,20 +19,25 @@ module Nanoc
|
|
19
19
|
def initialize(items, layouts, config)
|
20
20
|
super(Nanoc::Core::Store.tmp_path_for(config: config, store_name: 'dependencies'), 5)
|
21
21
|
|
22
|
+
@config = config
|
22
23
|
@items = items
|
23
24
|
@layouts = layouts
|
24
25
|
|
25
|
-
|
26
|
-
items.each { |o| add_vertex_for(o) }
|
27
|
-
layouts.each { |o| add_vertex_for(o) }
|
28
|
-
add_vertex_for(config)
|
29
|
-
add_vertex_for(items)
|
30
|
-
add_vertex_for(layouts)
|
26
|
+
rebuild_refs2objs
|
31
27
|
|
32
28
|
@new_objects = []
|
33
29
|
@graph = Nanoc::Core::DirectedGraph.new([nil] + objs2refs(@items) + objs2refs(@layouts))
|
34
30
|
end
|
35
31
|
|
32
|
+
def rebuild_refs2objs
|
33
|
+
@refs2objs = {}
|
34
|
+
@items.each { |o| add_vertex_for(o) }
|
35
|
+
@layouts.each { |o| add_vertex_for(o) }
|
36
|
+
add_vertex_for(@config)
|
37
|
+
add_vertex_for(@items)
|
38
|
+
add_vertex_for(@layouts)
|
39
|
+
end
|
40
|
+
|
36
41
|
contract C_OBJ_SRC => C::ArrayOf[Nanoc::Core::Dependency]
|
37
42
|
def dependencies_causing_outdatedness_of(object)
|
38
43
|
objects_causing_outdatedness_of(object).map do |other_object|
|
@@ -53,14 +58,12 @@ module Nanoc
|
|
53
58
|
|
54
59
|
def items=(items)
|
55
60
|
@items = items
|
56
|
-
|
57
|
-
add_vertex_for(items)
|
61
|
+
rebuild_refs2objs
|
58
62
|
end
|
59
63
|
|
60
64
|
def layouts=(layouts)
|
61
65
|
@layouts = layouts
|
62
|
-
|
63
|
-
add_vertex_for(layouts)
|
66
|
+
rebuild_refs2objs
|
64
67
|
end
|
65
68
|
|
66
69
|
def new_items
|
data/lib/nanoc/core/version.rb
CHANGED
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.
|
4
|
+
version: 4.12.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis Defreyne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -300,7 +300,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
300
300
|
- !ruby/object:Gem::Version
|
301
301
|
version: '0'
|
302
302
|
requirements: []
|
303
|
-
rubygems_version: 3.2.
|
303
|
+
rubygems_version: 3.2.28
|
304
304
|
signing_key:
|
305
305
|
specification_version: 4
|
306
306
|
summary: Core of Nanoc
|